Docker has become the go-to container engine for developers, providing an easy way to build, run, and ship applications. However, managing and deploying containerized applications solely through the command line can be challenging, especially for beginners. This is where Portainer comes in. Portainer is a powerful web-based container management platform that simplifies Docker and Kubernetes operations, making it easier and more efficient to manage and deploy containerized applications and services.
In this tutorial, we will guide you through the process of installing Portainer on a Debian 11 server. Portainer’s intuitive user interface will enable you to harness the full potential of Docker and Kubernetes, even if you lack experience with command-line operations.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A Debian 11 server
- Root password configured on the server
Step 1: Installing Docker CE
To get started, we need to install Docker CE on your Debian 11 server. Docker CE is the community edition of Docker, which provides a free and open-source containerization platform.
First, update the system and install the necessary dependencies by running the following command:
apt update apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
Next, add Docker’s official GPG key and repository to your system:
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
Once the key and repository are added, update the system again and install Docker CE:
apt update apt install docker-ce -y
Verify that Docker CE is successfully installed by checking its version:
docker --version
You should see output similar to the following:
Docker version 20.10.23, build 7155243
Step 2: Installing Docker Compose
In addition to Docker CE, we also need to install Docker Compose, a tool used for defining and running multi-container Docker applications.
Start by downloading the latest version of Docker Compose binary:
wget https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64
Copy the downloaded binary to the system’s location:
cp docker-compose-linux-x86_64 /usr/local/bin/docker-compose
Make the binary executable:
chmod +x /usr/local/bin/docker-compose
Verify the installation of Docker Compose:
docker-compose --version
You should see output similar to the following:
Docker Compose version v2.15.1
Step 3: Installing Portainer
Now that we have Docker CE and Docker Compose installed, we can proceed to install Portainer. But first, let’s create a volume to store Portainer’s data:
docker volume create data
Verify that the volume has been created successfully:
docker volume ls
You should see output similar to the following:
DRIVER VOLUME NAME local data
Next, 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
The output will show the progress of the image download and container creation. Once completed, verify that the Portainer container is running:
docker ps
You should see output similar to the following:
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
Step 4: Accessing the Portainer Web Interface
With Portainer installed and running, you can now access its web interface. Open your preferred web browser and enter the following URL, replacing your-server-ip
with the IP address of your Debian 11 server:
http://your-server-ip:9000
You will be greeted with the Portainer login page. Create an admin account by providing a username, password, and clicking on the “Create user” button. Once created, you will be redirected to the Portainer dashboard.
Conclusion
Congratulations! You have successfully installed Portainer on your Debian 11 server. With Portainer’s user-friendly web interface, you can now easily manage and deploy your containerized applications. Whether you’re a beginner or an experienced developer, Portainer simplifies Docker and Kubernetes operations, making it a valuable tool for any containerization project.
If you have any questions or need further assistance, feel free to reach out. Enjoy exploring the capabilities of Portainer and unleash the full potential of Docker and Kubernetes!
Additional Information
At Shape.host, we offer reliable and scalable Linux SSD VPS hosting solutions. Our expert team is dedicated to empowering businesses with efficient and secure cloud hosting services. If you’re looking for a hosting provider that understands your needs, visit Shape.host today.