How to Install Portainer on Debian 11

Docker is a free, open-source and most popular container engine that allows developers to build, run, and ship applications easily. However, managing and running container application via the command line is very difficult for any beginner who are not familiar with Docker CLI. This is the place where portainer comes into the picture. Portainer is a web-based container management platform that can work with Docker and Kubernetes to manage and deploy containerized applications and services more easily and efficiently.

This tutorial will show you how to install Portainer on the Debian 11 server.

Prerequisites

  • A server running Debian 11 server.
  • A root password is configured on the server.

Install Docker CE

Before starting, Docker CE must be installed on your server. First, install all the required dependencies using the following command.

apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y

Next, add the Docker GPG key and repository with the following command.

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

Next, update the repository and install the Docker CE package using the following command.

apt update -y
apt install docker-ce -y

Once Docker CE is installed, you can verify the Docker version using the following command.

docker --version

You will get the following output.

Docker version 20.10.23, build 7155243

Install Docker Compose

You will also need to install Docker Compose to your system. First, download the latest version of Docker Compose binary to your system using the following command.

wget https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64

Next, copy the downloaded binary to the system location.

cp docker-compose-linux-x86_64 /usr/local/bin/docker-compose

Next, set the executable permission to the Docker Compose binary.

chmod +x /usr/local/bin/docker-compose

Next, verify the Docker Compose installation using the following command:

docker-compose --version

You should see the following output:

Docker Compose version v2.15.1

Install Portainer

First, create a volume to store Portainer data using the following command.

docker volume create data

You can now verify the created volume using the following command.

docker volume ls

You will get the following output.

DRIVER    VOLUME NAME
local     data

Next, run the following command to download and run the portainer Docker image.

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v data:/data portainer/portainer

You will get the following output.

latest: Pulling from portainer/portainer
772227786281: Pull complete 
96fd13befc87: Pull complete 
0bad1d247b5b: Pull complete 
b5d1b01b1d39: Pull complete 
Digest: sha256:47b064434edf437badf7337e516e07f64477485c8ecc663ddabbe824b20c672d
Status: Downloaded newer image for portainer/portainer:latest
e0ee5b16c93f358a15dfcb93cc80d2c2d1c1c675e7b65e41434ce20f08773465

You can verify the status of portainer using the following command.

docker ps

You will get the following output.

CONTAINER ID   IMAGE                 COMMAND        CREATED          STATUS          PORTS                                                                                            NAMES
e0ee5b16c93f   portainer/portainer   "/portainer"   28 seconds ago   Up 27 seconds   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 9443/tcp   portainer

Access Portainer Web Interface

At this point, Portainer is installed and running on port 9000. You can now access it using the URL http://your-server-ip:9000. You will get the following page:

Portainer login

Define your admin username, password and click on the Create user button. You should see the following page:

Portainer dashboard

Click on the Get Started button to see the status of all local containers.

Portainer Environments

Conclusion

Congratulations! You have successfully installed Portainer on Debian 11 server. You can now easily host your application on the containerization platform via a web-based interface. Feel free to ask me if you have any questions.

Share this page:

3 Comment(s)