How to install Apptainer ?
This tutorial summarizes how to install the container management software Apptainer. It is largely based on official installation instructions, and one should read these more exhaustive ressources for more details.
Apptainer works on any modern Linux distribution ; however, it is not compatible with Windows and MacOS host kernels and does not run natively on those. It is recommended to use virtualization solutions or a Docker container in such cases, which will not be covered in this topic : see more information here.
Finally, this tutorial focuses on currently supported versions: if you are using a Linux distribution version that is no longer supported (for example, CentOS 7 or Ubuntu 18.04) and you encounter a difficult-to-resolve error, do not hesitate to contact us!
Install Ubuntu packages
One liner command
You can run the following commands to directly install Ubuntu packages :
Step-by-step detail
To install pre-built Ubuntu packages for amd64
and arm64
architectures, one needs to access Apptainer’s personal package archive (PPA).
First, run this to ensure access to the add-apt-repository
command :
Then, finish the installation using :
Install Debian packages
One liner command
You can run the following commands to directly install Debian packages :
Step-by-step detail
To install pre-built Debian packages only for amd64
architectures, one needs to access Apptainer’s GitHub repository using wget
:
Once wget
is available, the .deb
package can be downloaded and installed locally :
Installation for RedHat, Fedora, CentOS
RPM packages from GitHub
With each new version release, a RPM (RedHat Package Manager) package is available on GitHub :
RPM packages from EPEL or Fedora
RPM packages are also available through EPEL (Extra Packages for Enterprise Linux). Using RedHat, one first has to gain access to EPEL repositories :
From here, use the following to install the package :
Install without superuser privileges
For non-privileged users, a scripts is made available to install pre-built binaries together with several utilitaries mandatory to run Apptainer. The script works for Red Hat Enterprise Linux-derived systems, and also for Fedora, SUSE/OpenSUSE, Debian, and Ubuntu. It is however required to have access to curl
rpm2cpio
and cpio
through the $PATH
environment variable).
One can run the script using :
Please note the global apptainer
command will not be available with this installation, and it is required to call the executable using install-dir/bin/apptainer
. We suggest to create an apptainer
alias pointing to this executable in ~/.bashrc
or ~/.bash_aliases
.
Install on Windows/MacOS
For Windows user, a dedicated documentation page can be found here.
For Mac users, it is recommended to use Lima via Homebrew on the Apptainer documentation.