Namecheap, which I personally use.
As you are here, I am assuming that you bought your favourite domain name. So now you have to buy a VPS server. If you don't really want to buy, don't worry; there are lots of VPS providers giving us a free trial. Simply go to their website and sign up for the free trial.
Let me tell you their names.
Let's move on to the next step, which is getting a server, once you've signed up for an account with any VPS provider. For this tutorial, I am going to use Linode, but you can use whatever you want.
Click on "Create." After clicking on it, you will see this screen.
Choose server image(OS), server location and server specs.
Choose strong password and remeber that password because we need that to login into server.
click on create button and wait a few minutes.
Let's move on to the next step once that's completed.
HereHere we will connect the Linode server IP to the domain we purchased earlier.
Now that the fun part has begun, let's get started. Let's login into our server using ssh.
ssh root@youdomain.com
apt update
apt upgrade
apt install nginx
ufw allow 80
ufw allow 443
apt install ufw
nano /etc/nginx/sites-available/mysite
server {
listen 80 ;
listen [::]:80 ;
server_name yourdomain.com ;
root /var/www/mysite ;
index index.html ;
location / {
try_files $uri $uri/ =404 ;
}
}
What is in that code that we added?
Well, listen lines tell Nginx to listen for connections on both IPv4 and IPv6.
The server_name is the website that we are looking for.
root specifies the directory we're going to put our website files in.
index determine what the "default" file is.
Easy and Simple right?
mkdir /var/www/mysite
nano /var/www/mysite/index.html
<h1>Test file</h1>
<p>This is my website</p>
<p>vikram.wtf</p>
ln -s /etc/nginx/sites-available/mywebsite /etc/nginx/sites-enabled
systemctl reload nginx
Bingo! We are not done yet, we have to get an SSL certificate for our site.
We are going to install certbot for SSL certificates.
apt install python3-certbot-nginx
certbot --nginx
Now go and write your code and upload to your server using rsync.