Skip to content
All posts

Shipping a Go API to Production on a Budget

A $6 VPS, a systemd unit, Caddy for TLS and Postgres backups to object storage. Our full production setup, costed in shillings.

Kampala Gophers Team3 min read

You don't need Kubernetes to run a reliable Go API. Here's a setup that has served thousands of requests a day for under UGX 25,000 a month.

main.go
srv := &http.Server{
	Addr:              ":8080",
	Handler:           router,
	ReadHeaderTimeout: 5 * time.Second,
	WriteTimeout:      15 * time.Second,
}
go func() { log.Fatal(srv.ListenAndServe()) }()

<-ctx.Done()
srv.Shutdown(context.Background())

// Weekly Intel

Get the next post in your inbox

Event updates and the occasional Go deep-dive. No spam, unsubscribe any time.