Learning Center
Go

How to Install Go on Windows

25 Aug 2025
Hostman Team
Hostman Team

Go, or Golang, is a high-performance, multithreaded programming language developed by Google in 2007 and released in 2009. To this day, Golang continues to gain popularity. 

The Go programming language is a flexible option for development on a variety of platforms because it supports a wide range of operating systems. We will go over how to install Golang on Windows step-by-step in this tutorial.

installing go on windows

Installing GO on Windows is a simple process

Installing Go on Windows
Copy link

Go supports Windows 7 and newer versions. Ensure that you have a supported version of the OS installed.

In this guide, we will use Windows 11. You will also need an administrator account to configure environment variables.

To install Golang on Windows:

  1. Download the installer for the latest version of Microsoft Windows from the official Go website. If needed, you can select any other available version of the language instead of the latest one.
  2. Once the file has finished downloading, run it and follow the installation wizard's instructions. If necessary, you can change the file location. This will be useful when configuring environment variables.
  3. After the installation, check if Golang was successfully installed on your system. To do this, open the terminal (Win + R → cmd) and run the following command:
go version

The output should show the version of Go you just installed. For example:

Image2

GO version check

To update Golang to a newer version on Windows, you must uninstall the old version and follow the instructions to install the new one.

Now, let's move on to setting up environment variables so that Go works properly.

Setting Up Environment Variables
Copy link

In order for the operating system to identify the location of the required Go files and directories, setting up environment variables is a crucial step in the Go installation process on Windows.

For Go to work correctly, two environment variables are required:

  • GOPATH points to where Go stores downloaded and compiled packages.

  • PATH allows the system to find Go executable files without specifying their full paths.

GOPATH
Copy link

  1. First, let's set up the GOPATH environment variable. For this, you need to organize a workspace where Go files and projects will be stored.

In this guide, we will create a workspace at C:\GoProject. We will also add two directories to this folder:

    • bin – for storing executable files (binary files). Go creates an executable file and places it in this directory when you compile your project.

    • src – for storing Go source files. All .go files will be placed here.

  1. After creating the workspace, we will set the GOPATH environment variable. To do this, go to the Control Panel → System and Security → System and click on Advanced System Settings.

There is also an easier way to access system properties: open the Run window (Win + R) and enter:

sysdm.cpl
  1. Click on Environment Variables, then click the New button under the User Variables section. Here, you need to fill in two fields: the variable name and its value.
  2. In the Variable name field, enter GOPATH, and in the Variable value field, enter the path to the workspace you created earlier (in our case, C:\GoProject).
  3. Click OK twice to save the changes.
  4. To verify the creation of the system variable, open the Run window (Win + R) and enter the string:
%GOPATH%

If everything was done correctly, your workspace will open.

PATH
Copy link

  1. The PATH environment variable should have been automatically added after we installed Go. To check this, go to the Control Panel → System and Security → System and click on Advanced System Settings.
  2. In the window that opens, you need to find PATH among the system variables. To view its values, double-click on it.

In the new window, there should be an entry that holds the path to the Go bin folder.

Image1

Go installation path

In our case, it is C:\Program Files\Go\bin. If your value does not match what was specified during the Go installation, change it to the correct one using the Edit button.

Golang has now been installed on Windows, and environment variables have been set up. We can now write and execute our first program to test its functionality.

Verifying Installation
Copy link

To check the functionality of the newly installed Golang on Windows:

  1. Create a test file with the .go extension in the workspace (C:\GoProject\src). For example, ExampleProgram.go.
  2. Add the following simple code:
package main

import "fmt"

func main() {
    fmt.Println("Hello, Go has been successfully installed into your system!")
}

The program should display a message confirming that Go has been successfully installed on your system.

  1. To compile and run the program, enter the following command in the terminal:
go run %GOPATH%/src/ExampleProgram.go

As shown in the image below, the program compiles and runs, displaying the specified text on the screen.

Image3

Go Successfully Installed

Conclusion
Copy link

Installing Go on Windows is a straightforward process, involving downloading the installer, setting up environment variables, and verifying the installation. Once Go is properly configured, you can easily start developing applications. With support for multiple operating systems, Go remains a powerful and versatile language, ideal for cross-platform development.

On our app platform you can deploy Golang apps, such as Beego and Gin.