Portainer.io: Build, Manage and Maintain Docker Environments

0
5952

This article introduces Portainer.io – a lightweight UI that allows the user to easily manage Docker hosts or Swarm clusters. Portainer consists of a single container that can run on any Docker engine. It is easy to install and run, requiring just a few commands.

Portainer.io (or just Portainer from now on) is one of the very lightweight and easy-to-use Docker container-monitoring, building and managing tools. As Docker container adoption and usage is picking up very fast, such a lightweight tool was really needed. The Portainer community edition download is in millions, which indicates this tool’s fast growth and usage.

Figure 1: Portainer installation
Figure 2: Portainer log in

Portainer comprises two elements — the Portainer server and the agent. Both these elements run as lightweight Docker containers on a standalone Docker engine or within a Swarm cluster. Due to the nature of Docker and its robustness, Portainer can be deployed in multiple ways very easily.

Note: 1. For more details, please refer to portainer.readthedocs.io. Also, note that Portainer can be deployed across platforms like Windows and Linux (https://www.portainer.io/installation/).
2. For purposes of this article, deployment and installation is done on Ubuntu Linux, and only this option will be discussed.
3. The agent is not needed on standalone hosts; however, it does provide additional functionality if used.

Figure 3: Portainer connect
Figure 4: Portainer home screen
Figure 5: Extensions

Portainer (latest version is 1.20.2) provides users with a detailed overview of their Docker environments, and allows the management of containers, images, networks and volumes. It is simple to deploy — you are just one/two Docker commands away from running Portainer anywhere. This tool has many advantages over other tools, some of which are listed below:

  1. 1 It’s lightweight (only two to three commands need to be run to install this tool, and the installation image is only around 26-30MB in size).
  2. It is robust and easy to use.
  3. It can be used for Docker monitoring and build.
  4. This tool provides a detailed overview of Docker environments.
  5. It allows the management of containers, images, networks and volumes.
  6. It is simple to deploy (can be run from anywhere).
  7. Complete Docker-container environment can be monitored easily.

Portainer also has:

  • Community support
  • Enterprise support
  • Availability of professional services
  • Availability of partner OEM services
Figure 6: Users
Figure 7: Endpoints
Figure 8: Registries

Installation and configuration of Portainer.io on Ubuntu Linux 16.04 LTS is as follows:

shashi@ubuntu~}$ lsb_release -a
LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial

shashi@ubuntu~}$ docker volume create portainer_data
shashi@ubuntu~}$ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Once the complete installation is done, the IP of the respective host or Docker can be used and Port 9000 of the Docker engine can be used to access Portainer from the browser (https://<ip Address>:9000). You will get the screen shown in Figure 2.
Note: Please make sure that you enter 8-character passwords. Let the admin be the user as it is, and then click on ‘Create user’. The screen shown in Figure 3 appears now; so select the ‘Local’ rectangular box.

Click on ‘Connect’. A nice GUI, with the admin as the user home screen appears (Figure 4).
Now Portainer is ready for monitoring.
Home: This page displays the endpoints, and various containers that are active and in running status.

Settings: This page is sub-divided into the following sections:

  • Extensions – To extend the benefit of Portainer CE even more, and to address the needs of larger, complex or critical environments, the Portainer team provides a growing range of low cost extensions. Portainer extensions provide a simple way to enhance Portainer CE’s core functionality through incremental capabilities in important areas.
  • Users – This page is for complete user management like adding/deleting users along with login privileges.
  • Endpoints – This page is for managing endpoints.
  • Registries – This page is for registries management (Dockerhub as well as local).
  • Settings – This page is for application settings, snapshotting (with intervals), managing mount points, etc.

The series of screenshots in Figures 5 through 9 display these various options in detail.

Figure 9: Settings
Figure 10: Container monitoring

Bringing up a container image on Portainer tool
If the containers shown in Figure 10 are clicked on, the container monitoring page opens up.
Next, the window shown in Figure 11 appears with various options.
Now check the present status – there is one container image that is already running, and if you create one more, that appears instantly.
From your command line, kickstart one or two containers as shown below:

shashi@ubuntu~}$ docker container run centos 
Unable to find image 'centos:latest' locally
latest: Pulling from library/centos
8ba884070f61: Pull complete
Digest: sha256:8d487d68857f5bc9595793279b33d082b03713341ddec91054382641d14db861
Status: Downloaded newer image for centos:latest
Figure 11: Dashboard
Figure 12: Container list

All the other options inside the dashboard or local window – like stacks, containers, images, networks, volumes, events and hosts – can be explored further for more detailed monitoring and control of container images. You can go to https://www.portainer.io/overview/ for more details on the usage of these features.

Portainer.io is gaining popularity in the Docker community as one of the most used and best tools. As it comes equipped with a lot of options and features for monitoring, building and managing Docker containers, usage and adoption of this tool has become the de facto standard. One can choose the appropriate version of Portainer based on the requirements.

LEAVE A REPLY

Please enter your comment!
Please enter your name here