VOOZH about

URL: https://thenewstack.io/deploy-a-pod-on-centos-with-podman/

⇱ Deploy a Pod on CentOS with Podman - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-01-21 10:52:44
Deploy a Pod on CentOS with Podman
tutorial,

Deploy a Pod on CentOS with Podman

How to deploy containers on CentOS using Podman, a Docker alternative.
Jan 21st, 2020 10:52am by Jack Wallen
👁 Featued image for: Deploy a Pod on CentOS with Podman

If you’ve been following along in the open source news cycle lately, you’ve probably heard that Red Hat has dropped the docker container runtime engine from both its Red Hat Enterprise Linux (RHEL) and CentOS Linux distributions. That being the case, what do you do when you need to deploy containers? Fortunately, they’ve created a near drop-in replacement for docker, called Podman.

Podman is very similar to docker. Even the command structure is similar. However, under the hood, things are quite different. For example, instead of relying on a daemon, Podman deploys containers as their own child process.

Because its developers went this route, Podman had to have the ability for containers to operate together (otherwise the Podman system wouldn’t be very useful). Imagine, only being able to deploy a single container without other, interconnected containers (such as a WordPress container with a MySQL database). That solution is pods. Pods are a way to group containers such that they can operate together.

I’m going to walk you through the process of deploying a pod with Podman on CentOS 8.

What You’ll Need

The only thing you’ll need to deploy a pod with Podman is a running instance of CentOS 8 with Podman installed.

Creating a Pod

The first thing we’ll do is create a pod. The basic command structure is:

podman pod create

If you run the command without any arguments, it will create a pod with a random name. You might, however, want to give your pod a meaningful name. You could name your pod based on the function of the containers it will house, or a client, etc. Say, for instance, I want to deploy a pod named new_stack. That command would be:

podman pod create --name new_stack

The pod will be created and will report back to you the ID of the pod (Figure 1).

👁 Image

Figure 1: Our new pod, named new_stack, has been created.

There are other options you can use with the podman command. Those options are:

  • –cgroup-parent value — Set the parent cgroup for the pod.
  • –infra — Create an infra container associated with the pod that will share namespaces.
  • –infra-command value — A command that will automatically run on the infra container when the pod is started (such as “/pause”).
  • –infra-image value — The infra container image to be associated with the pod.
  • –label value — Set the metadata for a pod.
  • –label-file value — Set the metadata for a pod using a line-delimited file of labels.
  • –pod-id-file value — Write the pod ID to a file.
  • –publish value — Publish a container’s port (or a range of ports) to the host.
  • –share value — A comma-delimited list of kernel namespaces to be shared.

We can view our newly created pod with the command:

podman pod list

This will show our newly created pod running, as well as its ID, name, status, and more (Figure 2).

👁 Image

Figure 2: Our newly created pod has been deployed.

In the pod details, you probably noticed that it already includes one container. But we have yet to deploy a container to the pod. What gives? This random container is an infra container. Every podman pod includes this infra container. These containers do nothing but go to sleep. Their purpose is to hold the namespaces associated with the pod and to allow Podman to connect other containers to the pod. The other purpose of the infra container is to allow the pod to keep running when all associated containers have been stopped.

To view the infra container, issue the command:

podman ps -a --pod

You should see any running pods, including the infra pod (Figure 3), which will be labeled as -infra.

👁 Image

Figure 3: Our infra pod is 50bca5875229-infra.

Add a Container

For our next trick, we’ll add a container to the newly deployed pod. Remember, we named that pod new_stack. That’s important, as you’ll need that name in order to deploy containers to that pod. We’ll use the official ubuntu image and deploy a container using it running the top command. This isn’t a very useful example, but it’s simple enough to show you how containers are deployed to pods. That command would be:

podman run -dt --pod new_stack ubuntu top

You will be returned with the container ID (Figure 4).

Figure 4

👁 Image

Figure 4: We’ve successfully deployed our container.

We can now check to see that our pod has more than one container with the command:

podman pod ps

Our new_stack pod now has two containers (the Infra container and the Ubuntu container running the top command — Figure 5).

👁 Image

Figure 5: Our pod now has two containers.

You can also view the individual containers within a pod with the command:

podman ps -a --pod

You’ll notice that Podman assigned a random name to the Ubuntu top container (in this case, fervent_jones — Figure 6).

👁 Image

Figure 6: All of the currently running containers.

All in One

Podman has a nifty trick up its sleeve in that it can create a pod and deploy a container to said pod with a single command. Let’s say you want to deploy an NGINX container, exposing external port 8080 to internal port 80 to a new pod named web_server. That command would be:

podman run -dt --pod new:web_server -p 8080:80 nginx

Check to see that your new pod was created with the command:

podman pod list

You should now see the web_server pod listed (Figure 7).

👁 Image

Figure 7: Our new web_server pod has been created and includes two containers.

Stopping Pods

Let’s stop our pods (and all of their associated containers). In order to do this, you need to find the name of the pods to be stopped. Issue the command:

podman pod list

You should see a list of running pods, in the same fashion as you saw before. However, to stop the pods (and all of its associated containers), you must use the INFRA ID with the command:

podman stop ID

Where ID is the INFRA ID for the pod in question.

You can then restart the pod (and its associated containers) with the command:

podman start ID

And that’s the fundamentals of using pods with Podman. You are now ready to deploy containers within pods on RHEL or CentOS 8.

TRENDING STORIES
Jack Wallen is what happens when a Gen Xer mind-melds with present-day snark. Jack is a seeker of truth and a writer of words with a quantum mechanical pencil and a disjointed beat of sound and soul. Although he resides...
Read more from Jack Wallen
SHARE THIS STORY
TRENDING STORIES
Red Hat is a sponsor of The New Stack.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.