How to Install Go on Ubuntu 20.04
1 min read

How to Install Go on Ubuntu 20.04

Go, often referred to as golang is a modern open-source programming language created by Google that allows users to build reliable and efficient applications. In this tutorial we will show you how you can install Go on your 20.04 Ubuntu server.

Download the tarball

At the time of writing this tutorial, the latest stable version of Go is version 1.16.4. I'd recommend that before downloading the tarball, visit the official Go downloads page and see if there is a new version available for use.

wget -c https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local

The above command should be ran with a user that has sudo privileges. This command with download and then extract the tarball to /usr/local.

Adjusting the PATH variable

By adding the location of the Go directory to the $PATH environment variable, the system will know where to find the Go executable binaries.

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

Next, save the file and load the new PATH environment variable into the current session.

source ~/.profile

Verify the installation was successful

To ensure that the installation was successful, run the following command.

go version


Should you have any trouble, send me a message and I'll do my best to help out.

Enjoying these posts? Subscribe for more