note: The ‘make install’ is required to be run as root to get a properly installed Singularity implementation. If you do not run it as root, you will only be able to launch Singularity as root due to permission limitations.

Prefix in special places

If you build Singularity with a non-standard --prefix argument, please be sure to review the admin guide for details regarding the --localstatedir variable. This is especially important in environments utilizing shared filesystems.

Updating

To update your Singularity version, you might want to first delete the executables for the old version:

sudo rm -rf /usr/local/libexec/singularity

And then install using one of the methods above.

Debian/Ubuntu Package

Singularity is available on Debian (and Ubuntu) systems starting with Debian stretch and the Ubuntu 16.10 yakkety releases. The package is called singularity-container. For recent releases of singularity and backports for older Debian and Ubuntu releases, we recommend that you use the NeuroDebian repository.

Testing first with Docker

If you want a quick preview of the NeuroDebian mirror, you can do this most easily with the NeuroDebian Docker image (and if you don’t, skip to the next section). Obviously you should have Docker installed before you do this.

First we run the neurodebian Docker image:

$ docker run -it --rm neurodebian

Then we update the cache (very quietly), and look at the singularity-container policy provided:

You can continue working in Docker, or go back to your host and install Singularity.

Adding the Mirror and Installing

You should first enable the NeuroDebian repository following instructions on the NeuroDebian site. This means using the dropdown menus to find the correct mirror for your operating system and location. For example, after selecting Ubuntu 16.04 and selecting a mirror in CA, I am instructed to add these lists:

During the above, if you have a previously installed configuration, you might be asked if you want to define a custom configuration/init, or just use the default provided by the package, eg:

Configuration file '/etc/singularity/init'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** init (Y/I/N/O/D/Z) [default=N] ? Y
Configuration file '/etc/singularity/singularity.conf'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** singularity.conf (Y/I/N/O/D/Z) [default=N] ? Y

And for a user, it’s probably well suited to use the defaults. For a cluster admin, we recommend that you read the admin docs to get a better understanding of the configuration file options available to you. Remember that you can always tweak the files at /etc/singularity/singularity.conf and /etc/singularity/init if you want to make changes.

After this install, you should confirm that 2.3-dist is the version installed:

$ singularity --version
2.4-dist

Note that if you don’t add the NeuroDebian lists, the version provided will be old (e.g., 2.2.1). If you need a backport build of the recent release of Singularity on those or older releases of Debian and Ubuntu, you can see all the various builds and other information here.

Build an RPM from source

Like the above, you can build an RPM of Singularity so it can be more easily managed, upgraded and removed. From the base Singularity source directory do the following:

Install on your Cluster Resource

In the case that you want Singularity installed on a shared resource, you will need to talk to the administrator of the resource. Toward this goal, we’ve prepared a helpful guide that you can send to him or her. If you have unanswered questions, please reach out.