If you’ve been following my articles on self-hosted services, you may already be familiar with containers. With their solid isolation provisions, easy-to-deploy nature, and (typically) low resource consumption, containers are the crux of every experimentation server and self-hosting workstation.
While Docker remains one of the most popular container runtime environments, it’s far from the only option available for tinkerers. If you’re looking for Docker alternatives, Podman sits at the top of the list, and here’s a quick guide to help you get started with this amazing platform.
I use these 4 tools to enhance my Docker experience
A basic Docker installation is fine and all, but these four tools can elevate its functionality to the next level
What’s Podman, anyway?
And how’s it different from Docker?
At their core, both Podman and Docker are containerization tools, designed to help you deploy services inside isolated environments. But rather than running a daemon (an extra application that runs in the background) to tackle your containerization workloads, Podman has a daemon-less architecture. As such, Podman is more secure than its rival, because you don’t have a daemon serving as a potential attack surface for security threats.
By default, Podman runs containers inside a rootless environment, while Docker forces you to enable the rootless mode if you wish to avoid the security vulnerabilities associated with deploying containers with root privileges. True to its name, Podman can combine multiple containers inside pods. Similar to their Kubernetes counterparts, pods are a collection of services that share common network and storage resources, making them perfect when you want certain applications to work together while keeping them isolated from the rest of your self-hosted suite.
Setting up Podman
Unlike Docker, Podman is included in most RHEL distros, so you can jump to the next section if you’re running Fedora or its Red Hat alternatives. For folks using Debian-based distributions, you can grab it from the apt repository with these steps:
- Launch the terminal UI included in your distro.
-
Run the apt install command to set up the Podman package.
sudo apt install podman -y
If you’re on a non-Debian distro, you can use the yum, nix, aur, or the other repositories included in your specific OS.
Deploying a container with Podman
Now that you’ve got Podman configured on your machine, it’s time to deploy a container. Fortunately, Podman is compatible with Docker Hub’s arsenal of container images, and all you have to do is append the docker.io/ string before the image name. We’ll deploy the home automation powerhouse Node-RED in this tutorial.
-
Inside the terminal UI, run the podman pull command to download a container image.
podman pull image_name
podman pull docker.io/nodered/node-red -
Similar to Docker, you can use the podman run command to deploy a container from its image: podman run -parameter_name image_name
podman run -it -p 1880:1880 -v node_red_data:/data --name mynodered docker.io/nodered/node-red
-
Finally, you can check the status of your Podman containers with the ps command:
podman ps
Building a powerful self-hosting workstation with Podman
With that, you’re armed with all the basics to work with Podman. If you wish to work with pods, you can use the podman create pod command to build one. Thereafter, you can run containers in it by adding the --pod flag when executing the podman run command. Since Podman is compatible with Kubernetes, you can utilize the latter as the container orchestration platform for your favorite services.
Although Podman is more secure than Docker, it’s not as accessible as its rival. Sure, you could leverage the Podman-Compose and Quadlet add-ons to enhance its utility, but Docker Compose is better when you want a painless method to deploy containers from YAML files.
5 of the coolest things you can run on Docker
Tired of running the same set of Docker images? You can spice things up by running these five services
