Enable a unit to start automatically.

Section: Enable, Disable, Mask

Enable on boot

bash
bash
sudo systemctl enable nginx
Explanation

Creates the appropriate symlinks so the service starts at boot.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Enable, Disable, Mask
Disable on boot
Disable autostart for a service.
OpenIn sheetbashsame section
Enable and start
Enable service at boot and start it now.
OpenIn sheetbashsame section
Check if enabled
Show whether the service starts at boot.
OpenIn sheetbashsame section
Disable and stop
Disable service at boot and stop it now.
OpenIn sheetbashsame section
Mask a service
Prevent a unit from being started.
OpenIn sheetbashsame section
Unmask a service
Remove masking from a unit.
OpenIn sheetbashsame section