---
title: "Leverage Podman for Windows to Efficiently Manage Containers"
description: "Discover how Podman for Windows can quickly and efficiently help you manage OCI containers from the command-line!"
canonical: "https://adamtheautomator.com/podman-for-windows/"
---

# Leverage Podman for Windows to Efficiently Manage Containers

> Discover how Podman for Windows can quickly and efficiently help you manage OCI containers from the command-line!

Source: https://adamtheautomator.com/podman-for-windows/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Leverage Podman for Windows to Efficiently Manage Containers](https://adamtheautomator.com/wp-content/uploads/2022/08/Leverage-Podman-for-Windows-to-Efficiently-Manage-Containers.jpg)

# Leverage Podman for Windows to Efficiently Manage Containers

[![](https://secure.gravatar.com/avatar/8faede4598d8316b819be489b8c36cfc39229043f8b167907c5e30547995a4da?s=192&d=mm&r=g)Fredrick Emmanuel](https://adamtheautomator.com/author/fredrick-emmanuel/)2 September 20225 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Docker](/tag/docker/)[Podman](/tag/podman/)[Windows](/tag/windows/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the Podman for Windows Application](#installing-the-podman-for-windows-application)
*   [Setting up a NodeJS Application](#setting-up-a-nodejs-application)
*   [Building a Custom Image](#building-a-custom-image)
*   [Setting up Podman’s Search Registry](#setting-up-podmans-search-registry)
*   [Starting a Container in Podman Windows](#starting-a-container-in-podman-windows)
*   [Conclusion](#conclusion)

Finding Docker tiresome and want to try another? No doubt, Docker works great in containerizing applications. But if you’re looking for a more lightweight tool without compromising efficiency, consider the [Podman](https://podman.io/) for Windows application.

Containerized applications have been growing more complex. As a developer, you’ll need tools to help you manage containers effectively. And in this tutorial, you’ll learn how to leverage Podman Windows for container management.

Don’t let Podman stand long in Docker’s shadow, and start managing containers with this deamonless tool!

## Prerequisites

This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have the following.

*   A Windows system greater than Windows 10 version 1903 with Build 18362.
*   A Linux system installed as a subsystem – This tutorial uses [WSL](https://adamtheautomator.com/windows-subsystem-for-linux/) v2 with Kali Linux, but any Linux distro works.

Related:[The Ultimate Guide to Windows Subsystem for Linux (Windows WSL)](https://adamtheautomator.com/windows-subsystem-for-linux/)

## Installing the Podman for Windows Application

Podman is a container engine developed by Red Hat for building, managing, running, and deploying containers without a daemon.

With the absence of a daemon:

*   Podman is a lightweight container engine compared to Docker, which benefits users with low-end computers.
*   Prevents users from having root privileges to the server, increasing security.

But before taking advantage of the Podman Windows application, you’ll have to install this tool on your Windows machine.

1\. Launch the Kali Linux app (or any other distro app you installed, like Ubuntu), which opens a terminal.

Enter your username and password to log in, and you’ll get an output similar to the one below.

![Logging in to Kali Linux](https://adamtheautomator.com/wp-content/uploads/2022/08/image-552.png)

Logging in to Kali Linux

2\. Next, run the [apt-get update](https://www.cyberciti.biz/faq/what-does-sudo-apt-get-update-command-do-on-ubuntu-debian/) command to update package information from all configured sources.

```bash
sudo apt-get -y update
```

![Updating system package information](https://adamtheautomator.com/wp-content/uploads/2022/08/image-553.png)

Updating system package information

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

3\. Next, run the following apt-get install command to install podman.

```bash
sudo apt-get -y install podman
```

![Installing Podman](https://adamtheautomator.com/wp-content/uploads/2022/08/image-554.png)

Installing Podman

Related:[How to Install and Use Podman (Docker Alternative)](https://adamtheautomator.com/podman/)

4\. Lastly, run the below podman command to check the version of Podman installed.

```bash
podman version
```

The latest version of Podman as of this writing is 3.4.7, as shown below.

![Checking Podman’s installed version](https://adamtheautomator.com/wp-content/uploads/2022/08/image-555.png)

Checking Podman’s installed version

## Setting up a NodeJS Application

You’ve just installed the Podman Windows application, but how do you know it actually works? Setting up an application is the most suitable way to test Podman, in this case, a NodeJS application.

To set up a NodeJS application:

1\. Run each command below to create a new directory (mkdir), and switch to that directory (cd). This directory will contain all the project files you’ll create for your NodeJS application in this tutorial.

Note that you can name the directory differently, but this tutorial’s choice is _Podman._

```bash
mkdir Podman
cd Podman
```

2\. Create a file called _server.js_ with your preferred text editor.

3\. Add the following code to the _server.js_ file, save the changes and close the file.

The code below is the source for your NodeJS application, which creates an express GET route to /. Once added, save the changes and close the file.

```javascript
//Importing and creating an instance of express
const express = require("express");
const app = express();

//Setting PORT to 5000.
const PORT = 5000;

// Creating the `GET` route
app.get("/", (req, res) => {
  res.send("<h2>Welcome Friends</h2>");
});

//Starting the express server
app.listen(PORT, () =>
  console.log(`Server running on port ${PORT}`)
);
```

4\. Lastly, create another file called _package.json_, and add the following code to the file. This file initializes your NodeJS application and installs express as a dependency.

Change some values in the code below, like for the author or the description, as you prefer. Once changed, save the changes and close the file.

```json
{
  "name": "podman",
  "version": "1.0.0",
  "description": "Podman for Windows",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "keywords": [],
  "author": "Fredrick Emmanuel",
  "license": "ISC",
  "dependencies": {
    "express": "^4.18.1"
  }
}
```

## Building a Custom Image

Now that you have created an express application, the next step is to build a customized Image. A customized image allows you to add your source code to the image and the configurations for your image.

Building a custom image in Podman demands a _Containerfile_ or a _Dockerfile_. By default, Podman uses _Containerfile_ to build a custom image.

> _This tutorial uses a Containerfile to demonstrate how custom images are created in Podman, but the commands also work with a Dockerfile._

Create a new file named _Containerfile_, populate the code below, save, and close the file.

The following code creates a custom image using node:[18-alpine3.15](https://github.com/nodejs/docker-node/blob/6249a0b2a460b010c9ee216c8ab81ea8c698ab07/18/alpine3.15/Dockerfile) (a lightweight NodeJS) as the base image.

```docker
# Sets the base image of the application to the node alpine's official image.
FROM node:18-alpine3.15
# Sets the Working Directory as "/server"
WORKDIR /server
# Copies the package.json file into "/server" and runs npm i
COPY package.json /server
RUN npm i
# Copies the entire source code into "/server"
COPY . /server
# Specifies the port the node app will be running on
EXPOSE 5000
# Runs "node server.js" after the above step is completed
CMD ["node", "server.js"]
```

Now, run the podman build command below to build a customized image called (-t) podman with a tag latest in your working directory (.).

```bash
podman build . -t podman:latest
```

As you can see below, Podman Windows pulls the **node:18-alpine3.15** base image from Docker’s registry.

![Building a custom image](https://adamtheautomator.com/wp-content/uploads/2022/08/image-556.png)

Building a custom image

## Setting up Podman’s Search Registry

Unlike Docker, Podman searches for images in various registries like Docker Hub, [Quay.io](https://quay.io/), Red Hat, and many other registries.

To specify the registry to search first before searching others:

Open the the registry configuration file for Podman (_/etc/containers/registries.conf_) in your text editor. Editing the configuration file needs administrative privilege, so provide your password when prompted.

The configuration file should be like the one below.

![Opening the registry configuration file](https://adamtheautomator.com/wp-content/uploads/2022/08/image-557.png)

Opening the registry configuration file

Now, add the following line to the registry configuration file to specify the search chain. Feel free to edit the search configuration to your taste, save the changes and close the file.

The code below configures Podman to search for images in [registry.fedoraproject.org](http://registry.fedoraproject.org/) before searching other registries.

```bash
unqualified-search-registries = ['registry.fedoraproject.org', 'registry.access.redhat.com', 'registry.centos.org', 'docker.io']
```

![Specifying the search chain in the registry configuration file](https://adamtheautomator.com/wp-content/uploads/2022/08/image-558.png)

Specifying the search chain in the registry configuration file

## Starting a Container in Podman Windows

You’ve just created a custom image and configured Podman’s search registry. But this tutorial would be for nothing if the resources you set up don’t work.

Now, there’s only one thing left to accomplish, starting up the container using the custom image you created.

1\. Execute the [podman run](https://docs.podman.io/en/latest/markdown/podman-run.1.html) command below to start a container with the podman:latest custom image on port 5000 (-p 5000:5000) in detach mode (-d).

```bash
podman run -p 5000:5000 -d podman:latest
```

On the output below, the command returns the ID of the container.

![Starting a container with a custom image](https://adamtheautomator.com/wp-content/uploads/2022/08/image-559.png)

Starting a container with a custom image

2\. Next, run the following [podman ps](https://docs.podman.io/en/latest/markdown/podman-ps.1.html) command to ensure the container runs.

```bash
podman ps
```

Below, you can see the container is running (Up).

![Verifying the container is running](https://adamtheautomator.com/wp-content/uploads/2022/08/image-14.jpeg)

Verifying the container is running

3\. Finally, run the curl command below to ping the container.

```bash
curl localhost:5000
```

You can see that the output below returns the Welcome Friends message you specified in your NodeJS application. This output indicates your container is working correctly.

![Pinging the container](https://adamtheautomator.com/wp-content/uploads/2022/08/image-560.png)

Pinging the container

Related:[Essential CURL API Commands for Testing & Troubleshooting](https://adamtheautomator.com/curl-api/)

## Conclusion

Container orchestration tools, like Podman Windows, are just one of the essential web development technologies today. And in this tutorial, you’ve learned how to leverage Podman for Windows and manage containers so that you can package and deploy software to your servers.

Do you think Podman is a suitable alternative to Docker? Try building a more complex app to get the answer!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpodman-for-windows%2F&text=Leverage%20Podman%20for%20Windows%20to%20Efficiently%20Manage%20Containers)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpodman-for-windows%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpodman-for-windows%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2022/09/Getting-Started-with-Docker-Rancher-Desktop.jpg)

### [Getting Started with Docker Rancher Desktop](/docker-rancher/)

Learn how to get started with the Docker Desktop alternative, Docker Rancher Desktop in this ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/2024/04/idfix.jpg)

### [Solve Azure AD Connect Errors via the Microsoft IdFix Tool](/idfix/)

Fix Azure AD Connect errors fast with the Microsoft IdFix tool—your go-to solution for seamless synchronization and efficient directory management!

![](https://adamtheautomator.com/wp-content/uploads/2024/04/sandboxie.jpg)

### [How to Install Sandboxie on Windows](/sandboxie/)

Secure your Windows system with Sandboxie. Learn how to install this tool hassle-free and safeguard your digital activities!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
