Portainer – manage your dockers environments

Portainer - manage your dockers environmentsPortainer is a docker container management system in Linux. It allows you to manage both local and remote containers using the Docker API. Recently, Docker is gaining more and more popularity due to the ability to quickly deploy complex applications consisting of a large number of services.

With Portainer, you can monitor the status of containers, start, stop, and delete them, deploy new applications, and much more. In this article, we will install Docker Portainer on your computer, as well as learn a little about it.

This article is suitable for both Linux Mint and Ubuntu, including ubuntu server (this is how I use it).

To complete this article, you will need Docker already installed on your system. I will not tell you in detail how to install dokker and dokker-compose. To do this, use this article for Ubuntu. Personally, I have just installed Docker.io from software manager

Portainer - manage your dockers environmentsor use terminal

sudo apt install docker.io

We will also add Docker as a system service so that it runs with the system

sudo systemctl enable docker

Portainer installation:

Portainer is installed as a container inside Docker. So we’ll add storage

sudo docker volume create portainer_data

Portainer - manage your dockers environments

Now install the Portainer

sudo docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Portainer - manage your dockers environmentsTo make sure that Portainer is running, run this command (if you already have containers installed and running, they will also be displayed here):

sudo docker ps

Portainer - manage your dockers environments

Configuring:

You can access the program via the web interface on port 9000. Open it in your browser. In the first step, you will need to enter the username and password that you will use to log in. Then select the method for connecting to Docker. I will connect to the local Docker service that I just installed. To do this, select Local:

Portainer - manage your dockers environmentsAfter clicking Connect you will be in the container control panel. First, you need to select the node where you will manage the containers, in this case, it is local.Portainer - manage your dockers environmentsHere you can already manage your containers. For example, in the Containers section, you can view all available containers: Portainer - manage your dockers environmentsIn the App Templates section, you can deploy a new app based on one of the existing templates. For example, let’s deploy WordPress. To do this, find it in the list and click on it: Portainer - manage your dockers environmentsHere you need to configure the template. In this case, you need to specify the application name and set a password for the database. After that, click the Deploy the stack button and the new application will appear in the list of the Stacks section.
Portainer - manage your dockers environmentsAs you can see, the program now reports that it has full control over this app because it created it.

If you open the app, its containers will be displayed there. For each container, you can view logs, open ports, and even connect via the terminal. To view the logs, click on the notebook-like icon next to the container status.
For the command line, there is an icon next to the input prompt symbol.
And open ports are located at the very end of the container characteristics in the Published ports section.

Portainer - manage your dockers environmentsIf you click on the link labeled 32768: 80 for the WordPress container, you will be taken to the WordPress sitePortainer - manage your dockers environmentsPlease note that WordPress will be available by default on a non-standard external port — in this case, 32768. If necessary, in the settings of the wordpress container, you can change the port to 80, but it is better to install an additional container with nginx and use this product to proxy traffic, enable SSL, and so on. In addition, the use of nginx for processing external connections is also justified in the event that you need to host another site or application. In this case, additional applications will use separate, unique ports, and with the help of nginx and the use of proxy_pass directives, you can configure the simultaneous operation of an almost unlimited number of applications within a single docker node.

How to update Portainer:

To update Portainer, delete the current image and run it again. This will not cause any problems, since when creating the previous image, we used external storage for data storage. Stop the image and delete it:

sudo docker stop portainer
sudo docker rm portainer

Download the new version

sudo docker pull portainer/portainer

Then it remains to install Portainer again:

sudo docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

As you can see, Portainer is very simple, but it helps you use containers well. You can also connect remote nodes to it, but you need them to have a public IP address, because you can’t interact with them on the local network.

May The Force Be With You!

Good Luck

The site has moved to a new engine, help me fix bugs, send me your notify by selecting that text and pressing Ctrl+Enter.

Share to friends
Shekin
Rate author
( No ratings yet )
MintGuide.Org
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Spelling error report

The following text will be sent to our editors: