91

I went through some manuals and I didn't understand yet. How do I disable autostart nginx service?

techraf
  • 3,306
  • 10
  • 26
  • 37
Alex Malex
  • 2,612
  • 9
  • 25
  • 26

2 Answers2

117

Try this command:

sudo update-rc.d -f nginx disable
SirCharlo
  • 39,016
  • 10
  • 75
  • 82
61

Update:
I made changes to supports more distributions:

use this:

sudo systemctl disable nginx

It will disable it and if you like to stop running service use this:

sudo systemctl stop nginx

works on Ubuntu and any Systemd based distributions

S.M.Mousavi
  • 1,126
  • 10
  • 14