{"id":13121,"date":"2022-06-10T21:02:43","date_gmt":"2022-06-10T18:02:43","guid":{"rendered":"https:\/\/kifarunix.com\/?p=13121"},"modified":"2024-03-09T15:20:40","modified_gmt":"2024-03-09T12:20:40","slug":"install-portainer-on-debian-11-debian-10","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-portainer-on-debian-11-debian-10\/","title":{"rendered":"Install Portainer on Debian 11\/Debian 10"},"content":{"rendered":"\n

In this tutorial, you will learn how to install Portainer on Debian 11\/Debian 10. 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 Debian 11\/Debian 10<\/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

    In this tutorial, we will run 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 Debian 11\/Debian 10<\/h3>\n\n\n\n

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

    apt update -y && apt install curl gnupg2 -y<\/code><\/pre>\n\n\n\n
    curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg \\\n| gpg --dearmor > \/etc\/apt\/trusted.gpg.d\/docker.gpg<\/code><\/pre>\n\n\n\n
    echo \\\n\"deb [arch=$(dpkg --print-architecture)] https:\/\/download.docker.com\/linux\/debian $(lsb_release -cs) stable\" \\\n| tee \/etc\/apt\/sources.list.d\/docker.list > \/dev\/null<\/code><\/pre>\n\n\n\n
    apt update<\/code><\/pre>\n\n\n\n
    sudo apt 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 Debian 11\/Debian 10.<\/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-09T17:56:05Z\",\n        \"Driver\": \"local\",\n        \"Labels\": {},\n        \"Mountpoint\": \"\/var\/lib\/docker\/volumes\/pt_data\/_data\",\n<\/strong>        \"Name\": \"pt_data\",\n        \"Options\": {},\n        \"Scope\": \"local\"\n    }\n] \n<\/code><\/pre>\n\n\n\n

    Install Portainer as Standalone Docker Container<\/a><\/h3>\n\n\n\n

    Next, download and install Portainer server Docker container on Debian 11\/Debian 10;<\/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