How do I put up a simple, static website?

Posted June 2, 2016 85.6k views
Getting Started

I am very to new web development and I am simply trying to put up a web page that just says “Hello, world”. I would like to build a portfolio page to post the work that I’ve done in my programming classes but am unsure as to what I need to do have my simple webpage show up. I feel like I am missing a step or series of steps and maybe I just don’t understand everything that is required but this is what I have done (successfully…I believe) thus far:

I don’t know what the next steps are. I have uploaded an html file but that’s where I feel like I am missing something. After I’ve uploaded it, is that it? Is there something significant that I am missing?

edited by kamaln7

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers

Hi @coolinmc6

You’re definitely on the right track! After setting up the DNS records so that your domain points to your Droplet’s IP address, and securing the Droplet (initial server setup), all you need to do is install a webserver and upload the files that it should serve.

The most popular webservers are Apache and Nginx. Nginx performs much better than Apache at serving static files, so I would recommend going with that. Take a look at this tutorial:

Once you’ve followed it and installed Nginx, you’ll want to configure it to use a new path for the files. While you can use almost any path you want, I personally prefer /srv/www. Create that directory, and another directory in it for your domain name in order to make it easier to add other websites with different domain names in the future:

sudo mkdir /srv/www /srv/www/

Then, configure nginx to serve files from that directory. Open /etc/nginx/sites-available/default in your favorite text editor and update the line with the root directive such that it looks as follows:

    root /srv/www/;

Restart nginx in order for the changes to take effect:

sudo service nginx restart

Finally, change the directory ownership to your own user so that you can write to it:

sudo chown -R user:user /srv/www

And you’re done! You can now upload your website’s files using FileZilla to /srv/www/, which you should then see at

by Justin Ellingwood
Nginx is one of the most popular web servers in the world. It is extremely flexible and powerful and can be used to efficiently host sites and applications small or large sites and applications. In this guide we'll cover how to install and set this up on an Ubuntu 14.04 server.

Just thought I would note, remember to allow access to port 80 as explained in the Additional Recommended Settings guide if you had previously set up a firewall.

I was working on an old droplet and kept receiving 504 errors. It took me hours to figure out that was the issue.

by Justin Ellingwood
After setting up the bare recommended configuration for a new server, there are often some additional steps that are highly recommended in most cases. In this guide, we'll continue the initial configuration by tackling some recommended, but optional procedures.

i tried to edit the root line using nano

after editing

i clicked ctrl-x and inputted Y

i got this

*[ Error writing /etc/nginx/sites-available/default: Permission denied ]

please i need help urgently