VPS & Self-Hosting

READ TIME 12 MIN
WHAT IS A VPS?

A VPS (virtual private server) is a virtualized slice of a physical server, giving you your own dedicated operating system and resources with full control, at a lower cost than a full dedicated server.

"You do not need to be an expert. You will mostly be copying and pasting a handful of commands."

This walkthrough sets up a simple, real, self-hosted website reachable at your own domain and secured with HTTPS. It uses Vultr as the VPS provider, GoDaddy as the domain registrar, and Debian as the server OS — the same ideas apply to other providers and registrars, with minor differences in the menus. If you'd rather run your own VPN server instead of a website, see self-hosted VPNs in Part 1.

RENT & SET UP THE SERVER

STEP 1 Create an account with a provider

For this example, sign up at Vultr. New accounts often come with promotional credit, though the amount changes over time, so check what's currently offered.

STEP 2 Start a new server

Choose the Cloud Compute (shared) option. This is the standard, affordable VPS.

STEP 3 Pick a plan

Vultr's cheapest plans change often and come with catches, so pick with care. The very cheapest plan (around $2.50/month) is available only in a few locations and is IPv6-only, meaning some services won't reach it — avoid this for a normal website. A better starting point is the roughly $5/month plan with 1GB RAM, which is widely available and has enough resources for a real site.

STEP 4 Choose a location

Pick a data center close to the people who will use your site.

STEP 5 Choose the operating system

Select Debian, the classic, rock-solid choice for servers. Older guides often say "Debian 11," but Debian 11 is now reaching the end of its security support — choose the current version, Debian 13 ("Trixie"), supported into 2028. If you use a different version or a different Linux entirely, the steps below still apply, but some details may vary slightly.

STEP 6 Set the additional features
  • Automatic backups: you can turn this off to save a little money each month. You can always take a manual snapshot for free when you need one (consider turning backups back on later if your site becomes important).
  • Enable IPv6: turn this on.
  • Keep IPv4 enabled: leave this on, since most things still need it.
STEP 7 Deploy the server

Confirm and create it. Wait until the status shows the server is running.

POINT YOUR DOMAIN AT THE SERVER (DNS)

DNS is the system that connects your domain name (like example.com) to your server's address. You set this up at your domain registrar.

STEP 1 Find your server's addresses

In Vultr, open your server's details page. Note down two things: the IPv4 address (looks like 45.63.9.32) and the IPv6 address (looks like 2001:19f0:1000:e1f4:5400:05ff:fec5:d935), which you'll find under the IPv6 tab in the server's settings.

STEP 2 Open your domain's DNS settings

Log in to your registrar (for example, GoDaddy), click your domain, and open the DNS records section. If the registrar has added default records, you can delete them so you start with a clean slate.

STEP 3 Add records that point to your server
TYPEHOSTVALUEPURPOSE
A@your IPv4 addressPoints your bare domain (example.com) to your server.
A*your IPv4 addressWildcard — sends every subdomain (mail., blog., etc.) to the same place.
AAAA@your IPv6 addressIPv6 equivalent of the first record.
AAAA*your IPv6 addressIPv6 wildcard.
STEP 4 Save and test

DNS changes can take anywhere from a few minutes to a few hours to spread across the internet. Once ready, open a terminal on your own computer and run:

ping example.com

If the replies come from your server's IP address, your DNS is working. You can also run host example.com, which lists both the IPv4 and IPv6 addresses your domain now points to.

CONNECT TO YOUR SERVER

STEP 1 Get your login details

In Vultr, your server's page shows a root password. Copy it.

STEP 2 Log in over SSH

On your own computer, open a terminal and connect (replace example.com with your domain, or use the server's IP address):

ssh root@example.com

Paste the password when asked. You will not see the characters as you paste — that is normal.

STEP 3 Update the system

Once you're logged in, bring everything up to date:

apt update
apt upgrade

INSTALL THE WEB SERVER & CREATE YOUR SITE

STEP 1 Install nginx

Nginx is the software that serves your website to visitors:

apt install nginx
STEP 2 Create a folder for your site's files
mkdir /var/www/mysite

If you see a message that /var/www/ already exists, ignore it — that's fine.

STEP 3 Create the home page
nano /var/www/mysite/index.html

Paste in some simple content, for example:

<!DOCTYPE html>
<h1>Hello World!</h1>
<p>I am your website. Thank you for making me.</p>

Save and exit nano by pressing Ctrl+X, then Y, then Enter.

STEP 4 Create the nginx configuration for your site
nano /etc/nginx/sites-available/mysite

Paste in the following, replacing example.org with your domain and mysite with your folder name:

server {
   listen 80;
   listen [::]:80;
   server_name example.org;
   root /var/www/mysite;
   index index.html index.htm;

    location / {
       try_files $uri $uri/ =404;
    }
}

Save and exit (Ctrl+X, then Y, then Enter).

STEP 5 Turn your site on

Link your new configuration into the folder of active sites:

ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/

Check the configuration and restart nginx:

nginx -t
systemctl restart nginx

If nginx -t reports "syntax is ok" and "test is successful," you're good. Visit http://example.com in a browser and you should see your page.

ADD HTTPS (THE PADLOCK) FOR FREE

HTTPS encrypts the connection between your site and its visitors. Certbot sets this up for free using Let's Encrypt.

STEP 1 Install Certbot
apt install certbot python3-certbot-nginx
STEP 2 Get and install the certificate

Run this, listing your domain and its www version:

certbot --nginx -d example.com -d www.example.com

Certbot will ask a couple of simple questions and then automatically update your nginx setup to use HTTPS. After it finishes, your site will work at https://example.com.

That's a complete, working, self-hosted website on a server you fully control, reachable at your own domain and secured with HTTPS.

TROUBLESHOOTING

You see the default nginx welcome page instead of your site

This means nginx is still serving its built-in default site. First, see which sites are active:

ls -la /etc/nginx/sites-enabled/

If a default site is listed, remove it:

rm /etc/nginx/sites-enabled/default

Confirm your own site is still active, then reload nginx:

ls -la /etc/nginx/sites-enabled/mysite
systemctl restart nginx

Reload http://example.com and your real site should appear.

nginx -t complains about server names

If nginx -t warns about server_names_hash_bucket_size, open the main config:

nano /etc/nginx/nginx.conf

Find the line containing server_names_hash_bucket_size, remove the # at the start to uncomment it, then save, and run nginx -t and systemctl restart nginx again.

Leftover DNS records from an old host

If your domain used to be hosted somewhere else, go back into your registrar's DNS settings and delete any old records pointing to the previous host, so nothing conflicts with your new server.