How to install Go?

Created Jan 17, 2024Last modified Jan 17, 2024
GoWindowsLinuxmacOS

Go Basics


offical Go downloads page

macOS

  1. Open a terminal.
  2. You can use Homebrew to install Go. If you don't have Homebrew installed, you can install it from brew.sh.
  3. Run the following command to install Go:
brew install go
  1. Verify the installation by checking the Go version:
go version

Linux

  1. Open a terminal.
  2. You can use the package manager for your distribution to install Go.

For example, on Debian-based systems (like Ubuntu), you can use:

sudo apt-get update
sudo apt-get install golang

On Red Hat-based systems (like Fedora), you can use:

sudo yum install golang
  1. Verify the installation:
go version

Windows

  1. Download the Go installer for Windows from the official Go Downloads page.
  2. Run the installer executable (.msi file) and follow the installation prompts.
  3. After the installation is complete, open a Command Prompt or PowerShell and verify the installation:
go version