How to Install Singularity on Linux in EO-Lab FRA1-1 Cloud

Singularity is an open-source application to create and run software containers on shared Linux-based computing clusters. Singularity environments act the same regardless of the hardware platform they run on, which paves the way for high-performance computing.

Singularity is written in Go so you have to install Go first.

What We Are Going To Cover

  • Install Singularity on Debian-based systems

  • Install Singularity on CentOS/RHEL systems

  • Set up the Go environment

  • Install Golangci-lint

  • Build Singularity from source

  • Compile SingularityCE, the Community Edition of Singularity


No. 1 Account

You need a EO-Lab hosting account with access to the Horizon interface: .

No. 2 Access to Debian or Ubuntu Linux

To install and run Singularity, use an existing Linux instance or launch a new one as described in

This article was written for virtual machines using Ubuntu 20.04 and CentOS 7.

Install Singularity on Debian-based systems

Install development tools and libraries to your host.

sudo apt-get update && \
sudo apt-get install -y build-essential \
libseccomp-dev libglib2.0-dev pkg-config squashfs-tools cryptsetup

Download the Golang archive to /tmp, then extract the archive to /usr/local.

export VERSION=1.20.1 OS=linux ARCH=amd64

wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz${VERSION}.${OS}-${ARCH}.tar.gz && \
sudo tar -C /usr/local -xzf /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz

Install Singularity on CentOS/RHEL systems

Install both the libraries needed and the Go language:

sudo yum groupinstall -y 'Development Tools' && \
sudo yum install -y epel-release && \
sudo yum install -y golang libseccomp-devel \
glib2-devel squashfs-tools cryptsetup

Set up your environment for Go

This step is for both types of Linux distros:

echo 'export GOPATH=${HOME}/go' >> ~/.bashrc && \
echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc && \
source ~/.bashrc

Install Golangci-lint

Linting is a way to catch common mistakes in a programming language. Golangci-lint bundles common linters into a single binary for the Go language. Here is how to install it:

curl -sSfL | sh -s -- -b $(go env GOPATH)/bin

Build Singularity

The following commands will build Singularity from source:

mkdir -p ${GOPATH}/src/ && \
cd ${GOPATH}/src/ && \
git clone --recursive && \
cd singularity

Compile SingularityCE

Build SingularityCE with the following commands:

cd ${GOPATH}/src/ && \
./mconfig && \
cd ./builddir && \
make && \
sudo make install

Check SingularityCE version by running:

singularity version

Test the installation:

singularity run library://godlovedc/funny/lolcow

You should see something like this:

INFO:    Downloading library image
/ Excellent day for putting Slinkies on \
\ an escalator.                         /
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

What To Do Next

To extensively use Singularity, you might need to learn how to use Docker too: