Golang deployment and Go app hosting
Deploy Golang from Git: automatic static binary builds for Gin, Echo, Fiber, chi and net/http. Go app hosting on our own servers in a data center, billing in rubles, automatic SSL.
Auto-deploy from Git
The platform pulls the code from your repository, builds the project and runs it.
Ready-made environment
No Nginx or Linux setup required. Reliable RelaxNet servers under the hood.
Custom domains and SSL
Connect your domain in one click, and the platform issues a Let's Encrypt SSL certificate automatically.
RelaxNet builds Go projects directly from your repository: the platform finds go.mod, compiles a static binary (CGO disabled) and runs it in a minimal container. The resulting image is tens of megabytes, starts in a fraction of a second and carries no runtime dependencies.
It works both for HTTP services on Gin, Echo, Fiber or the standard net/http and for background processes — workers and Telegram bots. The infrastructure runs on our own servers in a data center, services are reachable from anywhere, and billing is in rubles.
How to deploy Go
1. Connect your repository
Pick the repository with your Go project and a branch. Auto-detection finds go.mod and selects the Go builder. The entry point is looked up in ./cmd/... or in the module root.
2. Listen on the port from PORT
The app must listen on 0.0.0.0 and the port from the PORT environment variable (8080 by default). A hard-coded port is the most common cause of a 502 after deploy.
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
log.Fatal(http.ListenAndServe(":"+port, mux))3. Set environment variables
The database connection string, API keys and other secrets are added in the project settings and read via os.Getenv — there's no need to commit .env to the repository.
4. Deploy and connect a domain
After the build, the service is available at a technical HTTPS address. Add your own domain in the project settings: create an A record, and the platform issues and renews SSL itself. With auto-deploy on, every push rebuilds the project.
Platform comparison
| Platform | Status | Payment |
|---|---|---|
| Plain VPS | Works | systemd, nginx, SSL — all by hand |
| RelaxNet | Auto-deploy from Git | RUB, $6 free balance |
Go developers usually deploy a binary to a VPS by hand: scp, a systemd unit, nginx, certbot. RelaxNet covers the same workflow with deploys on git push — the platform handles the build, HTTPS and restarts on failure, and you pay in rubles.
Common errors and fixes
The service started but returns 502
The app is listening on the wrong address or port. Make sure the server binds to 0.0.0.0 and takes the port from the PORT variable — localhost inside the container isn't reachable from outside.
The build can't find the entry point
The builder looks for the main package in ./cmd/... and then in the module root. If your layout is non-standard (several services in one repository), set the root folder in the project settings or add your own Dockerfile.
Errors building packages that use CGO
The build runs with CGO_ENABLED=0 to produce a static binary. Dependencies that need cgo (for example, some SQLite drivers) require your own Dockerfile — or replace them with pure Go alternatives such as modernc.org/sqlite.
The app crashes right after startup
Check the runtime logs in the dashboard: most often it's a missing environment variable or an unreachable database. Inside a container, localhost points to the container itself — use the database address provided by the platform.
FAQ
Which Go version is used for builds?
The current stable toolchain. If your project needs a specific version, pin it in go.mod (the go directive) or bring your own Dockerfile.
Do I need a Dockerfile for a Go project?
No, go.mod is enough for a typical service — the platform builds the binary itself. A Dockerfile is needed for CGO dependencies, system libraries or a non-standard repository layout.
Can I host a Go Telegram bot?
Yes: bots on telebot or tgbotapi are detected automatically and run as a long-lived 24/7 process that restarts automatically on failure.
How do I connect PostgreSQL?
Create a database on the platform and pass the connection string via an environment variable (for example, DATABASE_URL), or point to an external host. Don't use localhost inside the container.
Are WebSocket and gRPC supported?
WebSocket is proxied on the same port with no extra configuration. For gRPC services, we recommend gRPC-Web or your own Dockerfile with a reverse proxy.