How to Install Go (Golang) on Windows, macOS, and Linux: A Beginner’s Guide

Go (or Golang) is a powerful open-source programming language developed by Google. Known for its simplicity, speed, and excellent support for concurrency, Go is becoming increasingly popular with developers building web servers, microservices, CLI tools, and more.
In this beginner's guide, you'll learn how to install and configure Go on Windows, macOS, and Linux, and verify your settings with a simple test program.
Prerequisites
Before you begin, make sure you have:
A computer running Windows, macOS, or Linux
A stable internet connection
Basic knowledge of using a terminal or command prompt
Step 1: Download the Go Installer
To begin your Go programming journey, the first step is to visit the official Go website at https://go.dev/dl.
Simply download the appropriate installer: a .msi
file if you are using Windows, a .pkg
file for macOS users, or a .tar.gz
archive if you are on a Linux system.
Step 2: Install Go on Windows 11
Installing Go on Windows is simple and straightforward using the official .msi installer. Follow these steps to get up and running:
Locate the downloaded .msi file (typically in your Downloads folder) and double-click it to start the installation.
The Go Setup Wizard will open. Click Next to continue.
By default, Go will install to
C:\Program Files\Go
. Unless you have a specific reason to change it, it's recommended to keep this default location.During installation, the setup will automatically add the directory
C:\Program Files\Go\bin
to your system’s PATH.After installing Go, you should confirm that everything is working properly. Open command prompt
cmd.exe
and rungo version
.If the installation was successful, you should see something like:
Step 3: Installing Go on macOS
Navigate to your Downloads folder (or wherever you saved the .pkg file). Depending on your processor architecture, the file is usually named go1.x.x.darwin-amd64.pkg or go1.x.x.darwin-arm64.pkg. If you’re using latest MacOS, it’s usually run on arm64 architecture.
Double-click the .pkg file: this will launch the standard macOS installation wizard.
The installer will ask for destination. Leave it to default or customize as you want.
Open Terminal App and enter the command to check go version.
go version
Install Go on Linux
To install Go on Linux, you need to download the Go binary archive, extract it to the appropriate directory, and set the environment variables for your system. This method works with most distributions, including Ubuntu, Debian, Fedora, Arch, and CentOS.
Press
Ctrl + Alt + T
to open your terminal. Make sure you have sudo (superuser) privileges.Download the latest .tar.gz archive for Linux (amd64 or arm64).
Now extract the downloaded archive to
/usr/local
, which is the standard location for Go:sudo tar -C /usr/local -xzf go1.24.4.linux-amd64.tar.gz
-C /usr/local
tells the system to extract into/usr/local
-xzf
stands for extract, gzip, file
After extraction, Go binaries will be located at:
/usr/local/go/bin
Add Go to your path. Simply open your .bashrc or .zshrc and edit path variable to include
/usr/local/go/bin
.export PATH=$PATH:/usr/local/go/bin
Conclusion
Whether you're using Windows, macOS, or Linux, Go (Golang) will run on your system! Installing Go is your first step into the fast, efficient, and fun world of programming, and it's one of the hottest languages out there. Now that your development environment is ready, you're ready to experience the simplicity and power of Go, whether you're building web applications, microservices, or diving into systems programming.
Remember, every expert was once a beginner. So keep tinkering, keep learning, and most importantly, keep coding. Happy coding!
Subscribe to my newsletter
Read articles from Bhuwan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
