Getting a website up on Vultr

TLDR : Or any VPS really. Digital Ocean too.

Aditya Sujith Gudimetla
3 min readJun 8, 2022

--

Let’s say you have a VPS and want to get an application up. Can be an twitter bot, can be a website, can be anything, really.

Follow the steps below to claim your reward! (of getting your website up. Also something something Raid Shadow Legends).

You also will need a MasterCard/Visa/Paypal account card that takes international payments.

I’ll probably update this with more detailed steps later on.

Note: I’m going to assume some level of technical experience. If none, drop a message and we’ll figure it out. I’m using Nginx + pm2 since I’m running all applications in the background and using Nginx as a reverse proxy only.

I’m also assuming that your VPS is going to be on Ubuntu 22.04. There shouldn’t be any significant differences between Ubuntu versions, but changing the OS will require different articles than the ones I’m pasting here. Have a look and change based on your OS.

Step 1 (Installing Nginx)

Follow this article on how to install nginx: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-22-04

Note : In the article, it says to use

sudo ufw allow 'Nginx HTTP'

Instead, use

sudo ufw allow 'Nginx Full'

Digital Ocean has articles for multiple OS, so check.

Step 2 (Installing Certbot)

Installing certbot : https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal

Note: Don’t run

certbot --nginx

We’ll run it after Step 3.

Step 2.5 (Nginx Kerfuffle)

Note : I’m adding this on 18th May 2023, so yay for me. It’s worth pointing out that before running certbot, you have to make sure that the domains you wish to generate the certificates for are in the /etc/nginx/sites-enabled/your_domain.com file.

Navigate to the nginx config files for default. If you have another file, then navigate to that instead and set the following. You’ll find the folders at

$ cd /etc/nginx/sites-enabled
$ vi adityagudimetla.com

Add to the file the location attribute under the topmost server block. ( I don’t completely understand all the options beyond a surface level, but this works).

Set the proper port number in line 4. This is the port on which your application (in my case node) is running.

server {

server_name yourDomain.com www.yourDomain.com;

location / {
# proxy_pass http://localhost:9005;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

Added this after the certbot nonsense. Should be before.

Step 3

Note: I’m going to assume you have a domain name. If you don’t, buy one. Cheapest is 10$ or ₹799 for a year. Can be cheaper. After you’ve bought the domain, make a free cloudflare account. Point it to the IP location of your VPS.

Run

certbot --nginx -d YourDomainName.com -d www.YourDomainName.com

which in my case was

certbot --nginx -d adityagudimetla.com -d www.adityagudimetla.com

Step 4 (Installing node)

Installing Node : Rather than directly installing node, I’d recommend using NVM to install it. So install NVM using the following command.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Then

nvm install node

for the latest version.

Step 5

Installing PM2

npm install pm2 -g

Step 6

Use filezilla to transfer your applications to the VPS. I’m going to assume that this is a node application and there is an entry point file (index.js).

Navigate to your directory with index.js and run the following.

pm2 start index.js

If everything’s done alright, you should have your website up and running.

Mine’s on www.adityagudimetla.com

--

--

Aditya Sujith Gudimetla

I do stuff. Like stuff about policy. And book stuff. And gaming stuff. And stuff about life. And stuff about stuff.

Recommended from Medium

Lists

See more recommendations