> TAKE IT BACK STEP 03 / 06
root@takeitback:~/guide/03-webserver$ cat readme.md
STEP 03

Host your own websites

Serve any site — this campaign included — from your own box, under your own domain, with automatic HTTPS. A single small config file gets you a real, encrypted web server.

DIFFICULTYIntermediate
TIME1 hour
COST$0–15/yr (domain)
REPLACESSite builders · hosting subscriptions

The pieces

To put a site online you need three things: files to serve, a web server program to serve them, and a domain name pointing at your address. We'll use Caddy because it fetches and renews HTTPS certificates entirely on its own — the part that used to be painful is now automatic.

Install Caddy

root@box:~$ sudo apt install caddy

On Debian/Ubuntu this installs Caddy as a managed service that starts on boot.

you@mac:~$ brew install caddy

Homebrew drops the caddy binary on your path. Run it directly, or have brew services keep it running in the background.

Run Caddy inside WSL2 with the Linux instructions, or grab the native caddy.exe from caddyserver.com if you specifically need it on the Windows host:

$ sudo apt install caddy # inside WSL2

Serve a folder

Caddy is configured by one plain-text file called a Caddyfile. To serve a folder over HTTPS under your domain, that file is four lines — and it's identical on every OS:

Caddyfile yourdomain.com {
root * /var/www/site
file_server
}
root@box:~$ sudo systemctl reload caddy
you@mac:~$ caddy run # or: brew services start caddy
$ caddy run # in WSL2, or caddy.exe run on the host

That's the whole thing. On first load Caddy contacts Let's Encrypt, proves it controls the domain, installs a certificate, and serves your site at https:// with the padlock. It renews forever, automatically.

Point the domain at your box

Buy a domain from any registrar (~$10–15/year). In its DNS settings, add an A record pointing at your public IP. If you host from home, two notes that apply regardless of OS:

// safer than port-forwardingA Cloudflare Tunnel or Tailscale Funnel exposes just this one service without opening any router ports. For a home server this is the recommended path — and if your ISP blocks 80 and 443 outright, it's the only path. See step 04.

Host this very campaign

This landing page and guide are plain files. Drop them in your served folder and they're live — the whole point of building the campaign as static files is that anyone can mirror it on their own box in minutes.

Before you move on