Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 61 down vote accepted

Try this command:

sudo update-rc.d -f nginx disable
share|improve this answer
I tried sudo update-rc.d -f nginx disable. What is the difference between them? – Alex Malex Aug 17 '12 at 14:15
The difference is that disable is better! :) You got me. It effectively 'makes dpkg aware of your preference to prevent the startup scripts from being executed (because dpkg runs update-rc.d too)'. Credit to @Lekensteyn for the explanation. – SirCharlo Aug 17 '12 at 14:19
I already run disable and then remove. How can I undo it? – Alex Malex Aug 17 '12 at 14:32
Umm.. You want to enable autostart now? – SirCharlo Aug 17 '12 at 14:34
sudo update-rc.d nginx defaults; sudo update-rc.d -f nginx disable – SirCharlo Aug 17 '12 at 15:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.