In this tutorial learn how to manage multiple containers with Podman Quadlets on Ubuntu 26.04 using systemd. Create, start, stop, and manage container services easily.
If you manage several containers on one server, running long podman run commands quickly becomes difficult to maintain. Podman Quadlets let you define containers in simple configuration files while systemd manages them like native Linux services.
You'll install Podman 5.7 on Ubuntu 26.04 and deploy five lightweight Nginx containers using Quadlets. Each container will have its own systemd service, 256 MB memory limit, and dedicated HTTP port.
Prerequisites
- Ubuntu 26.04 LTS dedicated server
- A user with sudo privileges
- Internet connection
Let's start learning how to manage multiple containers with Podman Quadlets on Ubuntu 26.04 using systemd.
Step 1: Update Ubuntu
Update your package list and install the latest system updates.
sudo apt update
sudo apt upgrade -y
Step 2: Install Podman
Ubuntu 26.04 includes Podman 5.7 in the official repository.
sudo apt install podman -y
Verify the installation.
podman --version
Example output:
podman version 5.7.0
You can also verify that Podman is working correctly.
podman info
Step 3: Create the Quadlet Directory
Create the directory used to store Quadlet configuration files.
sudo mkdir -p /etc/containers/systemd
Step 4: Generate Five Quadlet Files
Instead of creating each file manually, use the following command to generate five Quadlet files automatically.
for i in $(seq 1 5); do
cat <<EOF | sudo tee /etc/containers/systemd/webapp$i.container >/dev/null
[Unit]
Description=Web App $i
[Container]
ContainerName=webapp$i
Image=docker.io/library/nginx:alpine
PublishPort=$((8080 + i)):80
Memory=256m
[Service]
Restart=always
[Install]
WantedBy=multi-user.target
EOF
done
This command creates the following files.
/etc/containers/systemd/webapp1.container
/etc/containers/systemd/webapp2.container
/etc/containers/systemd/webapp3.container
/etc/containers/systemd/webapp4.container
/etc/containers/systemd/webapp5.container
Each container uses the Nginx Alpine image, has a 256 MB memory limit, and listens on its own port.
| Container | Port |
|---|---|
| webapp1 | 8081 |
| webapp2 | 8082 |
| webapp3 | 8083 |
| webapp4 | 8084 |
| webapp5 | 8085 |
Step 5: Reload Systemd
Reload systemd so it detects the new Quadlet files.
sudo systemctl daemon-reload
Step 6: Start the Containers
Start all five services.
sudo systemctl start webapp1.service
sudo systemctl start webapp2.service
sudo systemctl start webapp3.service
sudo systemctl start webapp4.service
sudo systemctl start webapp5.service
You can also use a loop.
for i in $(seq 1 5); do
sudo systemctl start webapp$i.service
done
Step 7: Verify the Services
List all running Quadlet services.
systemctl list-units --type=service | grep webapp
Example output:
webapp1.service
webapp2.service
webapp3.service
webapp4.service
webapp5.service
Step 8: Verify the Containers
Check the running containers.
sudo podman ps
Example output:
CONTAINER ID IMAGE PORTS
xxxxxxxxxxxx nginx:alpine 0.0.0.0:8081->80
xxxxxxxxxxxx nginx:alpine 0.0.0.0:8082->80
xxxxxxxxxxxx nginx:alpine 0.0.0.0:8083->80
xxxxxxxxxxxx nginx:alpine 0.0.0.0:8084->80
xxxxxxxxxxxx nginx:alpine 0.0.0.0:8085->80
Step 9: Test the Containers
Open your browser and visit one of the containers.
http://SERVER-IP:8081
You can also test it with curl.
curl http://localhost:8081
Repeat the same test using ports 8082 through 8085.
Step 10: View Logs
View the logs for a specific service.
journalctl -u webapp1.service
Show only the most recent log entries.
journalctl -u webapp1.service -n 20
Step 11: Restart a Container
sudo systemctl restart webapp1.service
Step 12: Stop a Container
sudo systemctl stop webapp1.service
Start it again whenever needed.
sudo systemctl start webapp1.service
Step 13: Remove a Container
Stop the service.
sudo systemctl stop webapp1.service
Remove the Quadlet file.
sudo rm /etc/containers/systemd/webapp1.container
Reload systemd.
sudo systemctl daemon-reload
Important Note
With Podman 5.7, Quadlet services are generated dynamically by systemd. Running the following command is not required.
sudo systemctl enable webapp1.service
You may see the following message.
Failed to enable unit: Unit ... is transient or generated
This is expected behavior. After creating or modifying Quadlet files, simply reload systemd and start the service.
sudo systemctl daemon-reload
sudo systemctl start webapp1.service
Conclusion
We have successfully seen how to manage multiple containers with Podman Quadlets on Ubuntu 26.04 using systemd.
Podman Quadlets make container management simple by integrating directly with systemd. In this tutorial, you deployed five lightweight Nginx containers using a single script, assigned each one a memory limit, and managed them using standard systemctl commands. As your environment grows, you can follow the same approach to deploy additional containers while keeping your server organized and easy to maintain.

