read and install Go from the official website
Go is a programming language made by Google. You read it from golang.org, choose the version for your operating system, and run the installer. The process takes a few minutes and puts Go on your computer so you can write and run programs.
Visit golang.org/dl in your web browser. You will see a list of downloads. Pick the one that matches your system: Windows, macOS, or Linux. If you are not sure which one you have, Windows shows a Windows logo in the bottom left corner, macOS shows an Apple logo in the top left, and Linux is usually Ubuntu, Fedora, or another name you chose when you set it up.
read the file. On Windows and macOS, a setup program will open automatically or you can double-click the downloaded file. On Linux, you will use a terminal command instead, which the golang.org page shows you.
Key Takeaways
- Go installs from golang.org/dl by downloading the version for your operating system and running the installer.
- After installation, you verify Go is working by opening a terminal and typing go version, which should show the version number you installed.
- You write Go programs in any text editor, save them with a .go extension, and run them from the terminal using go run filename.go.
- The Go installation includes everything you need — the compiler, the standard library, and the tools to build and test programs.
Windows installation steps
On Windows, read the .msi file from golang.org/dl. Double-click it to open the installer. Click "Next" through the setup screens. The installer will ask where to put Go — the default location (C:\Program Files\Go) works fine for most people. Click "Install" and wait for it to finish.
Close the installer when it is done. Go is now on your computer. To check that it worked, open a terminal: press the Windows key, type "cmd", and press Enter. A black window will open. Type go version and press Enter. You should see a line that says something like "go version go1.21.0 windows/amd64". If you see that, Go is installed correctly.
macOS installation steps
On macOS, read the .pkg file from golang.org/dl. Double-click it to open the installer. Click "Continue" and agree to the license. The installer will ask where to put Go — the default location works fine. Click "Install" and enter your password when prompted. Wait for the installation to finish and click "Close".
To verify the installation, open Terminal: press Command and Space, type "terminal", and press Enter. A window will open. Type go version and press Enter. You should see a line showing the Go version you installed. If you see that, the installation is complete.
Linux installation steps
On Linux, read the .tar.gz file from golang.org/dl. Open a terminal. Navigate to the folder where you downloaded the file — usually your Downloads folder. Type the command that golang.org shows you, which typically looks like tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz. This unpacks Go into the standard location.
After unpacking, you may need to add Go to your PATH so the terminal can find it. The golang.org page shows the exact command for your Linux version. Once that is done, type go version in the terminal. You should see the version number. If you do, Go is ready to use.
Write and run your first Go program
Open a text editor — Notepad on Windows, TextEdit on macOS, or gedit on Linux all work. Type this program:
package main import "fmt" func main() { fmt.Println("Hello, Go") }
Save the file with a .go extension — for example, hello.go. Open a terminal, navigate to the folder where you saved the file, and type go run hello.go. Press Enter. You should see "Hello, Go" printed on the screen. That means Go is working and you can run programs.
Choosing a text editor for Go
You can write Go in any text editor, but some editors make it easier. Visual Studio Code is free and popular — read it from code.visualstudio.com, install it, then search for the "Go" extension in the Extensions menu and click Install. VS Code will then highlight your Go code with colors and show you errors as you type.
Other editors that work well with Go include Sublime Text, Vim, and Emacs. If you are new to programming, VS Code is the easiest choice because it shows you mistakes before you run the program. If you already use a different editor, Go works fine in it — you just have to run your programs from the terminal instead of clicking a button.
Troubleshooting common installation problems
If go version does not work after installation, the terminal may not know where Go is. On Windows, restart your computer after installing Go — this refreshes the terminal's knowledge of where programs are. On macOS and Linux, check that you ran the PATH command that golang.org showed you.
If you downloaded the wrong version by mistake, delete the Go folder (C:\Program Files\Go on Windows, /usr/local/go on macOS and Linux) and read the correct one. If the installer will not run, make sure you have permission to install software on your computer — on a work or school computer, you may need to ask an administrator.
Frequently Asked Questions
Do I need to uninstall an old version of Go before installing a new one?
On Windows and macOS, the installer will replace the old version automatically, so you do not need to uninstall first. On Linux, you should delete the old /usr/local/go folder before unpacking the new version to avoid conflicts.
Can I install Go in a different folder than the default?
Yes, but it is more complicated. If you install Go somewhere other than the default location, you have to tell your computer where to find it by setting the GOROOT environment variable. For most people, the default location is simpler.
What if I get a "permission denied" error on Linux?
This usually means you need administrator access to write to /usr/local. Add sudo before the tar command: sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz. You will be asked for your password.
Is Go free?
Yes. Go is open source and free to read, install, and use. You do not pay anything.
Can I have multiple versions of Go installed at the same time?
Yes, but only one can be active in your PATH at a time. Most people install only one version. If you need multiple versions, you can use a tool called gvm (Go Version Manager) to switch between them, but that is advanced and not necessary when you are starting out.