Skip to content

Apptainer — migrating from Singularity after the fork

An Apptainer migration from Singularity is mostly mechanical, because Apptainer keeps the same SIF image format and command-line verbs. What remains is moving the config file, checking the rootless default and testing MPI and GPU jobs before you roll it across the cluster.

If you run Singularity containers on a high-performance computing (HPC) cluster, this article walks you through moving to Apptainer. In 2021 the project split in two. The original code went to the Linux Foundation under the name Apptainer, and the company Sylabs kept building its own version, SingularityCE. Most sites now have to pick one.

Apptainer is a good fit when you want the community-governed project and have no business reason to stay with Sylabs. The switch is mostly mechanical. Apptainer reads the same SIF files (the single-file images Singularity builds) and keeps the same commands. It even installs a singularity shortcut, so your existing scripts keep running.

How to verify

A working Apptainer install responds to these probes:

apptainer --version
apptainer exec library://alpine cat /etc/os-release
# the singularity command still works as a symlink:
singularity --version
file /etc/apptainer/apptainer.conf
apptainer buildcfg | head -10

The singularity symlink ships in the Apptainer package — existing scripts continue to work without edits. The version output, however, identifies the actual binary as Apptainer.

What’s happening

Apptainer is the same codebase Singularity was up to 3.8, then forked independently. It preserves the SIF image format, the singularity CLI verbs (build, run, exec, shell, pull, push, sign, verify), and the configuration file structure. What diverges:

  • Default execution mode. Apptainer defaults to rootless execution via user namespaces (when the kernel allows it); historical Singularity defaulted to setuid-helper mode. The user-namespace mode is more secure but requires kernel ≥ 4.18 and unprivileged_userns_clone=1.
  • Configuration paths. /etc/singularity/singularity.conf becomes /etc/apptainer/apptainer.conf. The schema is nearly identical.
  • Library push targets. The default library remote is no longer cloud.sylabs.io (which requires a Sylabs account) — Apptainer ships with no default remote, expecting sites to configure their own.
  • Plugin ABI. Apptainer plugins compiled against SingularityCE need recompilation against Apptainer headers. Sites that use third-party plugins should validate compatibility before cutover.

The fork is amicable enough that SIF files built under either tool work under either. Existing image registries (any plain OCI registry, or the Sylabs library) work for both. The migration is primarily about which CLI binary is installed and which configuration paths it reads.

The procedure

  1. Install Apptainer alongside the existing Singularity install on a test node first:
APPTAINER_VERSION=1.3.0
ARCH=$(dpkg --print-architecture)
curl -fsSL https://github.com/apptainer/apptainer/releases/download/v${APPTAINER_VERSION}/apptainer_${APPTAINER_VERSION}_${ARCH}.deb -o /tmp/apptainer.deb
sudo dpkg -i /tmp/apptainer.deb
apptainer --version
  1. Verify existing SIF images run unchanged. Apptainer reads the same SIF format:
apptainer exec /shared/images/myapp.sif myapp --version
apptainer verify /shared/images/myapp.sif
diff <(singularity inspect /shared/images/myapp.sif) <(apptainer inspect /shared/images/myapp.sif)

The inspect output should be byte-identical — same metadata, same signature, same image.

  1. Migrate the configuration. The conf file structure is the same, but the directives may have new defaults:
sudo cp /etc/singularity/singularity.conf /etc/apptainer/apptainer.conf
diff /etc/apptainer/apptainer.conf.example /etc/apptainer/apptainer.conf

Pay attention to: allow setuid, enable userns, bind path entries, and mksquashfs path. These often need tweaking for the rootless-by-default model.

  1. Update job submission scripts and module files. If your cluster uses environment modules:
# /etc/modulefiles/singularity → apptainer.lua
prepend-path PATH /opt/apptainer/bin
setenv APPTAINER_BIND "/scratch,/projects"

If you keep the singularity symlink, no user-script changes are needed.

  1. Validate MPI and GPU workloads. These are where ABI differences could bite — run an actual MPI test job:
mpirun -np 16 apptainer exec --nv /shared/images/openmpi-bench.sif osu_bw

Compare bandwidth/latency to the previous SingularityCE measurement. They should match within noise.

  1. Cut over the cluster. Roll the install through the node pool with ansible or pdsh, schedule a maintenance window for the login nodes, and update the cluster docs to mention both names.

Common pitfalls

  • Assuming “the singularity symlink fixes everything”. It fixes CLI invocation; it does not fix scripts that read /etc/singularity/ directly or check singularity --version output for the word “SingularityCE”.
  • Forgetting that the Sylabs library remote requires an account and that Apptainer has no default remote. Either configure apptainer remote add with your own OCI registry or push images via plain oci-archive: files.
  • Running Apptainer on an HPC cluster where the kernel has user_namespaces disabled (some site security policies). The rootless mode fails — fall back to setuid mode by setting allow setuid = yes in apptainer.conf and ensuring the binary has the setuid bit.
  • Building images with SingularityCE-specific definition file directives (%setup quirks, %test extensions). Most work; a few do not. Test every image’s build before assuming parity.
  • Keeping both packages installed long-term. Pick one — the cohabitation works for migration but accumulates configuration drift over months.

Stack Harbor runs the migration plan for clients with shared HPC clusters that need to move off Singularity to Apptainer cleanly — see clustered environments for the per-node rollout, the per-job test matrix we run, and the documentation refresh we ship alongside the binary cutover.