{"id":13123,"date":"2022-06-11T08:36:01","date_gmt":"2022-06-11T05:36:01","guid":{"rendered":"https:\/\/kifarunix.com\/?p=13123"},"modified":"2024-03-09T15:18:26","modified_gmt":"2024-03-09T12:18:26","slug":"install-portainer-on-rocky-linux","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-portainer-on-rocky-linux\/","title":{"rendered":"Install Portainer on Rocky Linux"},"content":{"rendered":"\n

In this tutorial, you will learn how to install Portainer on Rocky Linux. Portainer<\/a> is a self-service container service delivery platform that provides container management GUI for Kubernetes, Docker and Swarm<\/em>.<\/p>\n\n\n\n

Install Portainer on Rocky Linux<\/h2>\n\n\n\n

Portainer is available as both Community Edition and Business Edition. We will be installing the Community Edition in this guide.<\/p>\n\n\n\n

There are different environments in which you can deploy Portainer;<\/p>\n\n\n\n

    \n
  1. Standalone Docker container<\/li>\n\n\n\n
  2. Docker Swarm<\/li>\n\n\n\n
  3. Kubernetes<\/li>\n<\/ol>\n\n\n\n

    We will learn how to install Portainer as a standalone Docker container.<\/p>\n\n\n\n

    You can also check how to setup Portainer with SSL certificates by following the link below;<\/p>\n\n\n\n

    Setup Portainer with SSL Certificates<\/a><\/p>\n\n\n\n

    Install Docker on Rocky Linux<\/h3>\n\n\n\n

    To begin with, you need to install Docker on Rocky Linux by running the commands below;<\/p>\n\n\n\n

    dnf config-manager --add-repo=https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/code><\/pre>\n\n\n\n

    Disable container-tools module which provides runc which conflicts with podman\/containerd.io<\/p>\n\n\n\n

    dnf -y module disable container-tools<\/code><\/pre>\n\n\n\n

    Then install Docker ce on Rocky Linux.<\/p>\n\n\n\n

    dnf install docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n\n\n\n

    Start and enable Docker to run on system boot;<\/p>\n\n\n\n

    systemctl enable --now docker<\/code><\/pre>\n\n\n\n

    Create Portainer Server Docker Data Volume<\/h3>\n\n\n\n

    Once the Docker is in place, it is now time to deploy Portainer on Rocky Linux.<\/p>\n\n\n\n

    To begin with, you need to create Portainer server data volume. Please note that Portainer requires persistent storage<\/a> in order to maintain the database and configuration information it needs to function<\/em>.<\/p>\n\n\n\n

    You can create a Docker volume using the command;<\/p>\n\n\n\n

    docker volume create [OPTIONS] [VOLUME-NAME]<\/code><\/pre>\n\n\n\n

    For example, to create a volume called pt_data<\/code><\/strong>, you can use the command. Name can be anything of your preference.<\/p>\n\n\n\n

    docker volume create pt_data<\/code><\/pre>\n\n\n\n

    You can confirm the volumes by listing them;<\/p>\n\n\n\n

    docker volume ls<\/code><\/pre>\n\n\n\n

    Sample output;<\/p>\n\n\n\n

    DRIVER    VOLUME NAME\nlocal     pt_data<\/code><\/pre>\n\n\n\n

    The voume is created under the Docker host path, \/var\/lib\/docker\/volumes\/<\/strong>. See the output from the command below;<\/p>\n\n\n\n

    docker volume inspect pt_data<\/code><\/pre>\n\n\n\n
    [\n    {\n        \"CreatedAt\": \"2022-06-11T01:24:00-04:00\",\n        \"Driver\": \"local\",\n        \"Labels\": {},\n        \"Mountpoint\": \"\/var\/lib\/docker\/volumes\/pt_data\/_data\",\n        \"Name\": \"pt_data\",\n        \"Options\": {},\n        \"Scope\": \"local\"\n    }\n]\n<\/code><\/pre>\n\n\n\n

    Install Portainer<\/h3>\n\n\n\n

    Next, download and install Portainer server Docker container on Rocky Linux;<\/p>\n\n\n\n

    docker run -d -p 8000:8000 -p 9443:9443 --name portainer \\\n--restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n-v pt_data<\/strong>:\/data portainer\/portainer-ce:latest<\/code><\/pre>\n\n\n\n