w wokku
Get Started
~/docs
/
frameworks

# Deploy Go

Updated · Edit on GitHub ↗

Deploy a Go web service to Wokku. The buildpack compiles your module into a
single binary — fast builds, tiny runtime.

Prerequisites

1. Create the app

Apps → New App → server, name my-go-app, box size, Create.

2. Prepare your Go app

The Go buildpack detects go.mod and builds the main package. Listen on $PORT:

go
port := os.Getenv("PORT")
if port == "" { port = "8080" }
log.Fatal(http.ListenAndServe(":"+port, nil))

If your main package isn’t at the repo root, declare it with a Procfile:

procfile
web: bin/my-go-app

The buildpack names the binary after your module’s last path segment. You can
also commit a Dockerfile for full control — Wokku uses it automatically when present.

3. Set environment variables

App → Config → add any config your service reads from the env.

4. Add a database (optional)

bash
wokku addons:create postgres my-go-app

Read os.Getenv("DATABASE_URL") in your database/sql / pgx setup. See
Create & Link a Database.

5. Deploy

bash
git remote add wokku git@git.wokku.cloud:my-go-app
git push wokku main

Live at https://my-go-app.wokku.app.

Custom domain

Custom Domains — SSL is automatic.

Troubleshooting

  • Crashes on boot — listen on os.Getenv("PORT"), not a fixed port.
  • Wrong binary started — add a Procfile pointing at the right bin/<name>.
  • Build can’t find main — ensure package main + func main() are reachable from go.mod.

Next steps

Was this page helpful?