2. Installation and Updates

Swarm is part of the Ethereum stack, the reference implementation is currently at POC3 (proof of concept 3), or version 0.3.x

Swarm runs on all major platforms (Linux, macOS, Windows, Raspberry Pi, Android, iOS).

Note

The swarm package has not been extensively tested on platforms other than Linux and macOS.

2.1. Installing Swarm on Ubuntu via PPA

The simplest way to install Swarm on Ubuntu distributions is via the built in launchpad PPAs (Personal Package Archives). We provide a single PPA repository that contains our stable releases for Ubuntu versions trusty, xenial, bionic and cosmic.

To enable our launchpad repository please run:

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum

After that you can install the stable version of Swarm:

sudo apt-get update
sudo apt-get install ethereum-swarm

2.2. Installing Swarm from source

The Swarm source code for can be found on https://github.com/ethereum/go-ethereum

2.2.1. Prerequisites

Building the Swarm daemon swarm requires the following packages:

Grab the relevant prerequisites and build from source.

2.2.1.1. Ubuntu / Debian

sudo apt install git
sudo apt install golang

2.2.1.2. Archlinux

pacman -S git go

2.2.1.3. Generic Linux

The latest version of Go can be found at https://golang.org/dl/

To install it, download the tar.gz file for your architecture

curl -O https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz

Unpack it to the /usr/local

sudo tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz

2.2.1.4. macOS

brew install go git

2.2.2. Configuration

You should then prepare your Go environment, for example:

mkdir $HOME/go
export GOPATH=$HOME/go
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
export PATH=$PATH:$GOPATH/bin
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc

2.2.3. Compiling and installing

Once all prerequisites are met, download and install packages and dependencies for go-ethereum.

mkdir -p $GOPATH/src/github.com/ethereum
cd $GOPATH/src/github.com/ethereum
git clone https://github.com/ethereum/go-ethereum
cd go-ethereum
go get github.com/ethereum/go-ethereum
cd $GOPATH/src/github.com/ethereum/go-ethereum

This will download the master source code branch.

Finally compile the swarm daemon swarm and the main go-ethereum client geth.

go install ./cmd/geth
go install ./cmd/swarm

You can now run swarm to start your Swarm node. Let’s check if the installation of swarm was successful:

swarm version

or, if your PATH is not set and the swarm command can not be found, try:

$GOPATH/bin/swarm version

This should return some relevant information. For example:

Swarm
Version: 0.3
Network Id: 0
Go Version: go1.10.1
OS: linux
GOPATH=/home/user/go
GOROOT=/usr/local/go

2.2.4. Updating your client

To update your client simply download the newest source code and recompile.

cd $GOPATH/src/github.com/ethereum/go-ethereum
git checkout master
git pull
go install ./cmd/geth
go install ./cmd/swarm