Lesson 13 of 20 · Try it · 45 min
2.6 Hands-on: your domain, pointing at your server, with HTTPS
You'll point app. your domain at your server, put the app from item 2.4 behind nginx, and turn on HTTPS.
Steps
- Buy your domain if you haven't (Domains → Register a domain).
- Add an A record: Host
app, Value your server's IP address. - On your laptop, run
nslookup app.<your domain>until it shows your IP. - On the server: start the app with pm2 and add the nginx file for
app.<your domain>(item 2.4, steps 1 to 4). - Open
http://app.<your domain>. You'll see Hello from my app on my own server. - Turn on HTTPS with a free certificate from Let's Encrypt:
sudo apt install certbot python3-certbot-nginx -y sudo certbot --nginx -d app.<your domain>
Type your email, agree to the terms, and let it set up the redirect to HTTPS.
- Open
https://app.<your domain>. There's a padlock.
Good to know
- The certificate renews by itself.
sudo certbot renew --dry-runchecks that renewing works. - Run certbot only for names you set up by hand, like
app.. For a website you moved from Lynk (item 2.2), Lynk sets up its certificate itself.
Check your work: https://app.<your domain> shows your app, with a padlock.
Try it in Lynk
Now do it yourself. When you're done, come back here and mark this lesson done.
Sign in to try itNext lesson
2.5 Domains and DNS recordsSign in to save your progress and earn the certificate.

