Portainer: Docker management made easy

Back in 2002, I was working at this computer’s school where I used to teach Word and Excel for kids. My employer at the time was a Clipper developer. Every time I needed to talk to him, he was looking at the terminal screen, typing. I naively tried to do the same using DOS commands in the terminal, but nothing good came out of it. Well, from this point forward, I got interested in software development.

What does it have to do with Portainer? Nothing really, but my story with terminals go back to that time. Although I enjoy working with terminals, I enjoy more when I find visual tools that do the job better and faster.

Portainer

My friend Orlando - who shares the same appreciation for Broodje Ben as I do - recommended me this tool a while back. Portainer is a toolset that allows us to build, manage and maintain Docker environments with ease. In this post, we’ll see how to go from darkness to light in no time :)

Installation

The very first step is to ensure we’ve got Docker installed. Once it’s up and running, we can proceed with Portainer’s installation:

For Linux:

docker run -d -p 8000:8000 -p 9000:9000 \
  --name=portainer --restart=always \
  -v /var/run/docker.sock:/var/run/docker.sock \
portainer/portainer

For Windows:

docker run -d -p 8000:8000 -p 9000:9000 \
  --name portainer --restart always \
portainer/portainer

Once we’ve run it, we’re now able to access it through http://localhost:9000. During the first access, an administrator account must be created. After its creation, Portainer is going to ask us which kind of Docker environment we want to manage. The two common ones are:

  1. Local Docker environment: this option will work with Docker for Linux or Windows with build 1803+. In case of usage with Windows, we must include the option -v \\.\pipe\docker_engine:\\.\pipe\docker_engine when initializing our Portainer container.
  2. Remote Docker environment: this applies to any hosted Docker with the exposed API. We also can manage local Docker environments by providing the host.docker.internal:2375 as the endpoint URL.

Let’s take a look at this short video demonstrating Portainer’s configuration and how to deploy a hello world container:

That’s it, Portainer is up and running! Now we’re able to explore what’s going on inside of our Docker environment in a visual way. For me, a visual tool such as this will always have a special place in my heart :)

See you next time!