- Lab
 - 
                        Libraries: If you want this lab, consider one of these libraries.
 - Cloud
 
Manage Podman Containers Using Cockpit on RHEL
Cockpit is an easy-to-use, web-based system management tool for Linux servers that can manage Podman containers with the cockpit-podman plugin. In this lab, we will install Cockpit and the cockpit-podman plugin and will use Cockpit to manage Podman containers. Upon completion of this lab, you will be able to configure a Cockpit installation and use it to manage your Podman containers.
Lab Info
Table of Contents
- 
                
                
Challenge
Install Cockpit and the 'container-tools' Module
Perform the following:
- 
Install the
container-toolsapplication stream. - 
Install
cockpit. - 
Use
enableandstartthecockpit.socketsocket usingsystemctl. - 
Now we can connect to the Cockpit web console on port
9090. Let's log in ascloud_user. - 
You'll notice that we get a message that the "Podman service is not active." Let's start it.
 
Now that we're good to go, we see that we have no containers or images. Let's change that!
 - 
 - 
                
                
Challenge
Use Cockpit to Download Container Images
Connect to the Cockpit web console. Let's log in as
cloud_user.Let's take a look at the tab for the Podman containers plugin.
You'll notice that we get a message that the "Podman service is not active." Let's start it.
First, let's grab some images. We'll grab the following:
wordpress(from docker.io/library/wordpress)mariadb(from docker.io/library/mariadb)
Let's use our images to start some containers!
 - 
                
                
Challenge
Start a WordPress Container Instance Using Cockpit
We're going to start a WordPress installation, using two containers:
Start a
mariadbcontainer:- Name the container 
wp-db. - Publish port 
3306in the container to port3306on the host. - Use the 
mariadbcontainer image. - Set the following variables:
- MYSQL_ROOT_PASSWORD="dbpass"
 - MYSQL_DATABASE="wp"
 - MYSQL_USER="wordpress"
 - MYSQL_PASSWORD="wppass"
 
 
Start a WordPress container:
- Name the container 
wp-web. - Publish port 
80in the container to port8080on the host. - Use the 
wordpresscontainer image. - Set the following variables:
- WORDPRESS_DB_NAME="wp"
 - WORDPRESS_DB_USER="wordpress"
 - WORDPRESS_DB_PASSWORD="wppass"
 - WORDPRESS_DB_HOST="enter the private IP address of host"
 
 
Now that our containers are up and running, let's test them!
 - Name the container 
 - 
                
                
Challenge
Test Our WordPress Installation and Clean Up!
Let's try connecting to our WordPress installation using the external DNS or IP address of our server and port
8080.You should get the WordPress setup page. When you're done testing, clean up all the containers and images.
Great work, Cloud Guru! You stood up a WordPress instance using Cockpit and the Podman plugin!
 
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.