<\/span><\/h2>\r\n\r\n\r\n\r\nFirst, log in to your Ubuntu 20.04 server via SSH as the root user:<\/p>\r\n\r\n\r\n\r\n
ssh root@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\nYou must replace \u2018IP_Address\u2019 and \u2018Port_number\u2019 with your server\u2019s respective IP address and SSH port number. Also, you should replace \u2018root\u2019 with the username of the admin account if needed.<\/p>\r\n\r\n\r\n\r\n
Before we begin the installation, we should ensure that all the Ubuntu OS packages installed on the server are updated. You can do this by running the following commands:<\/p>\r\n\r\n\r\n\r\n
apt-get update -y\r\napt-get upgrade -y<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 2: Download and Install Go<\/span><\/h2>\r\n\r\n\r\n\r\nAfter this system update, you will need to download the latest version of the Go tarball from the Go official website.<\/p>\r\n\r\n\r\n\r\n
At the time of writing this article, the latest stable version of Go is version 1.16.7. But before downloading, visit the official Go downloads page\u00a0and check if there is a new version available.<\/p>\r\n\r\n\r\n\r\n
To download the Go tarball, run the following command:<\/p>\r\n\r\n\r\n\r\n
wget https:\/\/golang.org\/dl\/go1.16.7.linux-amd64.tar.gz<\/pre>\r\n\r\n\r\n\r\nOnce the tarball is downloaded, verify the tarball checksum with the following command:<\/p>\r\n\r\n\r\n\r\n
sha256sum go1.16.7.linux-amd64.tar.gz<\/pre>\r\n\r\n\r\n\r\nYou should see an output that looks similar to the one below:<\/p>\r\n\r\n\r\n\r\n
7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04 go1.16.7.linux-amd64.tar.gz<\/pre>\r\n\r\n\r\n\r\nCompare the hash value from the above output to the checksum value on the Go download page. If they match, that means the file’s integrity is validated, and you can proceed with the installation.<\/p>\r\n\r\n\r\n\r\n
Next, extract the downloaded file to the\u00a0recommended \/usr\/local<\/code><\/strong> directory with the following command:<\/p>\r\n\r\n\r\n\r\ntar -C \/usr\/local -xvzf go1.16.7.linux-amd64.tar.gz<\/pre>\r\n\r\n\r\n\r\nThat should extract Go and saved it in the \/usr\/local<\/strong> directory.<\/p>\r\n\r\n\r\n\r\n