Home Docker Portainer: Easily Manage Your Containerized Apps

Portainer: Easily Manage Your Containerized Apps

by Behrad
949 views

If you have a lot of containers installed on your Raspberry Pi, or other environments, then Portainer is definitely something which you need.

Portainer is actually a container that you can run on any cluster and delivers a platform for containerized apps to manage them. The management can be done through a web GUI and can handle all the resources such as your Containers, Images, Volumes and even Networks. At the time of writing this post, the latest version was 2.11.0.

How To Install Portainer?

The deployment is very easy and you can use the below snippet and paste it when connected to your RPi through SSH. First of all we need to create a volume so Portainer can store it’s database. The official documentation suggest the below code.

docker volume create portainer_data

NOTE: If you’re like me and you would like to have all of your databases and configs in 1 folder, you can opt for that as well. For this I have created a main folder called “Configs” under the “home” folder and each new container will gets its own sub folder within the Configs folder.

In the below snippet I’m assuming that you’ll run Portainer on a 64bit OS of RPi, but if not, please change portainer-ce:linux-portainer/portainer-ce:linux-arm64-2.11.0 to portainer/portainer-ce:linux-arm-2.11.0. So deleting the 64 and hit enter and it’ll be installed.

docker run -d -p 9000:9000 --name Portainer \
    --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v portainer_data:/data \ #Change the path to your own path if needed
    portainer/portainer-ce:linux-arm64-2.11.0 #Change if you're not using 64bit OS.

How To Use Portainer?

Now go http://RPI-IPADRES:9000 and login using the standard username & password: admin / admin. You’ll be asked to create a new strong password.

Once you’re logged in, you’ll see a screen such as below.

Portainer Dashboard

Before we actually do anything there are two things which needs to be changed:

  1. The “Public IP”. Yes, the naming is a bit off but this is the actual hosts where Portainer is running on. Simply update this and Name. The Public IP is something which will be very handy to use in the “Container” menu. This allows us to simply click on the ports and we will be redirected to the correct place.
    In the left you’ll see “Settings”. Click on Environments, update the name & IP and click on “Update environment”.
  2. Go to Settings and paste the below URL under App Templates. This will provides you a huge list of cools apps which you can install with a couple of clicks.
https://raw.githubusercontent.com/SelfhostedPro/selfhosted_templates/master/Template/portainer-v2.json

Now all is set-up you can actually start using Portainer.

Menu Explanation:

The most important parts for your daily use will be:

  • Stacks: This the place where you can paste your docker-compose files.
  • Containers: Provides a list of your containers with all the handy tools: Start, Stop, if it’s running, it’s IP address and published ports.
  • Images: This is the place where you can see the images used for your containers
  • Networks: In case you would need to create networks, this is the place to do so.
  • Volumes: To create persistent volumes for your containers. You can do this here or manually create it. Up to you! 😉

What I also suggest is that you actually go through the “App Templates” to find some hidden jewels…. I’ve found a couple of cools container apps which I really like!

Conclusion:

Portainer is a great tool which you can use to easily deploy dockers and maintain them. This is one of the fundamental apps which should be installed. Are you using this as well or do you use a different management tool? Let me know in the comments!

You may also like

2 comments

Cheng 10 February 2022 - 21:57

Hi,

Mind explaining how to update Portainer to latest version?

Behrad 14 February 2022 - 14:43

Hi Cheng,
A good question with a very easy answer which you can find here.

Comments are closed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Discover more from ITB4X.com

Subscribe now to keep reading and get access to the full archive.

Continue reading