Skip to content
Menu
Marius Serbanica – Tech Blog
  • My Tech Blog
  • About me
  • Contact Me
  • Curriculum Vitae
  • Projects
  • Current Projects List
  • Certifications
  • Home Lab
  • Self-Hosted
  • Linux Cheat Sheet
  • Linux Commands
  • Privacy Policy
  • Site Map
Marius Serbanica – Tech Blog
January 21, 2023

Docker, Docker-Compose, and Portainer

Docker is a powerful platform that allows you to easily create and manage containers. Docker-Compose is a tool that makes it easy to configure and run multiple containers. Portainer is a web-based management tool that makes it easy to manage your Docker containers. Together, these tools provide a powerful and flexible platform for creating and managing containers. In this tutorial, we will walk through the process of installing and configuring Docker, Docker-Compose, and Portainer on a Linux system.

  • Installing Docker

The first step is to install Docker on your Linux system. The easiest way to do this is to use the official Docker package repository. To add the repository, open a terminal and enter the following command:

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt-get update

Once the repository is added, you can install Docker by running the following command:

sudo apt-get install docker-ce
  • Installing Docker-Compose

Docker-Compose is a tool that allows you to easily configure and run multiple containers. To install Docker-Compose, you can use the following command:

sudo apt-get install docker-compose
  • Installing Portainer

Portainer is a web-based management tool that makes it easy to manage your Docker containers. To install Portainer, you can use the following command:

docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

This command will start a container running Portainer, and it will be accessible at http://localhost:9000.

  • Using Portainer

Once you have installed Portainer, you can access it by opening a web browser and navigating to http://localhost:9000. The first time you access Portainer, you will be prompted to create an admin user. Once you have created an admin user, you will be taken to the main Portainer interface, where you can manage your containers, images, and volumes.

In the left-hand menu, you can access the “Containers” page, where you can view and manage all the containers on your system. You can start, stop, and restart containers, as well as view detailed information about each container.

In the left-hand menu, you can access the “Images” page, where you can view and manage all the images on your system. You can download new images, delete existing images, and view detailed information about each image.

In the left-hand menu, you can access the “Volumes” page, where you can view and manage all the volumes on your system. You can create new volumes, delete existing volumes, and view detailed information about each volume.

  • Using Docker-Compose

Docker-Compose is a tool that allows you to easily configure and run multiple containers. With Docker-Compose, you can define your application’s services, networks, and volumes in a single docker-compose.yml file, and then start and stop all the services with a single command.

To use Docker-Compose, you will need to create a docker-compose.yml file in the directory where you want to run your application. The file should contain a list of services, networks, and volumes that you want to run. Each service should have a unique name and should specify the image to use, ports to expose, and any environment variables or volumes to mount.

Once you have created your docker-compose.yml file, you can start your application by running the following command in the same directory as the file:

docker-compose up


This command will start all the services defined in the docker-compose.yml file. To stop your application, you can run the following command:

docker-compose down


It’s important to note that if you make any changes to your docker-compose.yml file, you will need to run the docker-compose up command again for the changes to take effect.

In conclusion, Docker, Docker-Compose, and Portainer are powerful tools that make it easy to create and manage containers. Together, they provide a flexible and powerful platform for building, deploying, and running applications in containers. With this tutorial, you should now be able to install and configure these tools on your Linux system and use them to create and manage containers.

Share on Social Media
x facebook linkedin

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Join my LinkedIn Network.

Recent Posts

  • Kubernetes cluster. Why and how
  • Installing GNU-World on ircu2
  • Replacing Cloudflare Tunnel with Tailscale on a VPS
  • KASM – My main workspace RBI
  • Transforming a Mini PC into a Powerful Home Network Hub / Router/ Firewall with OPNsense

Archives

  • February 2025
  • January 2025
  • October 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023

Categories

  • How-To
  • Tech Industry
  • Tech, but personal
  • Tutorials

Recent Comments

  1. IRC Lamer on Installing GNU-World on ircu2
  2. severus2231 on Transforming a Mini PC into a Powerful Home Network Hub / Router/ Firewall with OPNsense
  3. admin on Mounting a NAS (Network Attached Storage) device on Linux
  4. abL on Mounting a NAS (Network Attached Storage) device on Linux
  5. Alin R on Cleaning up your Linux OS.
Social Media
Find me on social media
Facebook Twitter Instagram LinkedIn

©2025 Marius Serbanica – Tech Blog