
Getting Portainer set up on your Debian system, whether you’re running version 11 or 10, is a straightforward process that leverages Docker containers. Portainer provides a powerful web interface to manage your Docker environments, making deployment and administration significantly easier.
Before you begin, ensure you have Docker installed and running on your Debian machine. If not, you’ll need to install it first using your system’s package manager.
Once Docker is ready, the installation involves pulling the Portainer image and then running it as a container.
Start by pulling the latest Portainer Community Edition (CE) image from Docker Hub. Open your terminal and execute:
docker pull portainer/portainer-ce
After the image is downloaded, you can create and run the Portainer container. This container will be configured to restart automatically and will mount the Docker socket and a volume for its data. The standard ports used are 9000 for the web UI and often 8000 for edge agent communication (though 8000 might not be strictly necessary for a standard local installation, it’s commonly included).
Use the following command to create and start the container:
docker run -d -p 8000:8000 -p 9000:9000 –name portainer –restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Let’s break down this command:
- -d: Runs the container in detached mode (in the background).
- -p 8000:8000: Maps port 8000 on your host to port 8000 in the container.
- -p 9000:9000: Maps port 9000 on your host to port 9000 in the container (the web UI port).
- –name portainer: Assigns the name ‘portainer’ to the container for easy reference.
- –restart always: Configures the container to automatically restart if it stops.
- -v /var/run/docker.sock:/var/run/docker.sock: Mounts the Docker socket from the host into the container, allowing Portainer to manage Docker.
- -v portainer_data:/data: Creates or uses a named Docker volume called
portainer_data
to persist Portainer’s configuration and data. - portainer/portainer-ce: Specifies the image to use for the container.
Once the command runs successfully, the Portainer container will be running. You can verify this with docker ps.
Finally, access the Portainer web interface by opening a web browser and navigating to http://yourserveriporlocalhost:9000. You will be prompted to create your initial administrator account. Set a strong username and password to secure your Portainer instance.
With the administrator account created, you can log in and start managing your Docker environment directly from the intuitive Portainer dashboard. This simplifies many common Docker tasks and provides excellent visibility into your containers, images, volumes, and networks.
Source: https://kifarunix.com/install-portainer-on-debian-11-debian-10/