Skip to main content
Percher is still being built and account creation is paused — get notified when it opens.
All deploy guides
Deploy guide · runtime = "docker"

Ship Go in ~2 minutes.

Plain Go using `net/http` from the standard library. The template uses a multi-stage Dockerfile with a small non-root Alpine runtime image that carries the compiled binary, tini and CA certificates.

Why Percher fits

  • A small runtime image means a small attack surface and fast cold starts.
  • Static binary, no runtime dependencies — the Dockerfile is dead simple and the build is fast.

Quick start

bunx percher create my-app --template go
cd my-app
bunx percher publish

The first command scaffolds a working Go project plus a percher.toml. Publish builds and deploys it, then prints the live URL.

percher.toml

The canonical config for a Go app on Percher. bunx percher init generates this automatically when it detects Go in your project.

[app]
name = "my-api"
runtime = "docker"
framework = "go"

[web]
port = 8080
health = "/health"

Common gotchas

  • Set `CGO_ENABLED=0` in the build stage if you don't need cgo — the resulting binary is fully static and needs no libc from the runtime image.
  • Install the binary outside `/app` (the template uses `/usr/local/bin/app`). Percher mounts persistent data at `/app/data`, so an image with a file at `/app` cannot start. The fix is not yet in npm release 1.0.1: its template copies the binary to `/app` and fails with `APP_DATA_MOUNT_CONFLICT`. In that generated Dockerfile, change the binary destination and CMD to `/usr/local/bin/app` before publishing.
  • Keep a shell and `wget` (or `curl`) in the runtime image. Percher's container health check runs through `/bin/sh`, so a distroless or `scratch` image is unhealthy on every deploy.
  • `net/http`'s `ListenAndServe` should bind to `:8080` (matching the toml port) — `localhost:8080` won't be reachable from the container's network.

Related docs

Ready to deploy Go?

Start on the Free plan. No credit card, live in ~2 minutes.

Sign up free