Table of Contents

New Machine Setup Playbook

Generalized provisioning for a homelab machine. Not every machine needs every section: pick by role.

1. SSH Access (every machine)

2. Off-LAN Reachability

For machines that should be reachable outside the LAN without port forwarding (and immune to routers without hairpin NAT), a Cloudflare tunnel:

curl -L -o ~/.local/bin/cloudflared \
  https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
cloudflared tunnel login                        # browser auth, picks the zone
cloudflared tunnel create <name>                # writes ~/.cloudflared/<id>.json (secret)
cloudflared tunnel route dns <name> <host>      # one route per hostname

3. Always-On Duty

For a laptop acting as a server:

4. Battery Longevity

For laptops on permanent AC: where firmware exposes /sys/class/power_supply/BAT*/charge_control_end_threshold (recent ThinkPads and many ASUS do), write 75-80 and persist it with a oneshot systemd unit. Undo by setting 100 and disabling the unit.

5. Unattended Credentials

Unattended jobs need non-interactive credentials. Never store passphrases in files.

6. Health Checks and Alerts

A daily cron script with functional probes, not just is-active: actually curl the service's own URL to catch running but unresponsive processes.

7. Lightweight Strip-Down

For low-spec or focused machines:

8. Git Conventions

Checklist

[ ] sshd + key-only auth + authorized_keys
[ ] ufw allows 22
[ ] machine recorded in inventory docs
[ ] (optional) cloudflared tunnel + systemd service
[ ] (optional, laptop) battery threshold + always-on
[ ] keychain wired in ~/.profile
[ ] health-check cron job installed
[ ] ntfy topic chosen + subscribed

See Also