Go installation steps

Go Tutorial

Go (Golang) Installation Steps

Below are simple, instructions of Go installation steps for all major operating systems.


 Install Go on Windows

Step 1: Download Go

Step 2: Run Installer

  • Double-click the downloaded .msi file

  • Click Next → Install

  • Default path:

    C:\Program Files\Go\

Step 3: Verify Installation

Open Command Prompt and run:

go version

 Output example:

go version go1.22.5 windows/amd64

 Install Go on Linux (Ubuntu/Debian)

Step 1: Download Go

wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz

Step 2: Extract Files

sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz

Step 3: Set Environment Variables

Add this to ~/.bashrc or ~/.profile:

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

Apply changes:

source ~/.bashrc

Step 4: Verify

go version

 Install Go on macOS

Method 1: Using Installer (Easy)

  1. Download .pkg from   https://go.dev/dl/

  2. Run installer

  3. Follow on-screen instructions

Verify:

go version

Method 2: Using Homebrew

brew install go

Verify:

go version

Set Up Go Workspace (Recommended)

Step 1: Create Project Folder

mkdir go-projects
cd go-projects

Step 2: Initialize Module

go mod init myapp

 Run Your First Go Program

Create main.go:


 

Run:

go run main.go

Build executable:

go build

 Important Go Commands

CommandDescription
go versionCheck Go version
go runRun program
go buildCompile program
go mod initInitialize module
go getDownload packages

You may also like...