Deploy Go in minutes

Go compiles to a single static binary, which makes for tiny, fast containers. Add the multi-stage Dockerfile below, pick the Dockerfile preset, and Darmi Cloud builds and runs your Go service behind automatic HTTPS.

Deploy from GitHub Automatic HTTPS subdomain Live build & runtime logs
Step by step

How to deploy Go

Darmi Cloud doesn't have a dedicated Go preset yet — but the Dockerfile preset gets you deployed just as fast.

  1. 1

    Add a Dockerfile to your repo

    Commit the Dockerfile below to the root of your Go repository. Darmi Cloud will build the image from it.

  2. 2

    Sign in with GitHub

    Open darmicloud.tech and sign in with GitHub (or Google). On first sign-in you grant read access so the deploy worker can clone your repositories.

  3. 3

    Import your repository

    Click New Project, pick your Go repository, and choose the branch to deploy — the default branch is preselected.

  4. 4

    Select the Dockerfile preset

    Choose the Dockerfile preset so Darmi Cloud builds and runs the image from your committed Dockerfile. Set the container port to 8080.

  5. 5

    Add environment variables

    Add any environment variables your app needs (database URLs, API keys, secrets). Mark sensitive values as secrets — they are injected into the container and hidden in the UI afterwards.

  6. 6

    Deploy and watch it go live

    Click Deploy. Watch the live build and runtime logs, and your app goes live on an automatic HTTPS subdomain. Every push to your branch redeploys automatically.

Dockerfile for Go

Copy this into a file named Dockerfile at the root of your repository.

# syntax=docker/dockerfile:1
FROM golang:1.23 AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /server ./...

FROM gcr.io/distroless/static-debian12
COPY --from=build /server /server
ENV PORT=8080
EXPOSE 8080
CMD ["/server"]

Tips for Go on Darmi Cloud

  • Read the port from os.Getenv("PORT") and listen on 0.0.0.0 so the container is reachable.
  • The distroless final image keeps your container tiny and reduces the attack surface.
  • Adjust ./... to your main package path if your entrypoint lives in a subdirectory (for example ./cmd/server).
FAQ

Go deployment FAQ

Does Darmi Cloud have a native Go preset?

Not yet — but Go deploys cleanly with the Dockerfile preset using the multi-stage build above, producing a tiny static-binary container.

How small can my Go container be?

With a multi-stage build on a distroless base image, the final image is typically just a few megabytes plus your binary.

Can I use my own custom domain?

Yes. Connect an existing domain or buy one inside Darmi Cloud. DNS is configured automatically and every domain gets free SSL via Let's Encrypt.

Is there a free plan?

Yes. The Free plan deploys one project on an automatic HTTPS subdomain with auto-deploy on every push. Paid plans add custom domains, PR preview deployments and more projects.

Deploy other frameworks

Ready to deploy your Go app?

Connect GitHub and ship in minutes — on a free HTTPS subdomain, or on your own custom domain.

Deploy Go now