Your vibe-coded app works on localhost, but nobody else can open it. In this episode we take it from localhost to a real, secure website: a domain, DNS records, a web server, and an SSL certificate, ideally for free.
- Why “localhost” only works on your own machine
- What a domain is and how DNS turns it into a server address
- Which DNS records you need: A and CNAME
- How to get a free SSL certificate with Let’s Encrypt and Certbot
Why your app only works on localhost
localhost means “this computer”. When your app runs at http://localhost:3000, only the browser on the same machine can reach it. To let anyone open it, the app has to run on a computer that is always on and reachable from the internet, a server, and people need an easy name to find that server: a domain.
What a domain is and how DNS works
Every server on the internet has an IP address, a number like 203.0.113.10. Nobody wants to type that. A domain such as example.com is a name you rent, and DNS (the Domain Name System) is the internet’s phone book that answers the question “which IP address belongs to this name?”. When someone opens your domain, their browser asks DNS for the IP, then connects to your server.
Buying a domain: Namecheap vs GoDaddy
You buy (more precisely, rent yearly) a domain from a registrar. In the video we compare Namecheap and GoDaddy. Both work. Compare the renewal price, not just the first-year price, and check whether privacy protection for your contact details is included.
DNS records: A, CNAME and more
Once you own a domain, you add DNS records in the registrar’s dashboard. Two cover almost everything you need:
| Record | What it does | Example |
|---|---|---|
| A | Points a name straight at an IPv4 address | @ → 203.0.113.10 |
| CNAME | Points a name at another name | www → example.com |
@ means the bare domain itself. After saving a record, check what DNS answers from your own computer:
dig +short example.com
dig +short www.example.com
When both print your server’s IP, the domain is ready.
Hosting basics with nginx
On the server, a web server program answers the browser’s requests. We use nginx throughout this series. Installing it on Ubuntu takes two commands:
sudo apt update
sudo apt install -y nginx
Open your domain in a browser and you should see the nginx welcome page. Episode 4 goes through the nginx setup for your own site line by line.
Buying an SSL certificate
Without SSL your site loads over plain http://, browsers show “Not secure”, and anything typed into a form travels unencrypted. An SSL certificate enables https:// and the padlock. Registrars sell certificates, and for some businesses a paid certificate makes sense, but for most sites a free one does exactly the same encryption.
Free SSL with Let’s Encrypt and Certbot
Let’s Encrypt issues free certificates, and Certbot is the tool that requests one and configures nginx for you. With your domain already pointing at the server:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
Certbot proves you control the domain, installs the certificate and can redirect all http traffic to https. Certificates last 90 days and renew automatically. To confirm renewal will work:
sudo certbot renew --dry-run
If it doesn’t work
The domain still doesn’t open your server. DNS changes can take from a few minutes to a few hours to spread. Run dig +short example.com again; until it prints your server’s IP, nothing else will work.
Certbot fails with a challenge or connection error. Let’s Encrypt has to reach your server on port 80. Check that the domain resolves to the server, that nginx is running, and that ports 80 and 443 are open in your server’s firewall.
Next
A domain needs a server to point at. In episode 3 we create one: an Ubuntu server on AWS Lightsail.
