Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Installing and Setting Up Go on Linux

Getting started with any programming language requires some initial setup, and Go is no different. Occasionally, the setup of compiled languages can be tricky, but thankfully Go has a fairly painless setup. In this learning activity, you've been asked to set up a development server for your boss who wants to learn Go but doesn't want to go through the setup. By the time you've finished this activity, you should feel comfortable setting up a Go development environment.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Sep 20, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Download and install Go (version 1.11.x)

    To install Go, we need to download the package for our server's operating system and CPU architecture from the Go downloads page. The server we've been given is running 64-bit Linux, so we'll need the linux-amd64 version.

    After the package is downloaded, it should be extracted and moved to /usr/local. Here's one way we can achieve this for version 1.11.2:

    ~ $ cd /tmp
    /tmp $ wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz
    /tmp $ sudo tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz
    

    We'll also want to install git:

    ~ $ sudo yum install -y git
    
  2. Challenge

    Set up the `$GOPATH`

    When developing with Go, the source code needs to be placed in the $GOPATH, and that directory tree needs to be manually set up. We need to create the directories at ~/go, ~/go/bin, and ~/go/src. Once these directories are set up, then we'll also need to set up the $GOPATH environment variable.

    ~ $ mkdir -p ~/go/{src,bin}
    ~ $ echo 'export GOPATH=$HOME/go' >> ~/.bashrc
    
  3. Challenge

    Modify `$PATH` to include Go binaries

    The Go package we downloaded comes with its own binaries, but we won't have access to them until they are placed within our $PATH. We need to append the /usr/local/go/bin and $GOPATH/bin directories to our $PATH in the .bashrc file.

    /tmp $ cd ~
    ~ $ echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.bashrc
    ~ $ source .bashrc
    ~ $ go run hello.go
    Thank you for setting up this server!
    ~ $
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight