Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Install Go on a Linux VPS with the distribution package when its release cadence is acceptable, or use the official Go archive when you need a pinned version or the same layout across different distributions. Whichever route you choose, make the compiler path persistent, keep user-installed binaries in a separate directory, and verify the version from a new shell before building a service.
Choose an installation method
There are three practical choices. Your decision should be based on version control, update ownership, and whether several applications need different toolchains.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →| Method | Best fit | Version control | Updates and removal | Important limitation |
|---|---|---|---|---|
| Ubuntu/Debian package | A VPS where tested distribution integration and routine security updates matter most | Uses the versions packaged by the distribution; a versioned package may be available | Managed with apt |
The packaged release can lag behind the upstream Go release |
| Snap package | Ubuntu systems already using Snap and needing an upstream release channel | Snap channels can select a release line | Managed with snap |
Requires Snapd and its service model |
| Official archive | A pinned release, a distribution-independent layout, or a reproducible deployment image | You select the exact archive and control when it changes | Replace /usr/local/go deliberately; rollback is a directory replacement |
You are responsible for upgrades and for selecting the correct architecture |
Most users should use a precompiled package rather than compile Go themselves. A source build is mainly useful for toolchain contributors, unusual targets, or a controlled build pipeline.
Prepare the VPS
Confirm the operating system
Log in through SSH with an account that can use sudo. Record the distribution and release before choosing a package command:
cat /etc/os-release
Ubuntu and Debian use apt. Other distributions have their own package names and repositories; use the archive method if you need one procedure that does not depend on those repositories.
Confirm the CPU architecture
Go archives are architecture-specific. Run:
uname -s
uname -m
The Go project publishes Linux archives for targets including amd64, 386, arm64, and ARM variants. Match the archive suffix to the value shown on the Go downloads page, rather than assuming that every ARM VPS uses the same filename. A 64-bit x86 VPS normally reports x86_64 and uses the amd64 archive; a 64-bit ARM VPS normally reports aarch64 and uses arm64.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Check basic tools and disk space
The archive procedure needs a downloader such as wget or curl, tar, and permission to write under /usr/local. Check them before starting:
command -v wget || command -v curl
tar --version | head -n 1
df -h /usr/local
Download over HTTPS and keep a record of the selected Go release in your deployment notes. Do not use an old filename copied from an unrelated tutorial; select the current archive that matches both the release and architecture you intend to deploy.
Install Go with Ubuntu’s package manager
Use this route when the Ubuntu-maintained version is sufficient and you want upgrades to follow the operating system’s normal process.
- Refresh package metadata:
sudo apt update - Install Go:
sudo apt install golang-go - Verify the command:
go version
The package manager places the compiler and standard tools where the distribution expects them and records the files for clean removal. The trade-off is release timing: the available version is determined by your Ubuntu release and enabled repositories, not by the newest upstream Go release.
Requesting a versioned Ubuntu package
Ubuntu documents versioned packages such as golang-1.21 and golang-1.23 when those packages are available for the release you are running. Check availability before installing:
apt-cache search '^golang-[0-9]'
apt-cache policy golang-go
Then install the exact versioned package exposed by your repositories, for example:
sudo apt install golang-1.23
Package names and available versions vary by Ubuntu release. Do not assume that a versioned name exists on every VPS.
Install Go with Snap
Ubuntu also documents Go as a classic Snap. This is useful when Snapd is already part of your server image and you prefer Snap’s channel-based release selection.
Free tools Windows power users keep installed
One-click scans. No signup required.
sudo snap install go --classic
go version
To select a particular release line, use a channel published for Go on your system:
sudo snap install go --classic --channel=<release>/stable
Because channel names and availability can change, inspect the channels offered by Snap before pinning one. Keep the selected channel in your infrastructure configuration so a rebuild does not silently choose a different line.
Install a pinned release from the official Go archive
The archive method gives you a predictable /usr/local/go tree and works independently of the VPS distribution’s package cadence.
1. Select the release and archive name
Choose a release from the Go downloads page, then set the release and architecture variables. The variable form prevents you from accidentally reusing a stale filename:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchGO_VERSION='go<version>'
ARCH='amd64'
ARCHIVE="${GO_VERSION}.linux-${ARCH}.tar.gz"
printf '%sn' "$ARCHIVE"
Replace the release and architecture values with the exact archive you selected. For an ARM64 VPS, use the archive whose suffix is linux-arm64; for a 32-bit x86 VPS, use linux-386. The archive must match the machine, not merely the operating system name.
2. Download the archive
With wget:
wget "https://go.dev/dl/${ARCHIVE}"
Or with curl:
curl -fLO "https://go.dev/dl/${ARCHIVE}"
The HTTPS download protects the transfer in transit. For a high-assurance build pipeline, also compare the downloaded file with the checksum published for that release before installing it.
3. Remove any previous Go tree
Do not extract a new archive over an existing /usr/local/go. The Go project warns that untarring into an existing tree can leave a broken mixture of files. Remove the old tree first:
sudo rm -rf /usr/local/go
Check the path carefully before pressing Enter. This command removes the entire directory and should not be used against a path that contains an application or custom files.
Rank #3
4. Extract into /usr/local
sudo tar -C /usr/local -xzf "$ARCHIVE"
A successful extraction creates /usr/local/go/bin/go and the rest of the distribution under /usr/local/go.
5. Add the compiler to PATH
Create a profile fragment so interactive login shells can find the distribution’s tools:
sudo sh -c 'cat > /etc/profile.d/go.sh <<"EOF"
export PATH="$PATH:/usr/local/go/bin"
EOF'
sudo chmod 644 /etc/profile.d/go.sh
If you do not administer the whole machine, put the same export in your own ~/.profile instead:
printf '%sn' 'export PATH="$PATH:/usr/local/go/bin"' >> ~/.profile
6. Reload the profile and verify
A profile edit affects future shells only. Reload it or open a new SSH session:
source ~/.profile
command -v go
go version
command -v go should resolve to the installation you intended, and go version should print the selected release together with the Linux platform. If you created /etc/profile.d/go.sh, a new login shell is the most reliable way to test it.
Keep Go-installed executables separate from the toolchain
The Go distribution’s own binaries live in /usr/local/go/bin. Programs installed with go install belong in the user’s Go binary directory, normally $HOME/go/bin. These are separate PATH concerns.
After Go is available, add the user binary directory to your profile:
printf '%sn' 'export PATH="$PATH:$(go env GOPATH)/bin"' >> ~/.profile
source ~/.profile
printf '%sn' "$PATH"
For a default user configuration, $(go env GOPATH)/bin expands to $HOME/go/bin. Keeping this directory separate prevents a tool installed for one user from being mistaken for part of the system toolchain. Reload the profile after changing it, then install a tool with its module-aware command, for example:
go install example.com/tool/cmd/tool@latest
command -v tool
Use a specific version instead of @latest in production build instructions when reproducibility matters.
Make Go available to services and deployment jobs
An interactive SSH login may read ~/.profile; a system service, cron job, container entrypoint, or non-login automation often does not. Do not assume that a profile change reaches a service account.
- Set
PATHexplicitly in the service manager or deployment environment. - Use an absolute compiler path such as
/usr/local/go/bin/goin scripts when selecting the system archive installation is operationally important. - For tools installed with
go install, use the explicit binary path under the service account’sGOPATHor set that account’s PATH. - Test the command under the same user and launch mechanism that will run the application.
For a systemd unit, an environment entry can make the choice explicit:
[Service]
Environment="PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
ExecStart=/srv/my-service
Adapt the unit to your application and reload systemd after changing it. The exact environment behavior depends on the init system and deployment setup, so validate it in the VPS environment rather than relying on an SSH session that happens to work.
Run more than one Go version
Multiple toolchains are useful when separate applications have different release requirements. Ubuntu documents installing versioned packages such as golang-1.21 and golang-1.23, then invoking each installation by its full path under /usr/lib/go-<version>/bin/.
/usr/lib/go-1.21/bin/go version
/usr/lib/go-1.23/bin/go version
Do not switch a production build merely by changing a user’s PATH. Put the intended full path in build scripts, CI configuration, or deployment units, and record which version each application requires. If you use archive installations for multiple releases, keep each extracted tree in a separately managed location rather than merging files into one directory.
Build Go from source only for a specific reason
The Go project says most users should install precompiled binary packages. Building from source is appropriate for contributing to the toolchain, targeting an unusual platform, or producing a controlled internal build.
Recommended Free Tools
A source build requires a bootstrap Go toolchain and the source tree’s documented build steps. A C compiler is optional when cgo support is not required, but it is needed for cgo-enabled builds. Source compilation also adds maintenance work: you must preserve the bootstrap relationship, record the source revision, and test the resulting toolchain before using it for production binaries.
For a normal Linux VPS application, an archive or distribution package is simpler, faster to replace, and easier to audit.
Verify the installation before deploying code
- Resolve the command:
command -v goshould point to the package or archive you selected. - Check the release and platform:
go versionshould print the expected Go version and Linux architecture. - Check the environment:
go env GOROOT GOPATHshows the toolchain root and workspace location used by that shell. - Check user tools: after installing a command,
command -vshould find it through the user’sGOPATH/binentry. - Check a non-interactive context: run the same commands as the service account or deployment job, not only as your SSH user.
If the output names an unexpected version, inspect PATH order and every Go installation on the machine before changing files.
Best Value
Troubleshoot common failures
go: command not found
- Run
command -v goand check whether/usr/local/go/binis present inprintf '%sn' "$PATH". - Reload the profile with
source ~/.profileor start a new SSH session. - Confirm that
/usr/local/go/bin/goexists if you used the archive method. - For a service, inspect its configured environment; an interactive profile is not proof that the service has the same PATH.
The wrong Go version runs
Use command -v go and inspect PATH from left to right. A package installation, Snap shim, and archive installation can coexist. Remove an obsolete installation or put the explicitly selected binary first only after confirming which application depends on it.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsThe archive extraction looks inconsistent
Delete the mixed tree with sudo rm -rf /usr/local/go, then extract a fresh archive into /usr/local. Do not try to repair a partially overwritten tree by copying individual files; the documented safe recovery is a clean extraction.
The archive does not run
Recheck uname -m and the archive suffix. An amd64 archive cannot run on an ARM VPS, and a 32-bit archive is not interchangeable with a 64-bit one. Also check that the download completed successfully and that the VPS has permission to execute files under /usr/local.
go install succeeds but the command is not found
The compiler path and the user binary path are different. Add $(go env GOPATH)/bin (normally $HOME/go/bin) to the same user’s profile, reload it, and verify with command -v.
Package installation has no suitable release
Check the Ubuntu release and enabled repositories. If the packaged version is too old or unavailable, use an official archive with the architecture-specific filename, or use a Snap channel that provides the required release line.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Upgrade, rollback, and uninstall safely
Archive installation
Download and test the replacement archive before switching production traffic. Keep the current archive and release name recorded, stop or drain services that use Go during the replacement, remove /usr/local/go, extract the new tree, and run go version. Roll back by restoring the previously verified tree if the new toolchain fails validation.
APT installation
Use sudo apt update followed by the normal package upgrade process. Remove it with:
sudo apt remove golang-go
Use the package name that you actually installed when removing a versioned package.
Snap installation
Switch channels or remove the Snap with the Snap commands appropriate to the selected channel:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemssudo snap remove go
Removing a package does not remove project source trees or binaries that you installed into a user’s GOPATH/bin; audit those separately before deleting them.
Production checklist
- Record the VPS distribution, release, CPU architecture, and selected Go release.
- Choose one ownership model: distribution package, Snap channel, or managed archive.
- For an archive, remove the old
/usr/local/gobefore extraction. - Persist
/usr/local/go/binfor the toolchain and$(go env GOPATH)/binfor user-installed commands. - Reload the profile and verify both
command -v goandgo version. - Set PATH or absolute binary paths explicitly for services and automation.
- Pin the compiler path when applications require different Go versions.
- Document the upgrade and rollback procedure before changing a production VPS.
For a conventional Ubuntu VPS, apt install golang-go is the least operational work. For a pinned or cross-distribution setup, the official archive provides the clearest boundary: one selected release under /usr/local/go, one explicit PATH entry, and a version check in every deployment environment.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

