Install Go

Summary: in this tutorial, you will learn how to install Go on your computer.

Downloading Go

First, navigate to the Go official website

Second, click the download link to download the Go installer.

Installing Go

We’ll show you how to install Go on Windows, macOS, and Linux.

Installing Go on Windows

First, open the MSI file to launch the Go installer.

Second, follow the prompts to complete installing Go.

Third, open your Command Prompt and run the following command to verify that you installed Go successfully:

go version

Note that if you have opened the Command Prompt before, you need to restart it so that the changes are taking effect.

This command will display the installed version of Go like:

go version go1.23.0 windows/amd64

Note that you are likely to see a higher version.

Installing Go on macOS

First, open the downloaded package file (.pkg). It will launch the Go installer.

Second, follow the installer prompts to complete the installation. By default, the installer will install Go to the /usr/local/go

Note that the installer should add /usr/local/go/bin directory to your PATH environment variable.

Third, open your terminal and run the following command to verify that Go is installed correctly:

go version

Installing Go on Linux

First, open a terminal, navigate to the directory where you store the downloaded tarball file (tar.gz), and run the following command to extract the archive to /usr/local/go:

rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz

Please replace the go1.23.0.linux-amd64.tar.gz file with your downloaded one.

Second, add /usr/local/go to the PATH environment variable:

export PATH=$PATH:/usr/local/go/binCode language: JavaScript (javascript)

Third, verify the Go installation by running the following command from your terminal:

go version

It’ll show the installed version of Go.

Was this tutorial helpful?