Podman is a powerful containerization tool that allows you to run and manage containers on your Rocky Linux 8 system. In this article, we will guide you through the process of installing Podman on your Rocky Linux 8 server. By following these steps, you will be able to set up Podman and start using it to deploy and manage containers.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A server or virtual machine running Rocky Linux 8.
- SSH access to your Rocky Linux 8 server with root privileges.
Step 1: Update System Packages
Before installing any new software, it’s always a good idea to update your system packages to ensure you have the latest security patches and bug fixes. You can do this by running the following command:
sudo dnf update -y
Step 2: Install Podman
Once your system is up to date, you can proceed with the installation of Podman. Podman can be easily installed using the dnf package manager. Run the following command to install Podman:
sudo dnf install podman -y
This command will download and install the Podman package along with its dependencies. After the installation is complete, you will have Podman ready to use on your Rocky Linux 8 server.
Step 3: Searching for Podman Images
Podman allows you to search for container images from various sources. To search for a specific image, use the podman search command followed by your search term. For example, to search for an image related to Apache HTTP Server, you can run the following command:
podman search apache
This will display a list of available images related to Apache. You can choose the image that best suits your needs based on the repository, tags, and other information provided.
Step 4: Pulling an Image with Podman
Once you have identified the image you want to use, you can pull it onto your Rocky Linux 8 server using the podman pull command. For example, to pull the latest version of the Apache HTTP Server image, you can run the following command:
podman pull docker.io/library/httpd
This command will download the specified image from the Docker Hub repository. The image will be stored locally on your server and can be used to create and run containers.
Step 5: Running a Podman Container
After pulling the image, you can run a container based on that image using the podman run command. For instance, to run a container based on the Apache HTTP Server image, use the following command:
podman run -dt -p 8080:80/tcp docker.io/library/httpd
This command will create a new container based on the specified image and start it in the background. The container will be accessible on port 8080 of your Rocky Linux 8 server, mapping it to the default port 80 of the container.
Step 6: Listing Containers and Their Status
To check the status of running containers and get information about them, you can use the podman ps command. Running the command without any options will display a list of running containers, including their container IDs, images, commands, and other details. For example:
podman ps
This command will show you a table with information about the currently running containers on your Rocky Linux 8 server.
|
CONTAINER ID |
IMAGE |
COMMAND |
CREATED |
STATUS |
PORTS |
NAMES |
|---|---|---|---|---|---|---|
|
f65b60527755 |
docker.io/library/httpd |
httpd-foreground |
8 seconds ago |
Up 7 seconds |
0.0.0.0:8080->80/tcp |
thirsty_goldberg |
In the table above, you can see the container ID, the image it is based on, the command used to start the container, the creation time, the current status, and the ports mapped to the container.
Conclusion
Congratulations! You have successfully installed Podman on your Rocky Linux 8 server and learned how to search for and pull container images, as well as how to run and manage containers using Podman. With Podman, you can easily deploy and manage containers, allowing you to streamline your development and deployment processes.
Remember to regularly update your system packages to ensure you have the latest security patches and bug fixes. If you encounter any issues or have any questions, refer to the official Podman documentation for more information and troubleshooting steps.
For more information on containerization and other hosting services, you can check out Shape.host, a leading provider of Cloud VPS solutions.