So you watched some tutorials (like this one) on how to make a website. You made it and now you want to publish it online. Maybe even on your own Linux server(hosted on your computer, Amazon EC2 or another cloud server). This tutorial is going to show you how to upload your website and point a domain
1) Get your server ready
I can recommend Amazon EC2 as it is easy to maintain, idiot-proof and what is most important it has a free tier. Once you sign in to Amazon go to the console and click "Launch Instance" as on image.
At the end of the deployment, Amazon will also provide you with the pem/ppk file - you will need it later to connect to the server(security feature).
2) Get ftp and SSH clients
FTP client will be used to transfer the files to the server. It is very simple to use so don't get scared. I personally recommend Filezilla which is probably the most popular, Configuration of Filezilla is as easy as clicking File/Sites Manager and pasting server IP address and ppk file from point 1. It took my grandmother 15 minutes to do it (she was 87 that time). Just in case of confusion I made a screenshot and highlighted what and where should be done.
SSH client will be used to connect to the server and change parameters. I recommend Putty (https://www.putty.org/). It is also intuitive to use Putty but just in case here is the step by step tutorial https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html
3) Upload your website to the server using Filezilla
Connect to the server and simply drag and drop catalogue with your website to /right-click have uploaded folder called "brzezina". There was an error during the first round "Access denied". If it happens to you simply right-click on the "www" folder and set the permissions (777 would do the job).
4) Setup Nginx
What is it about? Well, you will be able to host many websites on just one server. Nginx will be like a
In order to do that you will have to connect to the server using Putty. To install Nginx run those command line by line:
1.. Install nginx:
apt-get install nginx2. Enable and run the thing:
systemctl start nginx
systemctl enable nginx
Let's set up your website. Create config file by entering this line:
nano etc/nginx/sites-available/yoursite.com
Then paste the following(remember to change domain name and folder)
server {
listen 80;
server_name http://biuro-brzezina.pl;
location / {
root /var/www/brzezina;
}
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
}
ln -s /etc/nginx/sites-available/yoursite.com /etc/nginx/sites-enabled/yoursite.comAnd restart Nginx:
service nginx restartAny problems? There is a simple tutorial on Nginx usage here:
http://nginx.org/en/docs/beginners_guide.html
Remember to change your domain name and folder:)


5) Set DNS for your domain
To do this you will have to go to the website where you bought your domain and click "manage dns". It is as simple as pasting the IP address of your server. Below I provide a screenshot from godaddy.com. There is step by step tutorial in here: https://gethelp.wildapricot.com/en/articles/546-godaddy-dns-setup
This is it. Now when anyone will enter your domain name in the browser he will be brought to your server, then nginx will take him to the place where your website is stored. I am happy to help you in case of any problems excluding questions "what I have to put in the registration form for Amazon"(believe me or not but I had this kind of questions).
How to publish your website on Amazon EC2 Linux Ubuntu server
It will work on other Linux servers as well
Amazon AWS FileZilla Nginx Ubuntu Linux