systemctl enable --now: Autostart a Service at Boot

Enable a systemd service to start at boot and start it immediately with one command.

LinuxcommandsystemdserviceMedium risk
Run sudo systemctl enable --now nginx to both create the boot-time symlink and start the service now; use sudo systemctl disable --now nginx to undo both.

01Command

Command
$ sudo systemctl enable --now nginx

02What it does

enable creates the symlinks that hook the unit into the boot process, but by itself it does NOT start the service — a freshly enabled service stays stopped until the next reboot or a separate start command. The --now option removes that trap by starting the units right after enabling them. The exact inverse is disable --now, which removes the boot symlink and stops the unit. Verify with systemctl status <unit>: "enabled" means it will start at boot, "active (running)" means it is running now.

03Risk

RiskMedium risk
RequirementsRoot privileges (sudo) for system units
!Warning: Enabling a service does not start it, and starting a service (start/restart) does not enable it — forgetting --now is the classic reason a "working" service disappears after the next reboot.

04Undo

Undo
$ sudo systemctl disable --now nginx

05Sources

  • Ubuntu Manpage: systemctl - Control the systemd system and service manager
    manpages.ubuntu.com · technical · 2026-09-17
    Evidence: "enable NAME... — Enable one or more units ... This will ... create symlinks ... hooking the specified units into various places"; "--now — When used with enable, the units will also be started. When used with disable ... the units will also be stopped."
  • systemctl(1) — Arch Linux manual
    man.archlinux.org · technical · 2026-09-17
    Evidence: "--now — When used with enable, the units will also be started. When used with disable or mask, the units will also be stopped." enable "hook[s] the specified units into various places" via symlinks.

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions