Downloading Official Binary Distributions
A step-by-step guide for downloading and installing the official Go binary distribution on Linux, macOS, and Windows, including platform selection and verification
The Go team provides precompiled binary distributions for Linux, macOS, and Windows. These contain the Go compiler, standard library, tools, and documentation in a single package. For most users, downloading a binary is the fastest way to get a working Go installation without building from source.
Supported Platforms and Architectures
Official binaries exist for a range of operating systems and processor architectures. The table below lists the primary supported combinations. If your exact OS or architecture is not listed, you may still be able to build Go from source or use the gccgo frontend.
| Operating System | Architectures | Notes |
|---|---|---|
| Linux (kernel 2.6.23+, glibc) | amd64, 386, arm64, arm, ppc64le, s390x | CentOS/RHEL 5.x not supported. Alpine/musl-based systems should use the source build or a third‑party package. |
| macOS (10.10+) | amd64, arm64 | Apple Silicon Macs (M1/M2) use the darwin-arm64 tarball. |
| Windows (7, Server 2008R2+) | amd64, 386 | Both MSI installer and ZIP archive are provided. |
| FreeBSD (10.3+) | amd64, 386 | Debian GNU/kFreeBSD not supported. |
Go 1.21 and later also offer an arm64 Windows binary and a loong64 Linux binary on the experimental downloads page. Stick to a stable release for production work.
Choosing the Right Download
Visit the official Go downloads page in your browser. The page automatically highlights the recommended file for your current system, but you can scroll down to see all available versions.
Each distribution file name follows a consistent pattern:
go1.22.0.darwin-arm64.pkg
go1.22.0.linux-amd64.tar.gz
go1.22.0.windows-amd64.msi
The pattern is go<version>.<os>-<arch>.<ext>. Use the table above to match your OS and architecture. For example, if you are on a 64‑bit Linux desktop, choose the linux-amd64 tarball. If you are on an M1 MacBook, pick the darwin-arm64 package installer or tarball.
Checksums:
Each release includes a SHA256SUMS file. Verifying the checksum of your downloaded file is optional but protects against corrupted downloads or tampering. On macOS and Linux, run shasum -a 256 <file> and compare the output to the value published on the download page.
The rest of this guide walks through installation for each platform. The steps are mutually exclusive — follow the one that matches your machine.
Installing on Linux
Linux installation uses a tarball and manual PATH configuration. You will need sudo privileges to write into /usr/local.
Remove any previous Go installation
If you already have a version of Go in /usr/local/go, remove it first. The Go documentation explicitly warns that extracting a new archive over an existing Go tree can produce a broken installation.
sudo rm -rf /usr/local/go
Don't skip this on upgrades:
Even if you are upgrading to a newer patch release, delete the old directory. Leftover files from a previous version can cause subtle compilation failures that are difficult to diagnose.
Download the tarball
Use curl or wget to fetch the archive. Replace the version and architecture placeholders with the file you selected from the downloads page.
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
If wget is not available, curl -O works the same way:
curl -LO https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
Extract the archive into /usr/local
The tar command unpacks the distribution into /usr/local/go. The -C flag ensures extraction happens in /usr/local without contaminating your current directory.
sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
Never extract into an existing Go tree:
The official installer docs stress: "Do not untar the archive into an existing /usr/local/go tree. This is known to produce broken Go installations." Always remove the old directory first.
After extraction, /usr/local/go/bin contains the go binary and its companion tools (gofmt, go doc, etc.). The full Go tree lives in /usr/local/go and includes the compiler source, standard library, and C headers for cgo.
Add Go to your PATH
Your shell needs to know where the go binary is. Append the following line to your shell profile file. The exact file depends on your shell: ~/.profile, ~/.bashrc, or ~/.zshrc.
export PATH=$PATH:/usr/local/go/bin
For a system‑wide installation, put the same line into /etc/profile.
To apply the change immediately without logging out, source the profile:
source ~/.profile
Restart your terminal if something feels off:
Changes to profile files are read when a shell starts. If go version does not work after sourcing, open a fresh terminal. Some desktop environments only reload profiles on login.
Verify the installation
Run the version command to confirm Go is accessible and correct:
go version
You should see output like go version go1.22.0 linux/amd64. The exact version and platform string will match your download. If you see a "command not found" error, recheck the PATH step and ensure /usr/local/go/bin actually exists.
Installation complete:
If go version prints the expected version string, Go is installed and ready to use. You can now run go env to inspect your Go environment.
What Can Go Wrong After Installation
Even a successful go version doesn't guarantee your development environment is fully functional. A few problems surface only when you try to compile or download modules.
go buildfails with permission errors: On macOS and Linux, the Go cache (GOMODCACHEandGOCACHE) defaults to directories under~/goor~/.cache/go-build. These should always be writable by your user. If you installed Go usingsudo, the cache directories themselves will be user‑owned when created on first build. No extra permissions are needed.go installbinary not found: If you install a tool withgo installand get "command not found" when trying to run it, add$GOPATH/bin(or~/go/binby default) to your PATH. This is separate from the Go binary path.- TLS certificate errors on corporate networks: Some workplace proxies intercept HTTPS connections and replace certificates. If
go getor module downloads fail withx509: certificate signed by unknown authority, you may need to configure theGOPROXYor setGOINSECUREfor specific modules. This is an operational concern, not an installation defect, but it surfaces immediately after a fresh install on restricted networks.
The go env command is your diagnostic tool:
Running go env prints every environment variable Go sees, including computed defaults. If Go is installed but something feels wrong, go env GOPATH, go env GOROOT, and go env GOPROXY are faster than poking around manually.
Summary
Official binary distributions are the recommended installation path for nearly every Go developer. They give you a self‑contained, versioned copy of the Go toolchain without requiring a build environment. Platform‑specific installers handle PATH integration so that go version works immediately; manual tarball and ZIP options give you full control when needed.