Skip to content

Go on a VPS

Language for network services

Category
Dev / Tools
Author
Google
License
BSD-3-Clause
Version
1.27.1

The script is free · VPS from $2.79 per month · installs in about 45 seconds

Install over SSH

root@vps:~# V=$(curl -fsSL 'https://go.dev/VERSION?m=text' | head -n1) && curl -fsSLO https://go.dev/dl/$V.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf $V.linux-amd64.tar.gz && echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile

  • SystemUbuntu 24.04 · x86_64ok
  • Sourcegithub.com/golang/gook
  • Version1.27.1ok

✓ Go 1.27.1 installed · about 45 seconds

root@vps:~#

Install command from the library. Output is shortened and may differ on your server.

What it is

  • Go
  • Backend
  • Compiler

Go is a compiled language from Google for network services, APIs, bots and utilities. A program builds into a single dependency-free binary and uses little memory.

Docker, Xray, Gitea, Caddy and many VPN panels are written in Go, so you need it if you build them from source or write your own services.

The command downloads the latest version from go.dev and installs it into /usr/local/go, as the official documentation recommends.

  • Builds into a single static binary
  • Goroutines for thousands of connections
  • Modules and go get for dependencies
  • Built-in testing and formatting
  • Cross-compilation for other OSes

Recommended plan

For Go: at least 1 vCPU, 2 GB RAM and 10 GB NVMe.

Minimum to run
1 vCPU · 1 GB RAM · 10 GB disk
Systems
Ubuntu 22.04 · Ubuntu 24.04 · Debian 11 · Debian 12 · AlmaLinux 9

How to install

Three steps in the bot or one command over SSH; installation takes about 45 seconds.

  1. 01

    Choose a plan in the bot

    Open @ExpressHost_bot and pay for a VPS. The server will be ready in about 60 seconds.

  2. 02

    Add Go

    At the “Add-ons” step pick the script from the library, or run it later: Server settings → Scripts.

  3. 03

    Log in to SSH again or run source ~/.profile

    The bot will send the server address and login details to the chat.

Manually over SSH

Connect to the server as root and run the command. Supported systems: Ubuntu 22.04, Ubuntu 24.04, Debian 11, Debian 12, AlmaLinux 9.

Install command
V=$(curl -fsSL 'https://go.dev/VERSION?m=text' | head -n1) && curl -fsSLO https://go.dev/dl/$V.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf $V.linux-amd64.tar.gz && echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile

After installation

  1. 1.Log in to SSH again or run source ~/.profile
  2. 2.Check: go version
  3. 3.Create a module with go mod init example.com/app, build with go build

Go FAQ

Didn’t find an answer? Message @ExpressHost_SupportBot.

How do I update Go?

Repeat the install command: the old version in /usr/local/go will be replaced with the new one.

Why not `apt install golang`?

In the Ubuntu and Debian repositories Go is usually several versions behind. The archive from go.dev gives you the current version.

Where are downloaded modules stored?

In ~/go/pkg/mod; binaries from go install go to ~/go/bin.

Go installs at checkout — in the bot.