---
date: 2026-07-17
---

<!-- markdownlint-disable MD001 -->

# Install Go

## What is Go?

Go (also called **Golang**) is a programming language created by Google in 2009. It's designed to be simple, fast, and reliable. If you're just starting to code — or coming from another language — Go is a great choice because:

- **Simple syntax** — easy to read and write
- **Fast compilation** — your code turns into a program in seconds
- **Built-in tools** — formatting, testing, and dependency management come out of the box
- **Great community** — lots of learning resources and helpful people

## Before You Start

You'll need:

- A computer (Windows, macOS, or Linux)
- An internet connection
- About 10–15 minutes

That's it. No prior programming experience required.

## Downloading Go

Go to the official download page:

**<https://go.dev/dl/>**

You'll see a list of downloads for different operating systems. Pick the one for your computer.

> **Tip:** Look for the latest stable version. At the time of writing, that's Go 1.22+. The version number doesn't matter much for learning — just get the newest one.

---

## Installing on Windows

### Step 1: Run the Installer

1. Download the **`.msi`** file (e.g. `go1.22.5.windows-amd64.msi`)
2. Double-click the downloaded file to run the installer
3. Follow the prompts — the default settings are fine
4. The installer will automatically add Go to your system's `PATH`

### Step 2: Verify the Installation

1. Open **Command Prompt** (press `Win + R`, type `cmd`, press Enter)
2. Type the following and press Enter:

```bash
go version
```

You should see something like:

```text
go version go1.22.5 windows/amd64
```

### Step 3: Test with "Hello, World!"

Create a new folder for your Go projects:

```bash
mkdir C:\Users\YourName\go-projects
cd C:\Users\YourName\go-projects
```

Create a file called `hello.go` and open it in a text editor:

```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

Run it:

```bash
go run hello.go
```

You should see:

```text
Hello, World!
```

---

## Installing on macOS

### 1: Download the Package

1. Download the **`.pkg`** file (e.g. `go1.22.5.darwin-amd64.pkg` for Intel Macs, or `go1.22.5.darwin-arm64.pkg` for Apple Silicon M1/M2/M3)
2. Double-click the downloaded file and follow the installer prompts

> **Not sure which Mac you have?** Click the Apple menu → About This Mac. If it says "Apple M1", "Apple M2", or "Apple M3", download the `arm64` version. Otherwise, get the `amd64` version.

### 2: Verify the Installation

Open **Terminal** (found in Applications → Utilities) and type:

```bash
go version
```

Expected output:

```text
go version go1.22.5 darwin/amd64
(or `darwin/arm64` on Apple Silicon)
```

### Alternative: Install with Homebrew

If you use [Homebrew](https://brew.sh/), installation is even simpler:

```bash
brew install go
```

### 3: Test with "Hello, World!"

```bash
mkdir ~/go-projects
cd ~/go-projects
```

Create `hello.go`:

```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

Run it:

```bash
go run hello.go
```

Output:

```text
Hello, World!
```

---

## Installing on Linux

### Option 1: Download the Tarball (Recommended)

1. Download the **`.tar.gz`** file (e.g. `go1.22.5.linux-amd64.tar.gz`)
2. Open a terminal and run:

```bash
# Remove any previous Go installation
sudo rm -rf /usr/local/go

# Extract the tarball to /usr/local
sudo tar -C /usr/local -xzf ~/Downloads/go1.22.5.linux-amd64.tar.gz
```

> **Replace the filename** with the version you downloaded. If you're on an ARM system (like a Raspberry Pi), use `linux-arm64` instead of `linux-amd64`.

3. Add Go to your `PATH` by adding this line to `~/.bashrc` (or `~/.zshrc` if you use zsh):

```bash
export PATH=$PATH:/usr/local/go/bin
```

Then reload your shell:

```bash
source ~/.bashrc
```

### Option 2: Install via Package Manager

Depending on your distro:

```bash
# Ubuntu / Debian
sudo apt update
sudo apt install golang-go

# Fedora
sudo dnf install golang

# Arch Linux
sudo pacman -S go
```

> **Note:** Package managers sometimes have an older version of Go. The tarball method above gives you the latest.

### Step 3: Verify and Test

```bash
go version
```

```bash
mkdir ~/go-projects
cd ~/go-projects
```

Create `hello.go`:

```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

Run it:

```bash
go run hello.go
```

---

## Setting Up VS Code for Go

Now that Go is installed, let's set up your editor.

### Step 1: Install the Go Extension

1. Open VS Code
2. Click the Extensions icon in the sidebar (or press `Ctrl+Shift+X`)
3. Search for **"Go"** by the Go team at Google
4. Click **Install**

### Step 2: Install Go Tools

When you open your first `.go` file in VS Code, a notification will pop up in the bottom-right corner asking if you want to install the Go tools. Click **"Install All"**.

This includes useful tools like:

- `gopls` — the Go language server (autocomplete, navigation, errors)
- `go fmt` — automatic code formatting
- `dlv` — the debugger

### Step 3: Write Your First Real Program

Create a new folder and a file called `main.go`:

```go
package main

import (
    "fmt"
    "time"
)

func main() {
    name := "Go Learner"
    fmt.Printf("Hello, %s! 🎉\n", name)
    fmt.Println("The time is:", time.Now().Format("3:04 PM"))
}
```

Run it:

```bash
go run main.go
```

---

## Common Issues & Troubleshooting

### "go is not recognized" (Windows)

This means Go wasn't added to your `PATH`. Try:

1. Open **System Properties** → **Environment Variables**
2. Under **System variables**, find `Path` and click **Edit**
3. Add: `C:\Program Files\Go\bin`
4. Click OK and restart your terminal

### "command not found: go" (macOS/Linux)

Make sure Go's binary directory is in your `PATH`:

```bash
export PATH=$PATH:/usr/local/go/bin
```

Add that line to `~/.bashrc` or `~/.zshrc` to make it permanent.

### Which file did I download?

Not sure you picked the right one? Here's a cheat sheet:

| OS      | Architecture             | File to Download              |
| ------- | ------------------------ | ----------------------------- |
| Windows | 64-bit Intel/AMD         | `go1.xx.x.windows-amd64.msi`  |
| macOS   | Intel                    | `go1.xx.x.darwin-amd64.pkg`   |
| macOS   | Apple Silicon (M1/M2/M3) | `go1.xx.x.darwin-arm64.pkg`   |
| Linux   | 64-bit Intel/AMD         | `go1.xx.x.linux-amd64.tar.gz` |
| Linux   | ARM (Raspberry Pi)       | `go1.xx.x.linux-arm64.tar.gz` |

---

## You're Ready to Go! 🚀

You've successfully installed Go and written your first program. Here's what to do next:

1. **Follow the official tour**: [https://go.dev/tour/](https://go.dev/tour/>) — an interactive introduction
2. **Read "How to Write Go Code"**: [https://go.dev/doc/code](https://go.dev/doc/code)
3. **Practice on** [https://exercism.org/tracks/go](https://exercism.org/tracks/go) — free coding exercises

Check back for more beginner-friendly Go posts coming soon!
