← All exercises
Exercise 05

Going Live

From localhost to the world — agent-operated infrastructure

Duration 60–120 minutes
Difficulty Intermediate
Prerequisites Exercise 04 — a working Travel Bucket List app.
Going Live

Overview

Your app works on localhost. It looks great. But try sending the URL to a friend — you can't. localhost means "this computer, right here." To everyone else in the world, your app doesn't exist. This chapter fixes that.

You're going to rent a small server, point a domain at it, and deploy your Travel Bucket List for the world to see — with HTTPS, automatic restarts, and a proper setup. Your AI agent will operate the infrastructure directly: provisioning the server, SSHing in to configure it, and calling the Cloudflare API to set up DNS.

Your agent just connected to a remote computer via SSH and ran commands on it. This is the same thing a system administrator does — but instead of remembering arcane commands and flags, you described what you wanted in plain English. Infrastructure-as-conversation.

— from the exercise

By the end of this exercise

A real Ubuntu server provisioned on Hetzner Cloud
SSH access with hardened security (non-root user, firewall)
Your app deployed and running via Node.js
Caddy reverse proxy with automatic HTTPS (Let's Encrypt)
DNS configured via the Cloudflare API — no dashboards
systemd service for automatic restarts and boot persistence
A live URL you can share with anyone in the world

Terms you'll learn

Term What it means
VPS Virtual Private Server — a small computer you rent in a data centre
SSH Secure Shell — a way to connect to and control a remote server
Reverse proxy Software that sits in front of your app and handles incoming traffic
HTTPS Encrypted web traffic — the padlock icon in your browser
DNS The phone book of the internet — maps domain names to IP addresses
A record The most basic DNS entry — maps a domain name directly to an IP address
systemd Linux's service manager — keeps your app running even after reboots

Sections in this exercise

01 What You'll Build
02 What You'll Need
03 Why Self-Host?
04 Create Your Server
05 The Agent SSHes In
06 Harden the Server
07 Deploy the App
08 Set Up the Web Server
09 Point Your Domain with the Cloudflare API
10 Make It Survive Reboots
11 Test the Full Stack

The agent's role expanded. In Chapter 4, it wrote code. In this chapter, it operated infrastructure — provisioning servers, SSHing into remote machines, calling APIs, managing system services. The agent went from pair programmer to DevOps engineer.