How to Install GoLang on GoDaddy Server?
GoDaddy Server is a cloud-based hosting platform that consists of virtual and dedicated servers. The premium service includes weekly backups, 99% uptime, 24×7 Customer Support, a free encrypted SSL certificate, unlimited bandwidth, and SSD storage. For regular users, the latest generation is VPS Gen 4, which uses QEMU as the hypervisor to perform hardware virtualization. It offers a cheaper alternative to Amazon Web Service and Google Cloud Platform. Golang is an open-source, procedural, and statically typed programming language developed by Robert Griesemer, Rob Pike, and Ken Thompson. It is similar to the C programming language and provides a rich standard library. To know more, please visit Golang Tutorial. Let’s discuss how to install the latest version of Golang on GoDaddy VPS Gen 4 (Ubuntu).
Step 1: Open your terminal/PowerShell and ssh into the GoDaddy Server.
$ ssh username@ip
Step 2: Update and upgrade the server by running.
$ sudo apt update -y
$ sudo apt upgrade -y
Step 3: Visit https://go.dev/doc/install and copy the file path to the latest tar package for Linux.
Step 4: Download the tarball by using wget tool.
$ wget https://go.dev/dl/go1.19.linux-amd64.tar.gz
Step 5: Remove any pre-existing installation of golang by running.
$ sudo rm -rf /usr/local/go
Step 6: Now extract the archive you just downloaded into /usr/local.
$ sudo tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
Step 7: Now set the PATH environment variable open ~/.profile.
$ nano ~/.profile
Step 8: Append the following line at the end of the file.
Step 9: Commit the changes by running.
$ source ~/.profile
Step 10: Verify the installation by checking the build version.
$ go version
Step 1: Create a basic go file that outputs ‘Geeks For Geeks’.
$ nano gfg.go
Step 2: Now, use the go compiler to build the executable file.
$ go build gfg.go
Step 3: Execute the build file to view the output.