Install the Go language on Debian/Ubuntu

  • Download the Go program at the Golang home page.
    https://go.dev/dl/

  • On that Web page find the correct Go version for your operating system. For our purposes here we want the Linux version. The current newest version is 1.23.5. So right-click on the file go1.23.5.linux-amd64.tar.gz, copy the link. Then as root or sudo user, log into your VPS server, and paste the URL onto your command line with a wget command in front of it:

    user@vps:~$ wget https://go.dev/dl/go1.23.5.linux-amd64.tar.gz
  • If you are having trouble downloading using this method (I did) then here is an alternate download location:

    user@vps:~$wget https://www.sec3.net/misc/go1.23.5.linux-amd64.tar.gz
  • After the download is finished do this command:

    user@vps:~$ tar -C /usr/local -xzf go1.23.5.linux-amd64.tar.gz
  • This will extract all Golang files to your /usr/local/ directory, in a folder called go.
    A precompiled Go binary will be placed in /usr/local/go/bin/

  • Log out of root and log in as the user that will be using Golang. Add Go's path to the file .bashrc:

    export PATH=$PATH:/usr/local/go/bin
  • Save the file.

  • Log out of the current user. Then log in again.
    The Go language is now installed.

  • To check that your Go installation is working run the following command:

    user@vps:~$ go version
    go version go1.23.5 linux/amd64
  • Done!



back Home Back Home