This lesson is being piloted (Beta version)

Introduction to Apptainer/Singularity

Apptainer (formerly known as Singularity) is a free and open-source container platform that allows you to create and run applications in isolated environments (also called β€œcontainers”) in a simple, portable, fast, and secure manner. It performs operating system level virtualization known as containerization. Many container platforms are available, but Apptainer is designed to bring containers and reproducibility to the scientific community and High-Performance Computing (HPC) use cases. Using Apptainer, developers can work in reproducible environments of their choice and design, and these complete environments can be easily copied and executed on other platforms.

This is an introduction to Apptainer/Singularity, its motivations and applications in HEP.

Based on the Apptainer user guide.


  • Basic knowledge of the Unix Shell, e.g., from the carpentry course.
  • Access to a computing system with Apptainer/Singularity available. It can either be installed locally, or the machine can have user namespaces enabled and access to CVMFS.
  • This training concludes with Episode 8. The Bonus episode 9 requires also Git and CI/CD knowledge and will allow to integrate that knowledge with the use of Apptainer/Singularity.

HSF Software Training

HSF Logo
This training module is part of the HSF Software Training Center, a series of training modules that serves HEP newcomers the software skills needed as they enter the field, and in parallel, instill best practices for writing software.


Setup Download files required for the lesson
00:00 1. Introduction What issues motivated the creation of Apptainer/Singularity?
What are the differences between Docker, Apptainer and Singularity?
00:10 2. Containers and Images How to pull Apptainer images from the libraries?
How to run commands inside the containers?
00:35 3. Coffee break! Get up, stretch out, and dance!
00:50 4. Building Containers How to build containers with my requirements?
01:20 5. Containers from definition files How to easily build and deploy containers from a single definition file?
02:00 6. Coffee break! Get up, stretch out, take a short break.
02:15 7. Sharing files between host and container How to read and write files on the host system from within the container?
02:45 8. Apptainer/Singularity instances How can I keep my container running in the background?
What are the use cases for instances?
03:35 9. Bonus Episode: Building and deploying an Apptainer container to GitHub Packages How to build apptainer container for python packages?
How to share apptainer images?
04:15 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.


The following people contributed to the content of this lesson: Note that this list does not include the contributors to the framework as developed by the carpentries.