Podman (Pod Manager) is an open-source tool developed by Red Hat that helps developers containerize their applications. Compared to Docker, Podman is light and lean, eliminating resource overhead from the central daemon, and allowing containers to start faster and with fewer resources. This efficiency is critical in contexts where resource efficiency and rapidity are paramount. Unlike Docker, which relies on a central daemon (docker daemon), Podman offers a daemonless architecture, providing no single point of failure.
Benefits of Podman Containers
- Daemonless Architecture:
- No Central Daemon: Podman is lighter than Docker as it does not use a central daemon, reducing potential points of failure.
- Direct Management: Containers are controlled directly, offering higher control over their lifecycle.
- Rootless Containers:
- Enhanced Security: Running containers without root access minimizes the risk of privilege escalation attacks.
- User-Level Management: Containers can be managed at the user level, enforcing better security procedures without needing privileged information.
- Kubernetes Compatibility:
- Pod Concept: Similar to Kubernetes pods, Podman allows grouping multiple containers that share a common network namespace.
- Easy Transition: Podman applications can be easily ported to Kubernetes, improving the deployment process in production environments.
- Docker Compatibility:
- Common CLI: Podman's CLI is largely compatible with Docker, allowing users to migrate with minimal adjustments.
- Interoperability: Podman can create and manage Docker-format containers and images.
Key Features
- Daemonless Architecture: Podman operates without a central daemon, enhancing security and efficiency. Containers are started and managed directly by the Podman command line interface (CLI).
- Rootless Operation: Podman can run containers as a root or unprivileged user, providing a more secure environment by reducing the need for root access.
- Kubernetes-Like Pods: Pods in Podman group several containers that share network and storage resources, similar to Kubernetes pods.
- Compatibility with Docker CLI: Most Docker CLI commands and scripts can be used with Podman without modification, easing the transition for users switching from Docker.
- Container Image Management: Podman uses the same image formats as Docker, allowing easy pulling of images from Docker Hub or other container registries.
Understanding Pods and Infra Containers
What is an Infra Container?
Infra containers are lightweight containers created by Podman to hold a pod's state, including shared namespaces like network, PID, and IPC. They ensure the stability and resource management of the pod, maintaining the pod environment even if application containers restart.
Example: Setting Up a Pod with an Infra Container in Podman
- Create a Pod with an Infra Container:
podman pod create --name mypod
This command creates a pod named mypod with an infra container to manage the pod's network namespace and other shared resources.
- Adding Containers to the Pod:
Let's add two containers inside the pod. These will share the network namespace that will be managed by the infra container.
podman run -dt --pod mypod --name webserver nginx
podman run -dt --pod mypod --name database postgres
The first command deploys an Nginx web server container inside mypod. The next command creates a PostgreSQL database container in the same pod.
- Networking and Resource Sharing:
- podman exec -it webserver ping database
This command allows the webserver container to ping the database container using the shared network namespace.
podman exec -it webserver ping database
What is Conmon?
Conmon (container monitor) is a process monitoring application that observes the lifecycle of container processes, handles logging, proxies signals, and captures exit statuses.
Essential Tasks of Conmon:
- Process Monitoring: Ensures container processes start, run, and exit correctly.
- Logging: Captures and handles container logs.
- Signal Proxying: Proxies signals from the parent process to the container process.
- Exit Status: Captures and reports the container process's exit status.
- Podman Installation for Windows
Installing Podman on Windows
While containers are inherently Linux-based, Podman can also be used on Mac and Windows. For Windows, it involves using the Windows Subsystem for Linux (WSL) and the Podman machine command.
Installation Steps:
- Install Windows Terminal:
winget install Microsoft.WindowsTerminal
Command:
winget install Microsoft.WindowsTerminal
Example:

Installation
1. To begin the installation process of the Windows Podman client, the first task requires is to download the Windows installer of Podman. Naturally, every Podman release comes with a Windows installer, which can be downloaded from podman. io.
Select Podman CLI for Windows

Click on Install
.png)
Restart your computer by clicking restart.
.png)
After restart WSL Kernel Installation will start and installation will be completed.
.png)
.png)
Podman Container Commands:
- Podman Machine Creation:

