{"id":1861,"date":"2025-06-27T13:11:09","date_gmt":"2025-06-27T10:11:09","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/running-containers-with-podman-on-upcloud-a-beginners-guide\/"},"modified":"2025-06-27T13:11:09","modified_gmt":"2025-06-27T10:11:09","slug":"running-containers-with-podman-on-upcloud-a-beginners-guide","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/running-containers-with-podman-on-upcloud-a-beginners-guide\/","title":{"rendered":"Running Containers with Podman on UpCloud: A Beginner\u2019s Guide"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Podman is a container engine that enables building, running, and managing containers. It is usually considered as an alternative to <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/running-containers-with-docker-on-upcloud-a-complete-guide\">Docker<\/a>, as they both provide similar functionalities for managing containers. However, they differ in their architecture and the way they run containers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The major difference between Podman and Docker is that Podman is daemonless, meaning that it doesn\u2019t use a daemon process to run your containers. Unlike Docker, which runs a background daemon that is responsible for starting and managing containers. This daemonless architecture makes Podman more lightweight and secure as it removes the overhead and reduces the attack surface associated with the daemon process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another core feature of Podman is its ability to run rootless containers. As the name suggests, rootless containers can run without root privileges, meaning that a normal user can start the container and work with it. This of course improves the security of the environment in a scenario where a malicious process escapes the container boundary, as it will still have limited permissions instead of root permissions on the host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we\u2019ll cover the basics of managing containers using Podman. We\u2019ll start by installing Podman on an <a href=\"https:\/\/upcloud.com\/global\/products\/cloud-servers\">UpCloud server<\/a>. Then we\u2019ll work with container images including pulling, pushing, and building custom images. Finally, we\u2019ll test running and accessing containers with Podman.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To follow along with this guide, you\u2019ll need to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create an <\/strong><a href=\"https:\/\/signup.upcloud.com\/\"><strong>UpCloud account<\/strong><\/a><strong>:<\/strong> This gives you access to different UpCloud services using the GUI control panel, <a href=\"https:\/\/upcloud.com\/global\/resources\/tools\/upcloud-command-line-interface\">command-line interface<\/a>, or the <a href=\"https:\/\/upcloud.com\/global\/resources\/tools\/category\/api-clients\">API<\/a>.<\/li>\n\n\n\n<li><a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/deploy-server\"><strong>Deploy a Cloud server on UpCloud<\/strong><\/a><strong>:<\/strong> This is going to be our host server where we\u2019ll install Podman and run our containers.<\/li>\n\n\n\n<li><strong>Create a <\/strong><a href=\"https:\/\/docs.docker.com\/accounts\/create-account\/\" target=\"_blank\" rel=\"noopener\"><strong>Docker hub account<\/strong><\/a><strong>:<\/strong> Docker hub is a centralized location for publishing and distributing container images. We\u2019ll use it in this guide to work with our image.<\/li>\n\n\n\n<li><strong>Familiarity with using the CLI:<\/strong> We\u2019ll be using some basic commands throughout this guide to install our tools, navigate project directories, and work with SSH.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Podman<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first step in our scenario is to install Podman on our UpCloud server. Podman is available in the default package repositories for most Linux distros. For this guide, we\u2019re using an Ubuntu image on our cloud server:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Update the package index.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Install Podman package from the default repositories.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt install -y podman<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Verify the Podman installation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the installation was successful the above command should show the podman version installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman version 4.9.3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4. Podman installation also includes some other utilities that enable working with container images. One very important utility is <a href=\"https:\/\/buildah.io\/\" target=\"_blank\" rel=\"noopener\">buildah<\/a>, which allows building OCI-compatible images. Verify that buildah is installed correctly with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">buildah --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output should show the version of buildah installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">buildah version 1.33.7 (image-spec 1.1.0-rc.5, runtime-spec 1.1.0)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Working with Images<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Podman provides CLI commands that are similar to their alternatives in Docker. It\u2019s a common practice for users who are familiar with Docker to <a href=\"https:\/\/www.man7.org\/linux\/man-pages\/man1\/alias.1p.html\" target=\"_blank\" rel=\"noopener\">alias<\/a> <strong><em>docker<\/em><\/strong> to <strong><em>podman<\/em><\/strong> which allows them to keep using the <strong><em>docker<\/em><\/strong> command as it is.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s check some of the common Podman commands used to work with container images:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>podman search:<\/strong> this command searches the specified registry for a matching image name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman search docker.io\/ubuntu<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command will search for ubuntu images in the docker registry. The output \u00a0 \u00a0 \u00a0 will be a list of the available images.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-179-1024x416.png\" alt=\"-\" class=\"wp-image-56348\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can limit the number of results from the command by using the <strong><em>&#8211;limit<\/em><\/strong> option<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman search --limit 5 docker.io\/ubuntu<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command will show only 5 results in the output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-180-1024x278.png\" alt=\"-\" class=\"wp-image-56351\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. <strong>podman pull:<\/strong> this command pulls the specified image from the registry to the local host, it\u2019s similar to the <strong><em>docker pull<\/em><\/strong> command in its function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman pull docker.io\/ubuntu<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command will download the layers of the <strong><em>ubuntu<\/em><\/strong> image from the docker registry<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXePXBKzrqdrZ8eSA6_JyjeNvWiV5gbbqNe1LOj368GlDxbOgjjK2-6dd4qLnNDYtd-gc1bszC74s9MjvuRx91oyLBKA_SShZa2kg37_zX4UbZ_bt-D5ncMEyy2MSFPnlHy_e_qShA?key=J_1mGh-bEOZgg6JdtSSYQA\" alt=\"-\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3. <strong>podman images:<\/strong> this command lists the images that are available locally on the host.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman images<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-181-1024x242.png\" alt=\"-\" class=\"wp-image-56354\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As we only pulled the <strong><em>ubuntu<\/em><\/strong> image previously, we can see it in the command output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. <strong>podman inspect:<\/strong> this command shows the metadata and related information about the image like its size, architecture, sha ID, and repository tag.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman inspect docker.io\/ubuntu<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command will print the detailed information about our ubuntu image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-182-1024x647.png\" alt=\"-\" class=\"wp-image-56356\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5. <strong>podman rmi:<\/strong> this command will delete the specified image from the local host. It will remove the image layers and its related data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman rmi docker.io\/ubuntu<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command will delete the ubuntu image from our cloud server. If we check the local images again using the <strong><em>podman images<\/em><\/strong> command we should see no images there.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-183-1024x290.png\" alt=\"-\" class=\"wp-image-56357\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Search Registries and Image Short Names<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the previous examples when we wanted to work with our <strong><em>ubuntu<\/em><\/strong> image we had to specify the fully qualified name of the image, meaning that we included the registry name which is <strong><em>docker.io<\/em><\/strong> followed by the image name which is <strong><em>ubuntu<\/em><\/strong>.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is because Podman doesn\u2019t have a default registry to search the images for, so we have to explicitly specify the registry where we need Podman to look for the image. This is unlike Docker which uses the docker registry as a default registry.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now instead of providing the fully qualified name of the image each time, which can become cumbersome especially if we\u2019re working with images from multiple registries, we can provide Podman with a list of registries to use when searching for images. We add this list to the configuration file at <strong><em>\/etc\/containers\/registries.conf<\/em><\/strong>, Podman will then search through this list of registries in the specified order.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can test this on our ubuntu image with the following steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. First let\u2019s try to pull the image with its short name only without adding the registry.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-184-1024x193.png\" alt=\"-\" class=\"wp-image-56358\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As we can see, we get an error which clearly states that we don\u2019t have any registries defined in the <strong><em>\/etc\/containers\/registries.conf<\/em><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Open the configuration file using a text editor and add the following line<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">unqualified-search-registries = ['docker.io']<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-185.png\" alt=\"-\" class=\"wp-image-56360\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong><em>unqualified-search-registries<\/em><\/strong> is the list of container registries that we want Podman to use in the specified order. Here we only provided the docker registry so it\u2019s the only registry that Podman will use to search for images.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Now let\u2019s try to pull the image again with its short name.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-186-1024x192.png\" alt=\"-\" class=\"wp-image-56361\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The image pull is now successful and we can see in the first line of the output that the image is resolved from the unqualified-search registries in the <strong><em>\/etc\/containers\/registries.conf<\/em><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Check that the list of registries is also used for other operations on images such as the search.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-187-1024x664.png\" alt=\"-\" class=\"wp-image-56364\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the above image, we only specified the short name of the <strong><em>centos<\/em><\/strong> image, and podman automatically retrieved the list of images from the <strong><em>docker.io<\/em><\/strong> registry which is configured in our <strong><em>\/etc\/containers\/registries.conf<\/em><\/strong> file.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">An important thing to take care of when using image short names is that the list of registries should be set in the correct order. If an image is located in two different registries with the same name the first registry in the list will be used, so you might be pulling a different image other than the one you actually need if you\u2019re not listing them in the correct order.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can test this with the following steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Open the <strong><em>\/etc\/containers\/registries.conf <\/em><\/strong>file and add another registry before the docker registry. Here I\u2019ll use the fedora registry which is <strong><em>registry.fedoraproject.org.<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-188-1024x279.png\" alt=\"-\" class=\"wp-image-56365\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. Now let\u2019s try to pull the <strong><em>fedora<\/em><\/strong> image with its short name.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-189.png\" alt=\"-\" class=\"wp-image-56366\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can see that Podman has selected the first registry in the list which is the fedora registry to pull the image from. So if you want to pull the image from the docker registry you have to either specify the fully qualified image name, or change the order of the registries in the list and use the image short name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Short Name Aliases<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Newer versions of Podman provide an additional technique to resolve image short names to their correct registry. It is achieved by <strong><em>aliasing<\/em><\/strong> the short name to its respective fully qualified name. These short name aliases are similar to command aliases in Linux where we set a specific shorthand for the command and assign it to our full command syntax.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, we can set <strong><em>ubuntu=docker.io\/ubuntu<\/em><\/strong> as an alias which will ensure that whenever we use the <strong><em>ubuntu<\/em><\/strong> short name it will resolve to the docker registry ubuntu image. These aliases take precedence over any configured registries in the <strong><em>registries.conf<\/em><\/strong> file. This can be helpful if we want to make sure that a specific image short name always resolves to a specific registry regardless of the configured registries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These aliases are added to a configuration file located at <strong><em>\/etc\/containers\/registries.conf.d\/shortnames.conf, <\/em><\/strong>and there\u2019s a default list of aliases that is included with the Podman installation and is maintained for the community in <a href=\"https:\/\/github.com\/containers\/shortnames\/blob\/main\/shortnames.conf\" target=\"_blank\" rel=\"noopener\">this github repository<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s try to use these aliases with our previous <strong><em>fedora<\/em><\/strong> image to pull it from the docker registry instead of the fedora registry:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Open the configuration file at <strong><em>\/etc\/containers\/registries.conf.d\/shortnames.conf <\/em><\/strong>and add the following line under the <strong>[aliases]<\/strong> section.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\"fedora\" = \"docker.io\/library\/fedora\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-190-1024x505.png\" alt=\"-\" class=\"wp-image-56368\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. Save the file and then try to pull the image with its short name.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-192-1024x309.png\" alt=\"-\" class=\"wp-image-56371\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can see in the output that the image short name was resolved to the docker.io registry image using the alias in the <strong><em>shortnames.conf<\/em><\/strong> file. Although the fedora registry is still listed before the docker registry in the <strong><em>registries.conf<\/em><\/strong> file:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-193-1024x272.png\" alt=\"-\" class=\"wp-image-56373\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Which means that the alias took precedence over the configured registries list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Building Custom Images<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We can also use Podman to build our own container images that contain our applications, just like we can build images with Docker. As we mentioned previously, Podman relies on buildah for building the images, which comes included by default with the Podman installation, but you can also <a href=\"https:\/\/github.com\/containers\/buildah\/blob\/main\/install.md\" target=\"_blank\" rel=\"noopener\">install it separately on your machine<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are multiple ways we can build images with buildah, but the most common one especially for users who are familiar with Docker is to use a Dockerfile. The Dockerfile is a text file that contains instructions for building the image.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We already have a sample application with a Dockerfile that we can use from <a href=\"https:\/\/github.com\/Amr-tmorot\/Flask-sample-app\/\" target=\"_blank\" rel=\"noopener\">this github repo<\/a>. Let\u2019s build a container image for this app with the following steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Check if Git is installed on the cloud server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">git --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If Git is installed correctly the output will show its version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">git version 2.43.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If Git is not installed on the server, you can <a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Getting-Started-Installing-Git\" target=\"_blank\" rel=\"noopener\">install it using the distro\u2019s package manager<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt install git-all<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Clone the repository to the cloud server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">git clone https:\/\/github.com\/Amr-tmorot\/Flask-sample-app.git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Change directory to the repository folder and check that the app source code and Dockerfile are there.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">cd Flask-sample-app\/\nls <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-194.png\" alt=\"-\" class=\"wp-image-56376\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4. Build the container image using Podman.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman build .<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command will use the instructions inside the Dockerfile to build the image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-195-1024x509.png\" alt=\"-\" class=\"wp-image-56377\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Take note of the image ID at the end of the output as we\u2019ll use it later to tag the image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-196-1024x578.png\" alt=\"-\" class=\"wp-image-56378\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5. Now that the image is built successfully, we need to push it to a centralized image registry instead of just having it locally on the cloud server. We\u2019ll use Docker hub as our image registry.<br><br><a href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noopener\">Login with your Docker hub account<\/a> and create a new repository for the image:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-197-1024x512.png\" alt=\"-\" class=\"wp-image-56380\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">6. To be able to push the image to the repository, we need to tag it first with the correct fully qualified name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman tag [image ID] docker.io\/[username]\/[repo]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the <strong><em>image ID<\/em><\/strong> with the ID we got from the output of the build command, <strong><em>username<\/em><\/strong> with your Docker hub username, and <strong><em>repo<\/em><\/strong> with the repository name that you created.<br><br>If you list the images now on the server you should see the image with the new tag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-198-1024x100.png\" alt=\"-\" class=\"wp-image-56384\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">7. Login to your Docker hub account from the command line using Podman.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman login docker.io<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-199.png\" alt=\"-\" class=\"wp-image-56386\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">8. Push the image to the repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman push docker.io\/[username]\/[repo]<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-200-1024x529.png\" alt=\"-\" class=\"wp-image-56387\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">9. Verify that the image is pushed to the repository from the Docker hub GUI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-201-1024x811.png\" alt=\"-\" class=\"wp-image-56390\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Running a Container From the Image<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we\u2019ve built our image and pushed it to the registry, the next step is to start a container from it to run our application. Again, Podman also provides a simple command similar to its equivalent in Docker to run a container from an image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">podman run -p 5000:5000 docker.io\/[username]\/[repo]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong><em>podman run<\/em><\/strong> command starts the container process, the <strong><em>-p<\/em><\/strong> option publishes a port from inside the container to a port on the local host, here we use <strong><em>port 5000<\/em><\/strong> which is our application port that is specified in the source code:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-202-1024x518.png\" alt=\"-\" class=\"wp-image-56392\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Finally we provide the fully qualified name of the image to the command. You should see the container started and showing the logs in the output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-203-1024x400.png\" alt=\"-\" class=\"wp-image-56393\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To test accessing the application, we can use a simple curl command from inside the cloud server using the localhost address and the application port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">curl localhost:5000<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-204.png\" alt=\"-\" class=\"wp-image-56394\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can also try to access it from a browser using the cloud server public IP address:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-205.png\" alt=\"-\" class=\"wp-image-56396\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Our application container is now running and responding to requests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Podman is a lightweight and secure open source tool for running and managing containers. It provides a CLI interface with similar commands to their Docker alternatives which makes interacting with containers and container images easy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This similarity in the command line interface makes Podman and Docker look the same on the surface, however, they differ fundamentally in their architecture and the way they run containers. Unlike Docker, Podman is daemonless so it doesn\u2019t rely on a long-running daemon process to manage containers. Additionally, Podman supports running rootless containers by default, which improves the security of the environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we covered the steps for running containers using Podman. We started by installing Podman on an UpCloud cloud server, then we explored the common Podman commands to work with container images. Next, we explained how to configure image registries and use image short names and aliases. Finally, we used Podman to build a custom container image and start a container from it on our server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Want to deploy your containerized workloads in the Cloud? <a href=\"https:\/\/signup.upcloud.com\/\">Try UpCloud<\/a> now and get your server infrastructure ready within seconds to run your containers.<\/p>\n","protected":false},"author":85,"featured_media":56403,"comment_status":"open","ping_status":"closed","template":"","community-category":[223],"class_list":["post-1861","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=1861"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1861\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=1861"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=1861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}