Introduction to Podman | The Docker Alternative You Need to Know

- Published on

🐳 Introduction to Podman: The Container Engine That Actually Makes Sense
Ever felt like Docker was that friend who's always running in the background, consuming resources, and occasionally crashing your system? Meet Podman, the container engine that actually respects your machine and doesn't need a daemon to function.
This guide will walk you through everything you need to know about Podman, from basic concepts to practical usage. Whether you're a Docker veteran looking for something better or a complete container newbie, you'll find something useful here.
🤔 What is Podman Anyway?
Podman (Pod Manager) is a daemonless container engine that lets you run containers without needing a background daemon process. Think of it as Docker's more responsible sibling who cleans up after themselves and doesn't hog system resources.
The best part? Most Docker commands work with Podman too, so you won't feel like you're learning a completely new language.
📦 What You'll Need
- A Linux machine (works great on Fedora, Ubuntu, CentOS, or any Linux distro)
- Basic command line knowledge (you don't need to be a terminal wizard)
- Curiosity about containers (we've got you covered if you're new to this)
⚙️ Step 1: Installing Podman
Getting Podman up and running is surprisingly straightforward:
On Fedora/RHEL/CentOS:
sudo dnf install podman
On Ubuntu/Debian:
sudo apt update
sudo apt install podman
On macOS (using Homebrew):
brew install podman
On Windows:
# Using Chocolatey
choco install podman
Verify your installation:
podman --version
# Should show something like: podman version 4.x.x
🚀 Step 2: Your First Container (Hello, World!)
Let's start with something simple. We'll run a basic container to make sure everything works:
podman run hello-world
If you see a friendly message about Docker (don't worry, it's just the image name), congratulations! You've successfully run your first container with Podman.
Understanding What Just Happened
When you ran that command, Podman:
- Downloaded the hello-world image (if it wasn't already cached)
- Created a container from that image
- Ran the container
- Showed you the output
- Cleaned up after itself
No daemon, no background processes, just clean execution.
🏃 Step 3: Running Interactive Containers
Sometimes you need to get inside a container to debug or explore. Let's try an interactive Ubuntu container:
podman run -it ubuntu bash
This command:
-i
makes it interactive-t
allocates a pseudo-TTY (fancy term for "makes it feel like a real terminal")ubuntu
is the base imagebash
is the command to run
You should now be inside the Ubuntu container! Try running some commands:
ls -la
whoami
cat /etc/os-release
To exit, just type exit
or press Ctrl+D.
📁 Step 4: Working with Images
Pulling Images
Podman can pull images from various registries:
# Pull from Docker Hub
podman pull nginx
# Pull from a specific registry
podman pull quay.io/prometheus/prometheus
# Pull a specific version
podman pull alpine:3.18
Listing Images
See what images you have locally:
podman images
Removing Images
Clean up space when you're done:
# Remove a specific image
podman rmi nginx
# Remove all unused images
podman image prune
🏗️ Step 5: Building Your Own Images
One of the most powerful features is creating your own container images. Let's build a simple web server:
- Create a Dockerfile:
mkdir my-webapp
cd my-webapp
Create a file called Dockerfile
:
FROM alpine:latest
RUN apk add --no-cache python3 py3-pip
COPY app.py /app.py
EXPOSE 8000
CMD ["python3", "/app.py"]
- Create a simple Python app:
Create app.py
:
#!/usr/bin/env python3
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print(f"Server running at http://localhost:{PORT}")
httpd.serve_forever()
- Build the image:
podman build -t my-webapp .
- Run your custom container:
podman run -p 8080:8000 my-webapp
Visit http://localhost:8080
in your browser to see your app running!
🔧 Step 6: Managing Containers
Running Containers in the Background
Sometimes you want containers to run without taking over your terminal:
podman run -d nginx
The -d
flag runs it in detached mode (background).
Listing Running Containers
# Show running containers
podman ps
# Show all containers (including stopped ones)
podman ps -a
Stopping and Removing Containers
# Stop a running container
podman stop <container_id>
# Remove a container
podman rm <container_id>
# Stop and remove in one command
podman rm -f <container_id>
🌐 Step 7: Networking Basics
Port Mapping
We've already seen this with -p 8080:8000
, but let's understand it better:
# Map host port 8080 to container port 80
podman run -p 8080:80 nginx
# Map to a random available port
podman run -p 80 nginx
Container Communication
Containers can talk to each other using container names:
# Start a database container
podman run -d --name mydb postgres
# Start an app that connects to the database
podman run -d --name myapp --link mydb:db my-webapp
💾 Step 8: Persistent Storage
Containers are ephemeral by default, but you often need data to persist:
# Mount a host directory into the container
podman run -v /host/path:/container/path nginx
# Use named volumes (recommended)
podman volume create mydata
podman run -v mydata:/data nginx
🛠️ Step 9: Podman vs Docker Commands
Here's the beautiful thing about Podman: most Docker commands work exactly the same! Just replace docker
with podman
:
Docker Command | Podman Command |
---|---|
docker run | podman run |
docker build | podman build |
docker ps | podman ps |
docker images | podman images |
You can even create aliases to make the transition seamless:
alias docker=podman
🚧 Common Gotchas and Troubleshooting
SELinux Issues (Red Hat-based systems)
If you encounter permission errors:
# Add :Z flag for SELinux context
podman run -v /host/path:/container/path:Z nginx
Rootless Containers
Podman runs containers as your user by default (which is awesome for security). If you need root privileges:
podman run --privileged nginx
Port Already in Use
If you get "port already in use" errors:
# Find what's using the port
sudo netstat -tulpn | grep :80
# Use a different port
podman run -p 8080:80 nginx
🎯 When to Use Podman vs Docker
Choose Podman when:
- You want better security (no daemon running as root)
- You're working in environments where daemons are frowned upon
- You want lower resource usage
- You need better integration with systemd
Stick with Docker when:
- You're heavily invested in Docker Swarm
- You need Docker Compose (though Podman Compose exists)
- Your team/company standardizes on Docker
🔮 Advanced Features to Explore
Once you're comfortable with the basics, check out these powerful features:
- Pods: Group containers together (like Kubernetes pods)
- Play kube: Run Kubernetes YAML files locally
- Systemd integration: Run containers as system services
- Podman Compose: Docker Compose alternative
🎉 Wrapping Up
You've now got a solid foundation in Podman! You can run containers, build images, manage storage, and handle networking. The best part? You can do all this without a daemon running in the background, consuming resources, or creating security concerns.
Podman isn't just a Docker alternative; it's a better way to work with containers. Give it a try in your next project, and you might never want to go back to Docker.
What containers are you planning to run? Let us know about your Podman adventures!
Happy containerizing! 🚀

Ready to Boost Your Productivity?
Stop struggling with scattered tasks and inefficient workflows. Smarter.Day is the productivity app that helps you organize your development work, track your learning progress, and build better habits - all in one beautiful interface.
- Visual progress tracking for your learning goals
- Habit building for consistent development practice
- Smart task management for your projects
- Beautiful analytics that show your growth