Docker Series 10: Use Portainer to manage your containers.

Jay Bilgaye
2 min readNov 26, 2019

--

Use Portainer to manage your containers

This tool is used to manage docker easily.

  1. Create a volume for Portainers data:
docker volume create portainer_data

2. Create the Portainers container

docker container run -d --name portainer -p 8080:9000 \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data portainer/portainer
docker container ls[root@machine1 ~]# docker volume create portainer_data
portainer_data
[root@machine1 ~]# docker container run -d — name portainer -p 8080:9000 \
> — restart=always \
> -v /var/run/docker.sock:/var/run/docker.sock \
> -v portainer_data:/data portainer/portainer
Unable to find image ‘portainer/portainer:latest’ locally
latest: Pulling from portainer/portainer
d1e017099d17: Pull complete
292b789be2e4: Pull complete
Digest: sha256:63eb47d4b408c3f39e942368bcbf7e157a2b6e5dda94ffd403a14199e1137133
Status: Downloaded newer image for portainer/portainer:latest
6e126a47fe3e2100f0fd59a20cd4125f98e8bde42b7e1a2cdba553290192135e
[root@machine1 ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6e126a47fe3e portainer/portainer “/portainer” 29 seconds ago Up 28 seconds 0.0.0.0:8080->9000/tcp portainer

If you are running VirtualBox as per my Configuration series, then perform the following step else Skip this step and login to portainer from your browser.

3. Port forwarding in Virtual box:

Add port 8081 to forward traffic from 8080 as per screen shot below.

4. Login to Portainer :

Go to browser and type, http://localhost:8081/

Create user admin with a password and do remember the password.

Login prompt for Portainer

Select Local out of the different environments. and Click Connect

Congratulations.

You just moved one step closer to monitoring your containers using a portainer.

--

--