How to Install Go Programming Language in Linux?
Last Updated :
24 Jul, 2025
In this article, we will discuss how to install GoLang (Go Programming Language) in Linux. But at first let's know a brief about GoLang.
GoLang is a procedural programming language. It was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launched in 2009 as an open-source programming language. Programs are assembled using packages, for efficient management of dependencies. This language also supports the environment adopting patterns alike to dynamic languages.
Download Go Latest Stable Version
Download GoLang using this link and choose the latest version of GoLang in an archive and install using the below command:
$ sudo wget https://dl.google.com/go/go1.16.5.linux-amd64.tar.gz
Download GoLang using the wget command
Verify the downloaded tarball version by verifying the SHA256 checksum of the downloaded file using the command below :
$ sha256sum go1.16.5.linux-amd64.tar.gz
Extract the 'go1.16.5.linux-amd64.tar.gz' Go tarball file to the '/usr/local' directory next.
$ sudo tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz
In the /usr/local directory, you'll find a directory called go. Change the owner and group of this directory to root recursively:
$ sudo chown -R root:root /usr/local/go

Configure System Environment for Go
To construct the directory structure for your Go workspace, run the following command:
$ mkdir -p $HOME/go/{bin,src}
By adding global variables to your /.profile, you can set your $GOPATH. To begin, open /.profile in nano or another text editor:
$ nano ~/.profile
Now Append the following lines then save and close:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin
To load the global variables, run the following command to update your shell:
$ . ~/.profile
Using the echo command and analyzing the result, you can check that your $PATH has been updated:
$ echo $PATH
Verify the installation by looking at the current Go version:
$ go version

Verify GoLang Installation
Write a simple Go Hello World program to see if your Go installation is operating properly. Create a new file called hello.go then save and close:
$ nano hello.go
Now compile and run the go program:
$ go run hello.go
Similar Reads
How to Install Go Language in Manjaro Linux? Manjaro is a free open-source Linux distribution based on the Arch Linux operating system. Its features include a highly customizable GUI with a powerful command-line user interface. Golang is a procedural and statically typed programming language similar to the C programming language. It provides a
1 min read
How to install Ruby Programming Language on Manjaro Linux? Ruby is an open-source, dynamic, cross-platform, object-oriented, general-purpose programming language. It was developed by Yukihiro Matsumoto in the mid-1990s in Japan. Everything in Ruby is an object except the blocks but there are replacements for those as well, i.e procs and lambda. The language
1 min read
How to install Ruby Programming Language on Godaddy Server? GoDaddy VPS is a shared server that provides computational services, databases, storage space, automated weekly backups, 99% uptime, and much more. Itâs a cheaper alternative to some other popular cloud-based services such as AWS, GPC, and Azure. Ruby is an open-source, dynamic, cross-platform, obje
2 min read
How to Install Golang plugin in Intellij? IntelliJ is one of the most powerful and popular integrated development environments (IDE) written in Java for developing computer software written in Java, Kotlin, Groovy, etc. on almost all sorts of languages. It is developed by JetBrains and is available in a community edition and in a proprietar
1 min read
How to Install GIT on Linux Git, the backbone of modern software development, is essential for version control in any professional environment. Many Linux distributions include Git by default, like Fedora, Arch Linux, openSUSE, Kali Linux, and Ubuntu Server. But sometimes organizations often require specific versions or config
4 min read
How to Install Kotlin on Linux? Kotlin is a programming language introduced by JetBrains in 2011, the official designer of the most intelligent Java IDE, named Intellij IDEA. This is a strongly statically typed general-purpose programming language that runs on JVM. In 2017, Kotlin is sponsored by Google, announced as one of the of
2 min read