echo6-docs/archive/projects/utility-caddy-initial-setup.md
echo6-autocommit b387c94190 auto: docs sync 2026-06-15T20:23:38+00:00
Files changed: .obsidian/workspace.json archive/README.md archive/projects/DEPLOY-API-KEYS-TAB.md archive/projects/arr-stack-runbook.md archive/projects/arr-wiring-runbook.md archive/projects/cc-deploy-watchtower-v2.md archive/projects/headscale-full-deployment.md archive/projects/last-ember-project.md archive/projects/mmud/last-ember-chronicle.html archive/projects/mmud/last-ember-howto.html archive/projects/mmud/last-ember.html archive/projects/mmud/mmud-phase5-prompt.md archive/projects/mmud/mmud-phase6-prompt.md archive/projects/mmud/mmud-prompts/mmud-prompts/01-update-planned.md archive/projects/mmud/mmud-prompts/mmud-prompts/02-npc-nodes.md archive/projects/mmud/mmud-prompts/mmud-prompts/03-darkcragg.md archive/projects/mmud/mmud-prompts/mmud-prompts/04-dcrg-node.md archive/projects/mmud/mmud-prompts/mmud-prompts/05-phase5.md archive/projects/mmud/mmud-prompts/mmud-prompts/06-phase6.md archive/projects/mmud/mmud-prompts/mmud-prompts/README.md archive/projects/mmud/mmud-prompts/mmud-prompts/mmud-project.md archive/projects/openwebui-theme-deploy.md archive/projects/peertube-phase2-project.md archive/projects/peertube-rebuild.md archive/projects/utility-caddy-initial-setup.md archive/projects/vaultwarden-deployment.md archive/reports/logistics_migration.md archive/reports/post_validation_report.md archive/reports/task_a_aurora_validation.md archive/reports/task_c_watchdog_test.md projects/deploy-livesync.md
2026-06-15 20:23:38 +00:00

2.5 KiB
Executable file

Utility Caddy LXC — Initial Setup

One-time setup. Only needed if rebuilding from scratch.

Overview

Item Value
CT ID 101
Hostname caddy
Local IP 192.168.1.101
Tailscale IP 100.64.0.8
Public access 199.6.36.163 (router forwards 80/443)

1. Create LXC

ssh root@192.168.1.241

pct create 101 local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst \
  --hostname caddy \
  --cores 1 \
  --memory 512 \
  --swap 256 \
  --rootfs local-lvm:8 \
  --net0 name=eth0,bridge=vmbr0,ip=192.168.1.101/24,gw=192.168.1.1 \
  --features nesting=1 \
  --unprivileged 1 \
  --password <from .ref/credentials>

# TUN device for Tailscale
cat >> /etc/pve/lxc/101.conf << EOF
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
EOF

pct start 101

1b. Bootstrap Standard Packages

Run the Echo6 LXC bootstrap script to install sshpass, curl, git, htop, and other standard packages:

echo6-bootstrap-ct.sh 101

If the script isn't on the Proxmox host yet, run echo6-onboard-node.sh first. See runbooks/proxmox-onboard-node.md.

2. Install Tailscale

pct exec 101 -- bash -c "
echo nameserver 1.1.1.1 > /etc/resolv.conf
apt-get update && apt-get install -y curl
curl -fsSL https://tailscale.com/install.sh | sh
"

3. Register with Headscale

pct exec 101 -- tailscale up --login-server https://vpn.echo6.co --hostname caddy

# On Contabo — register the node
ssh root@100.64.0.1 'docker exec headscale headscale nodes register --key <KEY> --user echo6'

# Verify
pct exec 101 -- tailscale status

4. Install Caddy

pct exec 101 -- bash -c "
apt-get install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf https://dl.cloudsmith.io/public/caddy/stable/gpg.key | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt | tee /etc/apt/sources.list.d/caddy-stable.list
apt-get update && apt-get install -y caddy
"

5. Install acme.sh

pct exec 101 -- bash -c "
curl https://get.acme.sh | sh -s email=admin@echo6.co
"

6. Create initial Caddyfile

pct exec 101 -- bash -c "cat > /etc/caddy/Caddyfile << 'EOF'
{
    email admin@echo6.co
}
EOF
systemctl enable caddy
systemctl start caddy"

7. Router port forward

Forward on your router:

  • TCP 80 → 192.168.1.101:80
  • TCP 443 → 192.168.1.101:443

Done

Add services using the expose-service-home.md runbook.