Docs menu
Getting started with Go
Deploy a minimal Go web app to Primcloud end-to-end using a sample repo, in about five minutes.
On this page
This guide walks through deploying a small Go web app to Primcloud. You'll fork a sample repo, import it, watch the build, and reach the deployed app at a *.primcloud.app URL. Takes about five minutes.
Before you start#
You'll need:
- A Primcloud account. Standard accounts are free to create; compute is metered by the minute once you deploy, from around $5/mo for the smallest app.
- A git provider connected to your account with access to at least one repo.
- Optional: Go 1.23 or newer installed locally, if you want to run the sample or make changes before deploying.
The sample app#
For this guide, use Heroku's heroku/go-getting-started repo. It's a minimal Gin-based web app that builds cleanly on the Primcloud Runtime with no changes. Fork it into an account your connected provider can see, so Primcloud can pull from it.
1. Create the application#
From the Primcloud dashboard, hit Import Git Repository on the applications list. The import wizard walks you through three quick steps:
- Pick a repository: select your fork of
go-getting-started. - Configure the deployment:
- Branch:
main(the fork's default). - Region: US East (NYC).
- Branch:
- Review and create: Primcloud auto-provisions the app's primary
*.primcloud.appsubdomain on the production environment.
2. Deploy#
The first deployment kicks off automatically when the app is created. Watch it stream in the Deployments tab:
- Detection. Primcloud sees the
go.modat the repo root and picks the Go toolchain. - Build. The Go SDK is installed at the version requested by
go.mod. The build downloads the modules the app depends on and runsgo install -tags herokuagainst everymainpackage it finds. For the sample, that's a single binary namedgo-getting-started. - Release. Primcloud reads the sample's
Procfile, which declaresweb: go-getting-started, and starts that process on the pod formation.
When the deployment status flips to Release Succeeded, the app is live.
3. Reach the app#
The application dashboard shows the assigned *.primcloud.app URL in the header. Click it, and the sample app's homepage loads.
If it doesn't come up:
- Deployments: the build log has the raw output from
go install. - Logs: runtime output from your app streams there, including any startup errors.
- Confirm the app binds to the port in
$PORT. Primcloud sets this to the constant5000on thewebformation; the sample reads it viaos.Getenv("PORT")before callingrouter.Run.
Where to go next#
- Deploying a different Go app: Go on Primcloud for detection, package selection, and process type inference.
- Pinning to a specific Go version: Runtime versions.
- Using a private module: Package managers.
- Building only certain binaries or vendoring dependencies: Customizing the build.
- Something breaking: Troubleshooting Go.