What is the difference between systemctl start and systemctl enable?
start runs a service right now, while enable makes it start automatically at boot. They are independent: a service can be running but disabled, or enabled but stopped. systemctl enable --now does both in one command.
Explain it simply
Think of a shop. start is opening the shutter today. enable is putting it on the weekly schedule so it opens every morning on its own. You can do either without the other.
sudo systemctl start nginxstarts it now. After a reboot, it will not return unless it is enabled.sudo systemctl enable nginxcreates a symlink so systemd starts it at boot. It does not start it immediately.sudo systemctl enable --now nginxdoes both.stopanddisableare the opposites;restartstops then starts;reloadasks the service to re-read its config without dropping connections, if it supports that.
Check both states: systemctl is-active nginx (running or not) and systemctl is-enabled nginx (starts at boot or not). systemctl status nginx shows a summary with recent log lines.
A common interview slip is installing a service, starting it, and forgetting to enable it, so it is gone after the next reboot.
Example
sudo systemctl enable --now nginx
systemctl is-active nginx
# active
systemctl is-enabled nginx
# enabledWhat to say in the interview
"start runs the service now, enable makes it start at boot; they are independent, and enable --now does both. I verify with is-active and is-enabled, and use reload instead of restart when I only changed config."
Common mistakes
- Starting a service but not enabling it, so it disappears after reboot.