Go installation steps
Go (Golang) – Installation Steps
Below are simple, step-by-step Go installation instructions for all major operating systems.
1️⃣ Install Go on Windows
Step 1: Download Go
-
Visit 👉 https://go.dev/dl/
-
Download the Windows (.msi) installer (64-bit)
Step 2: Run Installer
-
Double-click the downloaded
.msifile -
Click Next → Install
-
Default path:
Step 3: Verify Installation
Open Command Prompt and run:
✅ Output example:
2️⃣ Install Go on Linux (Ubuntu/Debian)
Step 1: Download Go
Step 2: Extract Files
Step 3: Set Environment Variables
Add this to ~/.bashrc or ~/.profile:
Apply changes:
Step 4: Verify
3️⃣ Install Go on macOS
Method 1: Using Installer (Easy)
-
Download
.pkgfrom 👉 https://go.dev/dl/ -
Run installer
-
Follow on-screen instructions
Verify:
Method 2: Using Homebrew
Verify:
4️⃣ Set Up Go Workspace (Recommended)
Step 1: Create Project Folder
Step 2: Initialize Module
5️⃣ Run Your First Go Program
Create main.go:
Run:
Build executable:
6️⃣ Important Go Commands
| Command | Description |
|---|---|
go version |
Check Go version |
go run |
Run program |
go build |
Compile program |
go mod init |
Initialize module |
go get |
Download packages |
