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/colinmc.me
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:
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/colinmc.me, which you should then see at colinmc.me.
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.