A beginners tutorial to hosting websites in GNU/Linux

Ever wanted to host your own website? Have a spare PC laying around (even REALLY old) that you can use? This tutorial is going to show you how!

Now, three disclaimers I am going to give:

  • This tutorial will be done nearly entirely with the command line. I personally find it much easier, and less time consuming to do this sort of work in a terminal, plus it’s good practice to anyone who decides they want to work with remote servers in the future for hosting a website off-site.
  • This tutorial will not be covering hardening, SSL certificates, advanced HTML/CSS/Javascript nor advanced DNS work. This is simply going to show you how to put a website up for others to view, it’s up to you to design it!
  • This tutorial serves as a test, to see the interest in this sort of thing on Ghacks. If reception is good, I will cover more advanced topics relating to server work, webhosting, email servers, hardening, etc. If you the reader is more interested in keeping things on a ‘home user’ level, do let me know in the comments!

For this, we will be using the Nginx webserver. There are multiple webservers available, but the two most common are Apache and Nginx. My production servers all use Nginx, and without drowning you with information about why, I’ll summarize it as, “Better performance.”

This tutorial will assume you are running Debian, Ubuntu, or one of their derivatives; as they are the most common distributions, and Debian is one of the most popular server operating systems anyway due to it’s rock solid stability.

Hosting your own website: The Process

Note: The first thing we want to do is ensure that our system has the latest updates:

  • sudo apt update
  • sudo apt upgrade

If you have any updates to do, agree to them and let it happen.

Next, we want to install nginx:

Nginx should only take a few moments to install, it’s very small. Once that is done, you’ll want to make sure that nginx is running:

  • sudo sysemctl status nginx

OR if not using systemd:

  • sudo service nginx status


Read the full article from the source…

Leave a Reply

Your email address will not be published. Required fields are marked *