BIENVENUE10valid for the first month only! on all offersView plans
Skip to content
← Knowledge base

Deploy a Go application on onesubnet

Compile and run a Go binary: build, port via env, environment variables and logs.

Deploy a Go application on onesubnet

onesubnet compiles your Go binaries and runs them. Deploy via Git from the panel.

1. Prepare the project

  • A go.mod at the root (go mod init myapp).
  • Make your server listen on the port from the PORT variable:
port := os.Getenv("PORT")
if port == "" { port = "8080" }
http.ListenAndServe(":"+port, nil)

2. Deploy

  1. Connect your Git repository in the panel.
  2. Build command: go build -o app ./...
  3. Start command: ./app

3. Environment variables

Set PORT, DATABASE_URL, etc. in Settings → Environment.

4. Logs

Live console in the panel. For structured logs, use the log/slog package (Go 1.21+).

References

Related products

oneSubnet

French hosting provider in Paris. High-performance game and voice servers.

SERVICES

Resources

LEGAL

All systems operational