How to deploy the Portainer container manager with Podman

Jack Wallen walks you through the process of deploying the Portainer web-based container management platform with Podman.

Creative dark coding texture with text.
Image: Who is Danny/Adobe Stock

Portainer has been my favorite container management platform for a while. It has all the features I need to make working with containers a breeze.

Portainer was originally developed for Docker, and with Podman’s rootless nature, Portainer had some serious problems and failed to deploy. However, Podman can be run as either root or non-root, so it is indeed possible to deploy the Portainer GUI to the Podman runtime.

SEE: Hire Kit: Backend Developer (TechRepublic Premium)

Sigh. Of. Relief: That’s how much I prefer Portainer to any other container management system. For those who are new to Portainer, some of the things it can do for you through its well-designed GUI are as follows:

  • Manage containers, images, volumes and networks
  • Build full-stack applications
  • Connect to remote registries
  • Create multiple development environments
  • manage users
  • Work with templates
  • manage secrets

So how do you deploy Portainer with Podman? let me show you

What you need to deploy Portainer with Podman

To deploy Portainer with Podman, you need an operating system that supports Podman, such as Rocky Linux, AlmaLinux, RHEL, or CentOS, and a user with sudo privileges. That’s it.

How to deploy Portainer with Podman

are you ready for this I also thought. The process is incredibly simple. Login to your Podman-supporting operating system and open a terminal window. Make sure you enable the Podman socket first with the command:

sudo systemctl enable --now podman.socket

With the Podman socket running, pull the latest version of Portainer CE with:

podman pull portainer/portainer-ce

After the image is retrieved, you can deploy Portainer. Note that you must mount the container with sudo privileges. If you try to mount the container without sudo you will get the error:

Error: statfs /run/podman/podman.sock: permission denied

Although you can configure Podman to run without sudo, we won’t bother as it poses more security issues than you might want – especially when dealing with a production machine. I’ll walk through the process of enabling sudo-free container deployment with Podman in a later section.

In the meantime, let’s deploy. The command for this is:

sudo podman run -d -p 9443:9443 --privileged -v /run/podman/podman.sock:/var/run/docker.sock:Z portainer/portainer-ce

After the command finishes, give the container about a minute to mount, and then point your browser to https://SERVER:9443, where SERVER is the IP address of the host server. You should be greeted by the admin user creation page. Provide the admin user with a strong and unique password, then click Get Started. You are then on the Portainer CE main page (Figure A) where you can start deploying all the containers you need.

Figure A

Portainer has been deployed and is ready to use.

I’ve covered Portainer in quite some detail here on TechRepublic. Now that you have this outstanding GUI up and running, take a look at the Portainer articles I’ve previously written to keep you up to date on how to use the tool.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for the latest tech advice for business professionals from Jack Wallen.

Leave a Reply

Your email address will not be published. Required fields are marked *