Galaxy
Web Apps

Go

Deploy a Go web app on Galaxy from a Go module and configure its entry point and runtime.

Galaxy builds a Go web app from its module and runs the compiled binary. If you're deploying Laravel Go, see the Laravel guide for the settings Galaxy fills in for you.

Prerequisites


1. Prepare Your App

  • Put go.mod in the directory Galaxy builds. If the module is in a subdirectory, select that directory as the build root.
  • Keep the web server's main package at the module root or in a single cmd/<name> directory. If both exist, Galaxy builds the root package. Multiple command candidates without a root entry point are ambiguous.
  • Listen on 0.0.0.0 and read the port from PORT. Galaxy defaults to port 3000.

2. Deploy

Choose your app type

In the Galaxy dashboard, click Create New > Deploy App, then select Go.

Configure and deploy

Follow the Git deployment steps. Add any environment variables your app needs before clicking Deploy.

Galaxy resolves dependencies, builds the selected package with go build, and runs it as /app/server. Open your app URL once the deploy completes.


3. Configure (Optional)

Go version: Galaxy reads the toolchain directive in go.mod first, then the go directive. It selects an image for that major and minor Go version, rather than pinning the exact patch from the directive. The default is Go 1.27.

Health check path: Set it to a route that returns a successful response if your app doesn't serve /.


4. Try It

For a first deploy, create a go.mod with go mod init example.com/hello and add main.go at the module root. Use net/http to serve a response at / and listen on the port in PORT.


Troubleshooting


What's Next?