How to set up nginx in ubuntu droplet

May 26, 2014 5.3k views
Hi, I've set up a ubuntu 14.04 x64 droplet and installed dokku in it following this: Now, when I type my ip in browser (still haven't pushed my repo) I this message is shown in browser: Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to Commercial support is available at Thank you for using nginx. Note that this is my very first time setting up a server and I'm 100% noob. What do I need to do next?
3 Answers
Someone asked this question on Hacker news today. Here are the links copied and pasted from there. This may help:
Hi Sascuash,

The real question is what do *you* want to do? There are many different ways to do things. You have full root access and can install whatever you want. So really the options are endless. It's hard to give a concrete answer without knowing what your end goal is. For instance, are you trying to host a static web site or a Rails app? The answer for what to do next will be different depending on that...

I get that message when I restart the droplet.

The reason being - nginx comes up before lighttpd. (If you know how to change the order of what service get's started first - drop me a line. tnx)

Trying to start lighttpd fails:
can't bind to port: 80 Address already in use


 service nginx stop
service lighttpd start
service nginx start
  • Regarding changing the order of startup scripts:

    If you look at /etc/rc2.d (runlevel 2 is the default runlevel for ubuntu), you will see a number of files linked back to files in /etc/init.d.
    Scripts that start with S are startup scripts.
    The next 2 digits indicate the order that the script is executed in that directory (the lower the number, the earlier the execution).

    By me - I had the following setting:


    Doing the following solved the issue:

    mv S20nginx S95nginx
Have another answer? Share your knowledge.