May 1, 2021

Portainer: Easily Manage Docker Containers

One of the pitfalls in self hosting is that things can eventually become a challenge to keep track of! Of course it's technically possible to do just about everything with CLI commands alone, sometimes it's even preferable to do so. But this simple little tool makes all the difference in providing a more visually comfortable view of your Docker environment.

Portainer makes it a joy to keep an eye on your containers. At a glance, you see the status of each container, what port they're running on, and you have a view of auto-refreshing logs and environment information at the click of a button.

Make sure you already have the latest Docker and Docker Compose installed first!

Then go ahead and create the Docker Compose file for Portainer:

cd /home/YourUser/Docker/ && mkdir Portainer
cd Portainer && sudo nano docker-compose.yml
version: '2'

services:
  portainer:
    image: portainer/portainer-ce:latest
    container_name: Portainer
    command: -H unix:///var/run/docker.sock
    restart: always
    ports:
      - 9000:9000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

volumes:
  portainer_data:

Then start the container:

docker-compose up -d

You should now have a working Portainer instance at localhost:9000! You can go ahead and browse over there, create an admin user and head over to the containers section to get a nice view of any existing Docker containers.

That's all there is to it. These steps should work on a broad variety of systems, but please do feel free to contact us if you had any trouble! We hope you found this helpful, thanks for reading!