I have installed nginx on my Ubuntu 10.04 box. With passenger 3.

Now I've got everything setup correctly; how do I ensure that nginx will start on boot everytime?


Yo can use the command sysv-rc-conf. This will show you the active link in each run level. You can also change the links (add or delete them) by just hitting the space bar on the highlighted cell in the shown table.

Be careful, any change will be immediately applied.

  • If you did not find nginx in the table, you may need to copy its startup under /etc/init.d. – Khaled Jan 11 '12 at 15:17

If you installed from the deb package using dpkg or apt-get then you should be good to go.

Otherwise, the way to do this is to create a startup script. Likely nginx already has one created for just such a purpose, although you could create one if you really wanted to.

These scripts go into /etc/init.d and are run by the startup process. Using sysv-rc-conf or chkconfig helps to enable or disable these scripts, controlling whether things start or not (but leaving the script in place).

However, in Ubuntu, this has largely been replaced by Upstart which is a whole different way of doing things.


You may want to install the rcconf package for an easy way for you to enable/disable the service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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