Portainer helps you manage your Docker containers with a graphical interface, works with Docker servers or Swarm clusters.
Portainer consumes very few resources and works like a Docker container (the Docker image weighs less than 4MB). Therefore, once we have Docker installed it will be very easy to install.
As usual, before installing a package we will make sure that our server is updated:
# apt update
# apt upgrade
We install the necessary packages to be able to install Docker:
# apt install apt-transport-https ca-certificates curl software-properties-common
We add the official Docker GPG key:
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
We activate Docker repository and update it:
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# apt update
We install the latest Docker version:
# apt install docker-ce
As we mentioned at the beginning of this article, installing Portainer is very simple since it works in a Docker container, for this we will execute:
# docker volume create portainer_data
# docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
First of all, you have to open port 9000 TCP on the client panel. Now that we have Portainer installed and the port opened, the first thing to do is set it up, for this we will enter http: // IP_Publica_servidor: 9000, create a password for our admin user, select “Local” and connect with our Docker container. The next step will be to setup the IP of our server so we will go to “Endpoints” and click on “local”, and in the window that will open we will fill in the Public IP of our server in “Public IP”. Below are some screenshots of the whole process:
Now that we have installed and set up Portainer we can create the containers that we want. We can do it in different ways: “App Templates”, “Stacks” or “Images + Containers”. Below are several screenshots with different examples:
Have you tried it? Leave a comment! 🙂