Introducing Livops 2.0! Promo codeCEOgives you 8,000 so‘m on your balance.What’s new

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

  1. 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.
  2. 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.
  3. 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 build into .livops/bin/app, with CGO off, so the binary is static. If go-sqlite3 is in go.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/api or cmd/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 — on healthPath with 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 what Shutdown above 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 (the DATA_DIR variable) survive deploys; /tmp does 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

  1. Go — Release history (go.dev). Checked .
  2. Go — cmd/cgo (pkg.go.dev). Checked .
  3. Go — net/http (pkg.go.dev). Checked .
  4. Go — os/signal (pkg.go.dev). Checked .
  5. Docker — Multi-stage builds (docs.docker.com). Checked .
  6. SmartCloud — VDS plans (smartcloud.uz). Checked .
  7. Render — Pricing (render.com). Checked .
  8. Render — Deploy for free (render.com). Checked .
  9. Railway — Pricing (railway.com). Checked .
  10. Fly.io — Pricing (docs.fly.io). Checked .
  11. 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 app

Got a question? — @livops_uz