podman machine start command
podman machine initAfter podman machine init process completes machine can be started using following command.
podman machine startExample:

Running a Container:
podman run ubi8-micro dateSetting Rootful or Rootless:
podman machine stop
podman machine set --rootful
podman machine set --rootful=false

Example:

podman machine set --rootful=false
Example:


Podman machine ls command
Use the podman machine ls command to view a list of all available podman machine instances along with their current resource usage.
podman machine ls
Example:

Access the embedded WSL distribution:
podman machine ssh
Example:

Podman version
podman --version
Example:

Stop command
The machine is halted by using the podman machine stop command.
podman machine stop
Example:

rm command
Using podman machine rm command the machine can be removed.
podman machine rm
Example:

Benefits Of Podman Container
Run Rootless Containers: Reduce security risks by running containers without root privileges.Use-Cases of Podman
- Optimize Capabilities: Use
--cap-dropand--cap-addflags to limit container capabilities. - Optimize Images: Use lightweight, secure images to minimize attack surfaces.
- Use Volumes Wisely: Manage persistent data with volumes or bind mounts.
- Regular Updates: Keep Podman and dependencies up-to-date with the latest security patches and features.
Differences between Podman and Docker
Feature | Podman | Docker |
|---|---|---|
Daemon | It has Daemonless architecture and runs in rootless mode | It requires a running daemon (dockerd) |
Rootless Operation | Yes, it supports running as non-root | It has limited rootless support |
CLI Commands | It s compatible with Docker CLI | Docker-specific commands |
Container Runtime | It uses CRI-O or other runtimes | It uses containerd as its runtime |
Systemd Integration | It has better integration with systemd | It requires additional configuration |
Kubernetes Support | It uses CRI-O for Kubernetes | It uses containerd, supports Kubernetes |
Image Management | It directly manipulates OCI images | It manages images via Docker daemon |
Networking | It uses CNI plugins for networking | It has built-in networking via dockerd |
Security | It is focused on enhanced security | It is secure, but daemon introduces attack surface |
Compatibility | It is compatible with Docker containers | It has native support for Docker containers |
Installation | It us typically installed separately | It is often bundled with Docker Compose, Swarm, etc. |
API | No API, direct command execution | REST API provided by Docker daemon |
Resource Management | It is managed by the kernel, cgroups | It is managed by Docker daemon |
Best Practices with Podman
1.Run Rootless Containers
Reduce security riskâmost containers should not be run as root. To reduce the potential exposure to privilege escalation attacks, Podman fully supports running rootless.
2. Capabilities in a Boundary
The `--cap-drop` and `--cap-add` flags are available to restrict only those container capabilities that your deployment scenario requires. This helps reduce the attack surface by providing only what is truly required.
3. Optimizing Images
Run only a few images in containers to minimize attack surfaces and maximize efficiency. Your images must be light and secure; hence, clear the extra equipment and files.
4.Use Volumes Wisely
Manage persistent data with volumes. Another good development practice is to use lemma named volumes or bind mounts for the persistence of data across container restarts. This helps in managing data and makes containers stateless.
5. Ugrade regularly
Keep Podman and the dependencies on top of the latest updates. Doing this ensures you are running with the latest security patches and features in place. Regular updating guarantees that you are running the most secure and full-featured version of the software.
Troubleshooting
Common Issues and Solutions:
- Version Validation: Ensure you're running the latest version of Podman.
podman version- Rootless Containers Cannot Ping Hosts: Enable unprivileged pings on the host:
sysctl -w "net.ipv4.ping_group_range=0 2000000"- Permission Denied: Specify a container storage path outside a noexec home directory by editing the
storage.conffile. - Missing
newuidmap: Install a compatible version ofshadow-utils.
Conclusion
Podman offers a robust and secure alternative to Docker for container management, featuring a daemonless architecture, enhanced security with rootless containers, Kubernetes compatibility, and Docker interoperability. Whether you're transitioning from Docker or starting fresh, Podman provides a flexible and efficient solution for managing your containerized applications.