LAB 01

Host Your First Website on a VPS

🟢 Beginner ⏱ ~60 minutes 💻 VPS required 🐧 Ubuntu 24.04 LTS / 26.04
Linux Nginx SSH DNS SSL/TLS
// Part 1

Before You Start

A VPS — Virtual Private Server — is a real Linux computer running in a data center somewhere in the world. You rent it by the month, connect to it over the internet, and control it entirely through the terminal. No mouse. No desktop. Just you and the command line.

By the end of this lab your own website will be live on the internet — not on someone else's platform, not behind a login wall. A real server you control, running a web server you installed, serving a page you wrote.

What you need

A VPS running Ubuntu 22.04 or 24.04. Any of these providers work:

Recommended VPS providers Affiliate links — GeekU earns a small commission if you sign up. Keeps the labs free.
RackNerd — Trusted · Helps the site · Great for learning Lowendbox — Not a provider but a list of current deals...

You also need a terminal. On Mac or Linux it's built in. On Windows use PuTTY or enable WSL (Windows Subsystem for Linux).

A domain name is optional for this lab but recommended for Part 5. Grab one at Namecheap.com

Expected time: About 60 minutes if you follow along. Don't rush — understanding what each command does matters more than speed.
// Part 2

First Login via SSH

Once your VPS is provisioned your provider will email you an IP address, a username (usually root), and a temporary password or SSH key. This is how you connect.

Connect via SSH

# Replace 123.456.789.0 with your actual server IP ssh root@123.456.789.0 The authenticity of host '123.456.789.0' can't be established. Are you sure you want to continue connecting? (yes/no): yes root@ubuntu:~#

You're in. That prompt means you are now controlling a computer in a data center. Everything you type runs on that machine, not yours.

Update the server first

# Always update before installing anything apt update && apt upgrade -y Reading package lists... Done Calculating upgrade... Done
What those flags do: apt update fetches the latest package list. apt upgrade installs the updates. The -y flag auto-confirms every prompt so you're not sitting there pressing Y twenty times.
// Part 3

Install Nginx

Nginx is a web server. Its job is to listen for incoming connections on port 80 (HTTP) and port 443 (HTTPS) and respond with your web pages. It's fast, lightweight, and runs fine on a 12/year VPS.

apt install nginx -y Reading package lists... Done Setting up nginx ...

Start and enable Nginx

# Start it now systemctl start nginx # Make it start automatically on every reboot systemctl enable nginx # Verify it's running systemctl status nginx ● nginx.service - A high performance web server Active: active (running)

Open a browser and go to your server's IP address. You should see the Nginx default welcome page. That means it's working.

What just happened: Nginx is now listening on port 80. When your browser sent a request to your IP, Nginx answered it. That's how the web works — a request goes out, a server answers. You just built the server side of that.
// Part 4

Your First Web Page

The default Nginx page lives at /var/www/html. Let's replace it with something you wrote.

# Go to the web root cd /var/www/html # See what's already there ls # Create your own index.html nano index.html

Paste this HTML into nano

<!DOCTYPE html> <html> <head><title>My First VPS</title></head> <body> <h1>Hello from my VPS!</h1> <p>Built with GeekU Lab 01</p> </body> </html>
# Save in nano: Ctrl+O → Enter → Ctrl+X to exit

Refresh your browser. You should see your own page instead of the Nginx default. That HTML file on your server is now being served to anyone in the world who visits your IP address. That's a website.

Tip: Nginx serves whatever index.html it finds in /var/www/html/. Drop any HTML/CSS/JS files here and they're instantly live.
// Part 5 — Optional

Connect a Domain

IP addresses work but nobody remembers them. A domain name makes your site feel real and is required for HTTPS in Part 6. If you don't have one yet you can grab one and come back.

Add an A record at your registrar

Log into Namecheap, GoDaddy, or wherever you registered your domain. Go to DNS settings and add this:

Type: A Host: @ Value: YOUR.SERVER.IP.ADDRESS TTL: Automatic

If you also want www.yourdomain.com to work, add a second A record with Host set to www pointing to the same IP.

Wait for DNS to propagate

DNS changes take anywhere from 5 minutes to a few hours depending on your registrar. Check progress from your server:

ping yourdomain.com PING yourdomain.com (123.456.789.0) ...

When the IP in the ping output matches your server IP, DNS has propagated and you're ready for Part 6.

Note: You may need to configure an Nginx server block for your domain. If your IP works but your domain doesn't after DNS propagates, run: nano /etc/nginx/sites-available/default and make sure the server_name line includes your domain.
// Part 6

Enable HTTPS with Certbot

HTTP sends data in plain text. Anyone on the network between your browser and the server can read it. HTTPS encrypts everything. The padlock in the browser URL bar is the visible proof that it's working.

Certbot is a free tool from the Electronic Frontier Foundation that gets you a trusted SSL certificate from Let's Encrypt in one command and wires it into Nginx automatically.

Install Certbot

apt install certbot python3-certbot-nginx -y

Get your certificate

# Replace yourdomain.com with your actual domain certbot --nginx -d yourdomain.com Enter email address: you@email.com Agree to terms? (Y)es: Y Share email with EFF? (Y/N): N Successfully deployed certificate for yourdomain.com Congratulations! You have successfully enabled HTTPS.

Now open your browser and go to https://yourdomain.com. You should see the padlock. Your site is now encrypted and trusted by every major browser — for free.

Auto-renewal: Let's Encrypt certs expire every 90 days but Certbot installs a cron job that renews automatically. You don't need to touch it. Test that renewal works anytime with: certbot renew --dry-run
🎉 Lab complete. You provisioned a Linux server, installed a web server, wrote an HTML page, pointed a domain at it, and secured it with HTTPS. You just did what most of the internet runs on. Lab 02 builds on this same server — you'll install your own VPN next.