# Go HTTP servers Deploy a Go HTTP server from source. Smolcloud installs the Go toolchain, downloads public modules and compiles your app. ## Start from the Go template ```sh smolcloud init go ./my-app ``` This creates a small working app with a Dockerfile. You can use your own project instead. Either way, [create an app](builder-guide.md) first to get its ID. The Go starter uses `net/http`, serves `/api/health` and reads `PORT`, with a default of `3000`. Its Dockerfile compiles a static executable. If your app uses CGO, change the Dockerfile to include the C libraries it needs. For an existing app, bind the listener to `0.0.0.0` and make sure the health path answers without your app's own login. Include HTML templates and other runtime files in the build output, or embed them in the executable. ## Deploy source Include `go.mod` and `go.sum`. Public modules are downloaded from the Go module proxy. For a project with several executables, set its build and start commands in `railpack.json`. Create the app to get its ID, then deploy the source folder: ```sh smolcloud deploy APP_ID ./my-app ``` If the folder has a Dockerfile, Smolcloud uses it. The starter includes one; delete it if you'd rather Smolcloud work out the build itself. [Automatic builds](source-preparation.md) lists what a build can download and where to see the commands it chose. Set the port and health path in the app's **Configuration**. `deploy` waits until the app is live and prints its address. Open it and try a real page, not only the health path. If you need a private package registry, build an image in your own CI and [deploy that](image-publishing.md). ## Limits - The app runs as user `10001:10001`, not root, and can't write to its own filesystem. - Builds can't reach private package registries or other download sites. - Keep data in [PostgreSQL, a bucket or a disk](data-services.md); anything else is lost on the next deploy.