DebianDebian Based

How To Install Portainer on Debian 12

Install Portainer on Debian 12

In this tutorial, we will show you how to install Portainer on Debian 12. Portainer is a lightweight, open-source tool for managing Docker environments. It provides a user-friendly interface that simplifies the complexities of Docker, making it accessible to developers, system administrators, and those new to containerization.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Portainer on a Debian 12 (Bookworm).

Prerequisites

  • A server running one of the following operating systems: Debian 12 (Bookworm).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • Make sure your Debian 12 system is connected to the internet. An active connection is essential for downloading the required packages and updates during the installation.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Portainer on Debian 12 Bookworm

Step 1.  Keeping your system up-to-date is a best practice in system administration. Start by updating the system packages with the following commands:

sudo apt update
sudo apt upgrade
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release

Step 2. Installing Docker.

The Portainer runs as a Docker container, so we need to install Docker first. Now add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Set up the stable repository:

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

Update the apt package index, and install the latest version of Docker Engine and containerd:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

To ensure Docker has been installed correctly, run:

sudo docker run hello-world

This command downloads a test image and runs it in a container. If the installation is successful, a welcome message will be displayed.

Step 3. Installing Portainer on Debian 12.

Now, let’s install Portainer. Run the following commands:

sudo docker pull portainer/portainer-ce

Run the Portainer container:

sudo 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

Step 4. Access Portainer Web Ui.

To verify the installation, open a web browser and navigate to http://localhost:9000. You should see the Portainer login screen.

Install Portainer on Debian 12 Bookworm

Once logged in, you’ll be greeted by the Portainer dashboard. Here, you can manage containers, images, networks, and volumes. You can also monitor the health of your Docker environment and manage Docker Swarm clusters if you have them.

Congratulations! You have successfully installed Portainer. Thanks for using this tutorial to install the latest version of the Portainer on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official Portainer website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button