Building a $0 VPS on Google Cloud: DietPi, Tailscale, IPv6, and the traps I hit
I wanted a small always-on Linux box: private SSH access, no public IPv4, and a bill of exactly zero. The job is modest — a dashboard for the box itself, a couple of small scripts, an SSH endpoint I can reach from anywhere — but renting a VPS for that is paying monthly for a machine that mostly idles. What I got was a working VM, after falling into five traps and several installer bugs that cost…
The author sought a small, constantly-running Linux machine with private SSH access, no public IPv4, and a zero-dollar bill. However, they encountered five obstacles and a few installer bugs that delayed their goal by an evening. After resolving these issues, they verified the actual charges on Google Cloud Billing.
The target Google Cloud e2-micro (2 shared vCPU, 964 MB RAM) used a Debian 13 Trixie base with DietPi installed. In contrast to plain Debian, DietPi consumed 248 MB of RAM, which is 36% less and allows running a small service on the 964 MB machine.
Trap 1: Running DietPi's conversion script on a cloud VM led to the loss of Tailscale and the guest-agent path. To avoid this, create a new VM from the official DietPi image, keeping the old one running as a rollback plan.
Trap 2: GCP only accepts an image named disk.raw. Downloading the DietPi image and repacking it led to an error. To fix this, download the image, rename it to disk.raw, create a tar file, upload it to Google Cloud Storage, and create a new image with the correct source URI and guest OS features.
Trap 3: The VM was initially assigned a public IPv4 and had a default password. The author resolved this by inspecting the resulting instance immediately after creation using gcloud compute instances describe and rotating the default credentials. They also used SSH keys instead of passwords and checked both IPv4 and IPv6 firewall rules.
Trap 4: Without an external IPv4, the Tailscale node appeared active but unreachable. Two causes contributed to this issue: the VM being on the wrong VPC (default, IPv4-only) and the network configuration not completing DHCPv6. Addressing these issues required creating the VM on a custom VPC with IPV4_IPV6 stackType and ensuring proper DHCPv6 configuration.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.