IPFS is a peer-to-peer hypermedia protocol to make the web faster, safer, and more open.

Go is a programming language developed by Google's team which offers a robust set of libraries and is becoming very popular. In this tutorial, we are going to show you how to install GO and IPFS on Ubuntu Linux version 17.

Hardware List:

The following section presents the list of equipment used to create this Ubuntu Linux tutorial.

Every piece of hardware listed above can be found at Amazon website.

Ubuntu Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Ubuntu linux.

Tutorial - GO Installation on Ubuntu Linux

On the Linux console, use the following commands to install the required packages.

# apt-get update
# apt-get install build-essential

Now, let's download and install the Go software.

# mkdir /downloads
# cd /downloads
# wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz
# tar -C /usr/local -zxvf go1.10.linux-amd64.tar.gz

In our example, the Go software was installed under the /usr/local folder.

In order to work properly, the Go software expect the system to have a set of environment variables.

Let's create a file to automate the required environment variables configuration.

# vi /etc/profile.d/go.sh

Here is the go.sh file content.

export GOROOT=/usr/local/go
export GOPATH=$GOROOT/work
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Now, let's reboot the computer and check if the required environment variables will be created automatically.

# reboot

Use the following command to check if the environment variables were created.

# env | grep -E "(ROOT|PATH)"

Test the Go program using the following command.

# go version

Tutorial - IPFS Installation on Ubuntu Linux

Use the following commands to install IPFS.

# go get -u -d github.com/ipfs/go-ipfs
# cd $GOPATH/src/github.com/ipfs/go-ipfs
# make install

Start your IPFS node.

# ipfs init
peer identity: QmTJdBbuMscvYBb34HD5yggfEHFK2nn1YGcsjWH4JVTZeP

Take note of you IPFS node ID.

Start the IPFS service.

# ipfs daemon

Let's create a quick page to show you how IPFS works:

# mkdir /ipfs
# cd /ipfs
# mkdir test
# vi test/test.html
<h1> TEST PAGE 01</h1>
<h2> TEST PAGE 01</h2>

Publish the test.html to IPFS.

# ipfs add -w test/test.html
added QmPoeG8AXgiSKmfSTFmYoVMYJd69b7c4VNEZJZgwuR6KaV test.html
added QmQ2yuNydvgWBimNcfALTKdKCuvr5y2MkzAV5PoUUi9ZHV

Now, you can open your browser and try to access the file that I just published:


In our example, QmPoeG8AXgiSKmfSTFmYoVMYJd69b7c4VNEZJZgwuR6KaV was the ID that IPFS gave to the test.html file.

You are now the proud owner of an IPFS node on Ubuntu Linux.