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:
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
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
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
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.
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.
Start and enable Nginx
Open a browser and go to your server's IP address. You should see the Nginx default welcome page. That means it's working.
Your First Web Page
The default Nginx page lives at /var/www/html. Let's replace it with something you wrote.
Paste this HTML into nano
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.
index.html it finds in /var/www/html/. Drop any HTML/CSS/JS files here and they're instantly live.
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:
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:
When the IP in the ping output matches your server IP, DNS has propagated and you're ready for Part 6.
nano /etc/nginx/sites-available/default and make sure the server_name line includes your domain.
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
Get your certificate
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.
certbot renew --dry-run