Linux Containers | Podman Desktop: Instalación y primeros pasos

3 min read 1 year ago
Published on Jan 25, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial provides a step-by-step guide on how to install Podman Desktop on Linux and start creating containers. Podman is a powerful tool for managing containers, and knowing how to use it effectively can enhance your development workflow.

Step 1: Install Podman Desktop

  1. Update Your System

    • Before installing Podman, ensure your package manager is up to date. Open your terminal and run:
      sudo apt update
      sudo apt upgrade
      
  2. Install Podman

    • Install Podman using your package manager. For Debian-based systems, you can use:
      sudo apt install podman
      
    • For Fedora or Red Hat-based systems, use:
      sudo dnf install podman
      
  3. Verify Installation

    • Check if Podman is installed correctly by running:
      podman --version
      
    • You should see the installed version of Podman if the installation was successful.

Step 2: Setting Up Podman Desktop

  1. Install Podman Desktop

    • Download the Podman Desktop application from the official website or your distribution's software center.
    • Follow the installation prompts to complete the setup.
  2. Launch Podman Desktop

    • Open the Podman Desktop application from your applications menu.
  3. Configure Podman Desktop

    • Upon first launch, you may need to configure settings such as the default storage directory and network options. Follow the on-screen instructions to complete the configuration.

Step 3: Create Your First Container

  1. Open Terminal

    • While you can manage containers through the Podman Desktop GUI, using the terminal is often more flexible.
  2. Run a Test Container

    • To ensure everything is working, run a simple test container. For example, you can run an Alpine Linux container:
      podman run -it alpine /bin/sh
      
    • This command pulls the Alpine image (if not already pulled) and opens an interactive shell within the container.
  3. Exit the Container

    • Type exit to leave the container's shell.

Step 4: Manage Containers

  1. List Containers

    • To see all running and stopped containers, use:
      podman ps -a
      
  2. Remove a Container

    • If you need to remove a container, first stop it (if it's running) using:
      podman stop <container_id>
      
    • Then remove it with:
      podman rm <container_id>
      
  3. Pull Images

    • To pull other images, use:
      podman pull <image_name>
      

Conclusion

You have successfully installed Podman Desktop on your Linux system and created your first container. By following these steps, you can now explore containerization further, experiment with different images, and manage your containers effectively. As a next step, consider diving deeper into networking and volume management in Podman to expand your containerization skills.