Enabling Services at Boot (systemctl enable & disable)
Concept & Overview
Starting a service with systemctl start only launches it for the current session. If the server reboots, the service will stay offline unless you configure it to start automatically on system initialization.
- To start a service at boot, run sudo systemctl enable .
- To verify whether a service is scheduled to launch at boot, run systemctl is-enabled .
- When creating or editing systemd unit files, always notify systemd to reload its configuration cache with sudo systemctl daemon-reload.
- To disable a service from starting at boot, run sudo systemctl disable .
nginx web service to launch at boot. Run sudo systemctl enable nginx. Next, verify that it is configured correctly with systemctl is-enabled nginx. Finally, refresh systemd's unit configurations by executing sudo systemctl daemon-reload.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
sudo systemctl enable nginx | Enable nginx to start at system boot |
systemctl is-enabled nginx | Check if nginx is enabled at boot |
sudo systemctl daemon-reload | Reload systemd manager configuration |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Enable nginx service at boot with "sudo systemctl enable nginx"
- ○Verify enabled status with "systemctl is-enabled nginx"
- ○Reload systemd daemon configuration with "sudo systemctl daemon-reload"
Ready to complete Quest 91?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.