Back to articles
AI & Cloud

Configure Podman Quadlets: Professional Production Container Management via systemd

A detailed guide on configuring Podman Quadlets for professional production container management on Linux using systemd. Covers installation, configuration, startup, verification,...

DPTCloud Engineering4 min read
Configure Podman Quadlets: Professional Production Container Management via systemd

Install Podman and Quadlet

To begin, install Podman and Quadlet on your Linux system. Podman is a container management tool compatible with Docker but operates without a daemon, making it ideal for production environments. Quadlet enables systemd-based management of Podman containers using quadlet files.

On Red Hat-based systems (such as RHEL, CentOS, or Fedora), use the following command:

sudo dnf install podman quadlet -y

On Debian/Ubuntu-based systems:

sudo apt update
sudo apt install podman quadlet -y

Verify Podman installation by checking the version:

podman --version

Create and Configure Podman Quadlet

Quadlet uses files with the .podmanquadlet extension to define containers. Create a sample file in the /etc/quadlet directory:

sudo nano /etc/quadlet/myapp.podmanquadlet

File content:

[Unit]
Description=My App Container
After=network.target

[Service]
Image=nginx:latest
Publish=80:80
Restart=always

This file starts an Nginx container, exposes port 80, and ensures automatic restart if the container fails.

Start and Verify the Container

After creating the quadlet file, start the service:

sudo systemctl daemon-reload
sudo systemctl start myapp.podmanquadlet

Check the container status:

sudo systemctl status myapp.podmanquadlet
sudo podman ps

To verify the container is running, access the server's IP address on port 80.

Optimization and Management

Quadlet supports various options, including:

  • Restart=always: Automatically restarts the container if it fails.
  • Environment: Sets environment variables for the container.
  • Volumes: Mounts directories from the host into the container.
  • Network: Configures container networking.

Example with volume and environment variables:

[Service]
Image=nginx:latest
Publish=80:80
Restart=always
Environment=APP_ENV=production
Volumes=/var/www/html:/usr/share/nginx/html

Prerequisites and Verification

Requirements:

  • Linux operating system (Ubuntu 20.04+ or RHEL 8+)
  • Podman installed
  • Quadlet installed
  • Sudo privileges

Verification:

  • Run podman ps to check running containers.
  • Run systemctl status myapp.podmanquadlet to verify service status.
  • Access http://IP-server:80 to confirm Nginx is working.

Troubleshooting

If the container fails to start, check the logs:

sudo journalctl -u myapp.podmanquadlet

Ensure the following:

  • The quadlet file has the correct format.
  • Podman can access the image.
  • No permission or network issues exist.

References

Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478