How to Install Go

Install Go on Windows, macOS or Linux from a prebuilt binary, from source, or side by side with other versions, and pick the method that fits you

Before you can write, compile, or run any Go program, the Go toolchain must live on your machine. The toolchain is the go command plus the compiler, the linker, the standard library, and small tools like gofmt and go vet. How you install it depends on your operating system, how much control you need, and whether you plan to use more than one Go version.

This page outlines the three installation paths. Each one has its own page with the full steps.

Precompiled Binary Distributions

If you have never installed Go before, start here.

The Go team builds and tests official binaries for Linux, macOS, and Windows. You download a .tar.gz file or a .msi installer from the official downloads page, unpack it, and add the go binary to your system PATH. It is the fastest and most reliable path, and it is the one nearly every Go developer uses.

Installing from Source

Building Go from source means compiling the compiler itself from the Go source repository. You need a C compiler and an existing Go toolchain to bootstrap the build.

This path fits contributors to the Go project itself, people on platforms with no prebuilt binary, and anyone who needs to test an unreleased development branch. If you are just learning the language, the binary distribution saves you time and frustration.

Managing Multiple Go Versions

A single machine rarely needs more than one Go version, until it does.

Maybe a legacy project refuses to compile with a newer compiler. Maybe you want to preview a release candidate without touching your daily installation. Maybe you maintain a library and must test it against the previous supported release. In all these cases, you need a way to install several toolchains and point your terminal at the right one.

Verifying the Installation

Regardless of the method you chose, one command tells you whether everything worked.

go version

If the output shows the expected version string, something like go version go1.27.4 linux/amd64, then the go binary is on your PATH and talking to the rest of the toolchain correctly.

Installation complete:

When go version prints a valid version without errors, the installation is finished. You can now compile, test, and run Go programs.

If you see "command not found", the PATH was not updated properly. Revisit the platform-specific instructions and make sure the directory containing the go binary was added to your shell configuration file (.bashrc, .profile, .zshrc, or the system-wide equivalent). After editing the file, open a new terminal or run source on it.

Summary

Three ways lead to a working Go toolchain, and they differ in effort, not in result. The binary distribution is the default choice for nearly everyone. A source build is a deliberate step for contributors and unusual platforms. Side-by-side versions are a tool for maintainers and testers, not something a first install needs. Pick the path that matches your situation, verify it with go version, and move on to writing Go.

Download and Install Go on Windows, Mac & Linux

Download the official Go binary for Windows, macOS or Linux, install it, and verify it works with no building from source needed

Installing Go from Source

Build the Go toolchain from source code step by step covering prerequisites bootstrap toolchain compilation and verification

Managing Multiple Go Versions

How to install, use, and switch between multiple Go versions on the same machine for library testing, build reproducibility, and working with legacy projects