NetrunHome

How to put a Go app online

· 3 min read

Normally, to show a Go app to the world you have to rent a server, build the binary on it, put nginx next to it as a proxy, get an SSL certificate, and make sure the process does not crash. Go is convenient because the whole project compiles into a single executable file, but the fuss around the server does not go away because of that.

Netrun removes that part: you upload your source code, we see for ourselves that it is Go, build the project, and give you a public link with HTTPS (a secure connection, the padlock in the browser). No server, no nginx, no manual certificate — below is how to get from a folder of code to a working link.

  1. Check that there is a go.mod in the root

    The go.mod file in the project root lists dependencies and tells Netrun that this is a Go app. You do not need to include the dependencies folder (for example, vendor) — we will pull the libraries in ourselves from go.mod during the build.

  2. Read the port from the environment variable

    If you have a web service, it should listen on the port that Netrun sets through the PORT environment variable, not one hard-coded in the code. In practice this means taking the port via os.Getenv("PORT") and listening on exactly that — then we automatically expose the right address to the outside. A hard-coded port would break publishing.

  3. Upload your code

    Open Netrun and bring your project in one of two ways: as a ZIP archive with the sources, or by importing from a GitHub repository, including a private one. The code with go.mod is enough — you do not need to build the binary yourself or install Go anywhere, it all happens on our side.

  4. Add secrets if you have any

    If your app talks to an external service or a database, we will ask for API keys, tokens, and the connection string during setup. They will be placed into environment variables and will not sit in the code — read them from the environment with os.Getenv, the same way as the port.

  5. Wait for the build and grab the link

    Netrun builds the project and brings it up on its own. Logs and publishing status are visible in your dashboard in real time, so you will notice right away if something goes wrong. When everything is ready, you get a public link with HTTPS — you can open it and send it to anyone.

That is it: your Go app is available on the internet without renting a server or setting up SSL. On the Free plan you get one project, and a web service on it sleeps when idle and wakes on request — the first response after a pause will be a little slower. If your app needs to respond without delays around the clock, a paid plan with no idle downtime is a good fit, and if you need more projects, you can buy extra slots. Try Netrun.