How to change the default boot target
Topic: Servers linux
Summary
Set the default systemd target (multi-user vs graphical) with systemctl set-default so the system boots to the desired run level. Use this when converting a desktop install to headless, or to force graphical or console-only boot.
Intent: How-to
Quick answer
- systemctl get-default shows current default; systemctl set-default multi-user.target sets default to console (no GUI); systemctl set-default graphical.target for desktop.
- Change takes effect at next boot; to switch immediately without reboot use systemctl isolate multi-user.target (stops graphical services).
- On servers prefer multi-user.target to save resources and reduce attack surface; use graphical only when you need a local desktop.
Prerequisites
Steps
-
Check current default
systemctl get-default; typically graphical.target or multi-user.target. list-units --type=target shows active targets.
-
Set default target
sudo systemctl set-default multi-user.target (for headless server); or graphical.target. The default is written to /etc/systemd/system/default.target (symlink).
-
Apply immediately (optional)
sudo systemctl isolate multi-user.target switches to console now and stops graphical services; no reboot. Use with care on physical desktops (display will go black).
Summary
Set the default systemd boot target with systemctl set-default so the system boots to multi-user (console) or graphical. Use multi-user on servers to save resources; change takes effect at next boot unless you use isolate.
Prerequisites
Steps
Step 1: Check current default
systemctl get-default
Step 2: Set default target
sudo systemctl set-default multi-user.target
Or graphical.target for a desktop. Effective at next boot.
Step 3: Apply immediately (optional)
sudo systemctl isolate multi-user.target
Switches to that target now; use with care.
Verification
systemctl get-defaultshows the new target; after reboot the system starts in that target.
Troubleshooting
Still boots to GUI — Confirm default.target symlink: ls -l /etc/systemd/system/default.target. Isolate disconnects display — Expected when isolating to multi-user; use set-default and reboot if you only want the change on next boot.