Go hosting in 2026: how to deploy a Go app
A Go web app compiles to one binary, so hosting it means building that binary, running it on the port it is given and shutting it down with http.Server.Shutdown. On Livops you push a repository with go.mod: it is built with CGO off into a static binary and runs as a web app for 39 credits a month (39,000 so'm). Here is what Go needs, and how a VPS, Render, Railway, Fly.io and DigitalOcean compare.
By Livops team, the people who build and run LivopsUpdated
Go is the easiest language there is to host: go build leaves one file, and that file is the whole server. What is left to get right is small but specific — a static binary that runs on the host’s system, the port from the environment, timeouts the default server does not set, and a shutdown that lets requests finish. This page covers each, compares where to run a Go app with each provider’s own prices, and ends with exactly what Livops does with a go.mod.
What does a Go app need in production?
A binary built for the server
Go 1.27.4, released on 10 November 2026, is the current release[1]. A Go binary is self-contained unless it uses cgo, and cgo is on by default for native builds where a C compiler is found, off when cross-compiling or when none is found; CGO_ENABLED=0 turns it off explicitly[2]. With it off you get a static binary that runs on any Linux of the same CPU architecture, including an image with nothing else in it. A package that wraps C code, like go-sqlite3, needs cgo, and then the binary depends on the C library it was linked against.
The port from the environment
Read PORT and listen on ":" + port: an address with no host listens on every interface, which is what a container needs. "localhost:8080" is reachable only from inside it.
Timeouts the default server does not have
An http.Server you do not configure waits for ever: when ReadHeaderTimeout and ReadTimeout are zero, there is no timeout on reading a request, and a zero WriteTimeout means none on writing one[3]. A slow client then holds a connection as long as it likes. Set at least ReadHeaderTimeout.
A shutdown that lets requests finish
Server.Shutdown closes the listeners, then the idle connections, then waits for active ones to finish; the moment it is called, ListenAndServe returns ErrServerClosed, so the program must wait for Shutdown to return rather than exit[3]. It does not wait for hijacked connections such as WebSockets[3]. signal.NotifyContext gives you a context that ends when SIGTERM arrives[4].
package main
import (
"context"
"errors"
"net/http"
"os"
"os/signal"
"syscall"
"time"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("ok"))
})
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
srv := &http.Server{Addr: ":" + port, Handler: mux, ReadHeaderTimeout: 10 * time.Second}
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGTERM, os.Interrupt)
defer stop()
go func() {
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
panic(err)
}
}()
<-ctx.Done()
shutdown, cancel := context.WithTimeout(context.Background(), 20*time.Second)
defer cancel()
srv.Shutdown(shutdown)
}
A small image, if you build one
If you ship a Docker image, a multi-stage build compiles in the Go image and copies only the binary into the final one; Docker’s own example ends FROM scratch with nothing but the binary inside[5]. An empty base holds only what you copy into it, so an app that calls HTTPS APIs needs CA certificates copied in as well.
Configuration and a database
Settings and secrets come from environment variables. State that must survive a restart goes to a database: the binary’s own disk is not one.
The options at a glance
| Option | What it is | Smallest paid always-on process | What you still maintain |
|---|---|---|---|
| Livops | A platform; servers in Uzbekistan | 39 credits (39,000 so’m) a month | Your code |
| A VPS in Uzbekistan | A virtual machine with root | 82,000 so’m a month: 1 vCPU, 2 GB, 30 GB HDD (SmartCloud)[6] | The system, a systemd unit, a reverse proxy, HTTPS, deploys |
| Render | A platform with native Go builds | $7 a month: 0.5 CPU, 512 MB[7] | Your code |
| Railway | A platform billed by usage | Hobby: $5 a month, including $5 of usage[9] | Your code |
| Fly.io | Virtual machines billed by the second | $2.19 a month: shared-cpu-1x, 256 MB[10] | Your code, and its Docker image |
| DigitalOcean App Platform | A platform with container instances | $5 a month: 1 shared vCPU, 512 MiB[11] | Your code |
Other providers’ prices are from each provider’s own page, read on 20 November 2026; the dates are in Sources below. Livops prices are the ones the cabinet bills today.
Each option
Livops
A go.mod is all it needs: the binary is built on Livops’s servers and runs as a web app with an address and HTTPS, and every git push ships a new version. Payment is in so’m through Payme or Click, Uzbekistan’s payment services. The servers are in Uzbekistan — close to users there, farther from users elsewhere. You get no root, and one app’s memory stops at 2 GB.
A VPS
Go is where a VPS is at its best: copy one binary, write a systemd unit, done. SmartCloud’s cheapest 2 GB plan is 82,000 so’m a month[6], and a Go server uses so little memory that several fit on it. The rest is still yours: HTTPS, a reverse proxy if you want one, deploys, and the operating system’s updates.
Render
Render lists Go among its native runtimes, beside custom Docker containers[7]. The smallest paid web service is $7 a month for 0.5 CPU and 512 MB[7], and web services also have a free instance type[8].
Railway
The Hobby plan is $5 a month with $5 of usage included and always-on services; memory is about $10 per GB a month and CPU about $20 per vCPU a month[9]. Plans are paid by card[9].
Fly.io
The smallest machine, shared-cpu-1x with 256 MB, is $2.19 a month, billed by the second while it runs[10] — the lowest dollar price here. A personal organisation’s bill under $5 a month is waived[10].
DigitalOcean App Platform
$5 a month buys a fixed shared instance with 1 vCPU, 512 MiB and 50 GiB of outbound transfer, limited to one container instance[11].
VPS or platform: what do you maintain?
With Go, the deploy itself is never the hard part; a binary and scp will do. The cost of a VPS is everything around the binary that has to keep working without you: the unit that restarts it, the certificate that renews, the firewall, the updates, and the day the disk fills. A platform does those and builds from git push, and in exchange you give up root and the choice of machine. If you run many small Go services and like servers, a VPS is cheaper per service. If you would rather not be paged about one, use a platform.
Where can you host a Go app for free?
- Livops has no free tier for apps. On an account that has not paid yet, the first bot or app runs for 15 minutes on a zero balance, once, so you can watch it answer. Static sites are free.
- Render gives each workspace 750 free instance hours a month; a free web service spins down after 15 minutes without inbound traffic and takes about a minute to come back[8].
- Railway has a Free plan with $1 of usage a month, up to 1 vCPU and 0.5 GB per service, that sleeps after 5 to 10 minutes without outbound traffic; a trial gives $5 for 30 days with no card[9].
- Fly.io has no free tier for new organisations: a $1 trial for 7 days, and a personal bill under $5 a month is waived[10].
- DigitalOcean App Platform is free for up to 3 static sites only[11].
Go hosting on Livops
- In the cabinet, create a project from a GitHub repository, or upload the folder or a
.zip. For a monorepo, set the folder the Go module is in. - Put settings and secrets under Variables; a variable marked secret is never shown again. For a database, add PostgreSQL under Databases and read
DATABASE_URL. - Deploy. The log shows
go mod download, the build and the start.
What Livops does with a Go repository that has go.mod (or go.work) at its root and no Dockerfile:
- Install:
go mod download. - Build:
go buildinto.livops/bin/app, with CGO off, so the binary is static. Ifgo-sqlite3is ingo.sum, CGO is turned on for it and the binary is linked statically. - Which package: the main package at the module’s root, else
cmd/server,cmd/apiorcmd/app. With several main packages whose names do not say which one is the server, the import asks you. A module with no main package at all stops with “no main package in this module”: it is a library; see This is a library. - Run: the binary starts on its own; no start command is needed. It runs without the Go toolchain beside it.
- Type: after the first build it is a web app, which must answer HTTP on
PORT. A program that opens no port — a queue consumer, a bot — should be created as a worker or bot instead.
With a Dockerfile in the repository, the Dockerfile builds it; see Docker hosting. To set the commands yourself, put livops.json in the root:
{
"kind": "web",
"build": "go build -o .livops/bin/app ./cmd/server",
"healthPath": "/healthz",
"memory": 256
}
When it runs:
- The environment has
PORT(3000 unless you change it). - On a new push, the new binary has a minute to answer on
PORT— onhealthPathwith 2xx or 3xx, if you set one — before traffic moves to it. The old one keeps running 15 seconds for requests in flight, then gets SIGTERM and 30 seconds, which is whatShutdownabove is for. If the new one never answers, the old one keeps serving. - If it crashes, it is started again; ten crashes inside 15 minutes and it is stopped, and you are told with its last lines.
- Builds may run for ten minutes. What was compiled stays in the project’s cache, so a build that ran out of time continues where it stopped on the next deploy.
- Memory: one CPU and 384 MB by default, or 256, 512, 1024 or 2048 MB; the size is part of what you pay for.
- Files written to
/app/data(theDATA_DIRvariable) survive deploys;/tmpdoes not.
A web app is 39 credits a month (39,000 so’m). One credit is 1,000 so’m; see Pricing.
Questions
Do I need a Dockerfile to deploy Go on Livops?
No. A go.mod or go.work at the root is enough: Livops downloads the modules, builds the binary and runs it. If the repository has a Dockerfile, that is used to build it instead.
Which main package does Livops build?
The one at the module's root, else cmd/server, cmd/api or cmd/app. If the repository has several main packages under cmd/ and their names do not say which one is the server, the import asks you.
Does CGO work, for example with go-sqlite3?
Yes for go-sqlite3: when it is in go.sum, the binary is built with CGO on and linked statically. Everything else is built with CGO off, which is what a static binary needs.
Which port should a Go server listen on?
The one in the PORT variable, 3000 unless you change it. Listen on ":" + os.Getenv("PORT"), which covers every interface. If your app ignores PORT and listens on exactly one other port, 1024 or higher, Livops moves it there once and says so in the log.
My build timed out. What now?
Deploy again. A build may run for ten minutes, and what was compiled stays in the project's cache, so the next build continues from there.
How much does a Go app cost on Livops?
39 credits a month, 39,000 so'm at 1,000 so'm a credit. There is no free tier for apps; the first app on an account that has not paid runs for 15 minutes on a zero balance, once.
Sources
- Go — Release history (go.dev). Checked .
- Go — cmd/cgo (pkg.go.dev). Checked .
- Go — net/http (pkg.go.dev). Checked .
- Go — os/signal (pkg.go.dev). Checked .
- Docker — Multi-stage builds (docs.docker.com). Checked .
- SmartCloud — VDS plans (smartcloud.uz). Checked .
- Render — Pricing (render.com). Checked .
- Render — Deploy for free (render.com). Checked .
- Railway — Pricing (railway.com). Checked .
- Fly.io — Pricing (docs.fly.io). Checked .
- DigitalOcean — App Platform pricing (digitalocean.com). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Go appRelated
- Rust web app hosting: how to deploy an axum or Actix Web appA Rust web app is one release binary that binds 0.0.0.0 on the port it is given and shuts down on SIGTERM. The hard part is the build: a first release build takes minutes, so the host must keep its cache. On Livops you push a repository with Cargo.toml, it is built with cargo build --release and runs as a web app for 39 credits a month (39,000 so'm).
- Docker hosting: how to deploy a Docker container or a DockerfileTo host a container you need a host that builds or pulls the image, starts its CMD, sends traffic to the port it listens on and stops it with SIGTERM. On Livops a Dockerfile at the root of the repository is built on Livops's servers and runs for 39 credits a month (39,000 so'm); a public image from Docker Hub, GHCR or Quay runs without a build. Here is what a container needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- The best Heroku alternative in 2026: six options comparedHeroku moved to a sustaining engineering model in February 2026 and no longer sells Enterprise contracts to new customers, but card-paying customers keep the same service and prices. If you are moving anyway: Render is the closest like-for-like, Railway bills by usage, Fly.io is the cheapest in dollars, DigitalOcean is the simplest flat price, Coolify runs on your own servers, and Livops fits apps whose users are in Uzbekistan, at 39 credits a month (39,000 so'm) for an app.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- exec format error in Docker: the image was built for another CPUThe kernel refused to run the container's program because it is not an executable for this machine: almost always a binary or image built for arm64 (an Apple Silicon Mac) running on an amd64 server, or the reverse. Build for the server's platform with --platform linux/amd64, or as a multi-platform image; if the file is a script, give it a #! line.