Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Use Podman to Create Persistent systemd Containers and Pods on RHEL

Podman has the ability to generate systemd unit files, making quick work of configuring systemd containers. In this lab, we will examine how to use Podman to generate systemd unit files from existing Podman containers and configure these containers for persistence. Upon completion of this lab, you will be able to configure your Podman containers and pods as persistent systemd containers and pods.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 16, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Start Our WordPress Pod

    We’re going to stand up a WordPress instance in a pod.

    Perform the following tasks as cloud_user:

    • Check for existing rootless containers and pods.
    • Start by creating our pod. Remember, we want to publish port "80" in the pod to "8080" on the host. We want to name the pod "wp-pod".
    • Check again for pods and containers. You should see your Infra container.
    • Start the mariadb container.
      • Name the container "wp-db".
      • Add the container to the wp-pod pod.
      • Set --restart=always.
      • Use the "mariadb" short name for the container image.
      • Set the following variables
        • MYSQL_ROOT_PASSWORD="dbpass"
        • MYSQL_DATABASE="wp"
        • MYSQL_USER="wordpress"
        • MYSQL_PASSWORD="wppass"
    • Check for containers again.
    • Next, we'll start the WordPress container
      • Name the container "wp-web".
      • Add the container to the wp-pod pod.
      • Set --restart=always.
      • Use the "wordpress" short name for the container image
      • Set the following variables
        • WORDPRESS_DB_NAME="wp"
        • WORDPRESS_DB_USER="wordpress"
        • WORDPRESS_DB_PASSWORD="wppass"
        • WORDPRESS_DB_HOST="127.0.0.1"
    • Check for containers and pods again.
    • Check connectivity with a curl command on localhost:8080. You won't get anything back. Check the exit code immediately. It should be 0. If you'd like to try connecting with a web browser on the lab server's public IP, on port 8080, you can.Let's generate systemd unit files for our wp-pod pod!

    Perform the following:

    • Create the ~/.config/systemd/user directory.
    • Change directory to the new directory.
    • Generate our systemd unit files from our running pod.
    • Take a look at our unit files.
    • Stop and remove all pods.
    • Check again for containers and pods.
  2. Challenge

    Generate Our systemd Unit Files

    Let's generate systemd unit files for our wp-pod pod!

    Perform the following:

    • Create the ~/.config/systemd/user directory.
    • Change directory to the new directory.
    • Generate our systemd unit files from our running pod.
    • Take a look at our unit files.
    • Stop and remove all pods.
    • Check again for containers and pods.
  3. Challenge

    Enable and Start Our WordPress Pod Using systemd

    We're going to enable and start our wp-pod pod using systemd.

    Perform the following:

    • Reload systemd as a non-root user (cloud_user) to pick up the new unit.
    • Enable and start the container service as a non-root user.
    • Check the status of our new systemd WordPress pod.
    • Check for containers and pods again.
    • Check connectivity with a curl command on localhost:8080. You won't get anything back. Check the exit code immediately. It should be 0. If you'd like to try connecting with a web browser on the lab server's public IP, on port 8080, you can.
  4. Challenge

    Make Our WordPress Pod Persistent

    We're going to configure our container to start when the system boots.

    Perform the following:

    • Check to see if linger is enabled for cloud_user
    • Enable linger for cloud_user.
    • Check to see if linger is enabled for cloud_user again
  5. Challenge

    Test Persistence

    Let's test our persistent setup for our wp-pod pod!

    Perform the following:

    • Reboot to test our pod for persistence.
    • Check for containers and pods again.
    • Check connectivity with a curl command on localhost:8080. You won't get anything back. Check the exit code immediately. It should be 0. If you'd like to try connecting with a web browser on the lab server's public IP, on port 8080, you can.

    Congratulations, Cloud Guru! You just created a persistent systemd pod!

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

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.

Get started with Pluralsight