Let’s install Go on your machine. The process is different for each operating system, so jump to the section that matches yours.
macOS
The easiest way is Homebrew, the standard package manager for macOS. If you don’t have Homebrew, install it first by pasting the command from their site into your terminal.
Once Homebrew is installed, run:
brew install go
If you’d rather not use Homebrew, download the installer (a .pkg file) from go.dev/dl and follow the prompts.
Linux
Most Linux distributions can install Go through their package manager — but those versions are often out of date. We recommend downloading the official archive:
# Download (replace VERSION with the latest from go.dev/dl)
wget https://go.dev/dl/go1.26.0.linux-amd64.tar.gz
# Remove any old install, then extract
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.26.0.linux-amd64.tar.gz
# Add Go to your PATH (add this to ~/.bashrc or ~/.zshrc)
export PATH=$PATH:/usr/local/go/bin
Open a new terminal so the PATH change takes effect.
Windows
The simplest path is the official installer:
- Download the
.msifile from go.dev/dl - Run the installer and accept the defaults
- Open a new Command Prompt or PowerShell window (existing terminals won’t see Go yet)
If you prefer a more Unix-like environment on Windows, install WSL2 (Windows Subsystem for Linux) and follow the Linux instructions inside it.
Verify the install
Open a terminal and run:
go version
You should see something like:
go version go1.26.0 darwin/arm64
The exact version and platform will differ based on your machine — what matters is that the command runs and prints a version. If you see “command not found”, your PATH isn’t set up correctly. Reopen your terminal, or revisit the installation step for your OS.
Set up your editor
You can write Go in any text editor, but a good editor saves you hours of debugging. We recommend Zed — it’s a fast, modern editor built in Rust, with first-class Go support out of the box.
Download Zed from zed.dev and install it like any other application.
The first time you open a .go file, Zed will detect Go and prompt you to install gopls — the official Go language server. Accept it. gopls powers autocomplete, jump-to-definition, inline errors, and formatting on save. No further configuration needed.
If you prefer a different editor, that’s perfectly fine. VS Code, GoLand, Neovim, Emacs, and Sublime Text all have excellent Go plugins. Use whichever editor you’re already comfortable in.
A quick note on workspaces
You don’t need a special “Go workspace” anymore. Older Go tutorials may tell you to put your code under ~/go/src/... — that advice is outdated. Modern Go (1.16 and newer) uses modules, which means your project can live anywhere on your disk.
For this course, create a folder somewhere convenient. On macOS or Linux:
mkdir -p ~/code/golang-fundamentals
cd ~/code/golang-fundamentals
On Windows (Command Prompt):
mkdir %USERPROFILE%\code\golang-fundamentals
cd %USERPROFILE%\code\golang-fundamentals
That folder is where we’ll write code in the next lesson.
What’s next
You have Go installed and an editor ready. Time for the rite of passage every programmer goes through: writing a “Hello, World!” program.