TroubleChute Logo
DOCKER

How to Install Docker with Portainer/Dockge (2025)


Published: Apr 23, 2025
Last Edit: Apr 23, 2025
Docker Dockge Portainer
1,074 Words, 5 Minutes.

Preparation

Updating

Before we install Docker, start with a system update.

The steps for this differ based on your Linux distribution, but for Debian and Debian-based distros like Ubuntu, you can run:

1
2
sudo apt update && sudo apt upgrade
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

Firewalls

Be aware that if you’re using ufw or another firewall solution, exposing ports in Docker containers bypasses these. This can be an issue with something like Mailcow-dockerized; for example, see this. If you intend to host something like that, consider completely disabling ufw or related firewall tools.

Minimum distro requirements

While Docker runs on just about anything, it is important to know minimum versions of distributions are recommended. Check the Docker Install Guide for info on versions.

For example, at the time of writing, you need at least Ubuntu Focal 20.04 (LTS) or Ubuntu Oracular 24.10. For example, if you’re on Ubuntu 23.xx (non-LTS), then you need to go through a distribution upgrade, using something similar to sudo do-release-upgrade or sudo upgrade-manager for the updater GUI.

Uninstall old versions

If you’re reinstalling the Docker Engine, you will need to uninstall previous versions.

1
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

Installation

To install Docker, the steps differ per-distro. Ubuntu and Debian are below, but if you’re on anything else, you can find steps here.

Installing Docker on Ubuntu

Copy these commands into a terminal. You will need admin privileges through sudo.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Add your user to the docker group
sudo usermod -aG docker $USER
# Refresh session for accesss to new Docker commands
su $USER

Installing Docker on Debian

Copy these commands into a terminal. You will need admin privileges through sudo. If you are not using sudo make sure you have permissions to update, install, and run the commands without it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
# First, get your Debian codename
CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME")

# Then add the repository
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  ${CODENAME} stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Add your user to the docker group
sudo usermod -aG docker $USER
# Refresh session for accesss to new Docker commands
su $USER

If you are using Kali Linux or another derivative distribution, swap $(. /etc/os-release && echo "$VERSION_CODENAME") above for your corresponding Debian release, such as bookworm.

Testing

Once Docker is installed, you can test the following, where you should see a simple Hello, world response.

1
sudo docker run hello-world

Installing a Docker management tool

Portainer and Dockge are the 2 most well-known tools you can use to easily manage Docker compose files, networks and more. Usually, all of this needs to be done from the command line; however, for beginners, something visual can help you get a grip of what’s going on.

Dockge is a much simpler, more limited, open-source docker-compose.yaml stack-oriented manager, created by the same person who made UptimeKuma.

Portainer, on the other hand, offers a ton more control, but can be more overwhelming to begin with. Portainer is more widely known and is used by known businesses. There is a free Community Edition, and a paid business edition. This paid business edition is given out for free for your first 3 nodes. A node is essentially where you installed Portainer, so unless you’re installing Portainer on >3 computers, it’s a great choice that gets you to learn industry standard tooling.

Portainer also lets you manage Kubernetes, Docker Swarm and more.

By default, Portainer uses port 8000 for HTTP and 9443 HTTPS access to Portainer. The HTTPS server will generate a self-signed certificate.

Portainer CE / BE

Installing Portainer CE

The free community edition. Steps can be seen here, but are as follows for Docker Standalone (Visit the link for Docker Swarm, Podman and Kubernetes installs):

1
2
3
4
5
# Create storage volume for Portainer's Database
docker volume create portainer_data

# Install Portainer
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lts

Run docker ps to see if portainer/portainer-ce:lts appears.

Installing Portainer BE

The first 3 nodes are free. This installs, and 2 others. Apply here: Portainer Take 3. Below is the Docker Standalone installation, but head here for Docker Swarm, Podman or Kubernetes: Docker BE Install.

1
2
3
4
5
# Create storage volume for Portainer's Database
docker volume create portainer_data

# Install Portainer
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:lts

Run docker ps to see if portainer/portainer-ee:lts appears.

Using Portainer

Connect to Portainer through https://localhost:9443.

Dockge

Installing Dockge

Find more info here.

To install Dockge, run the following:

1
2
3
4
5
6
# Create directories that store your stacks and store Dockge's stack
mkdir -p /opt/stacks /opt/dockge
cd /opt/dockge

# Download your compose.yaml
curl "https://dockge.kuma.pet/compose.yaml?port=5001&stacksPath=/opt/stacks" --output compose.yaml

If you wish to use a different directory, change the mkdir and curl commands above to reflect that.

To start Dockge, run the following:

1
2
# Start the Server
docker compose up -d

If you are using docker-compose V1 or Podman (which you can install with sudo apt install podman-docker), use the following:

1
docker-compose up -d

Using Dockge

Connect to Dockge through http://localhost:5001

Which to choose

You can install and use both as you see fit. Having both of them running and managing containers is fine. Pick what you like best and remove the other.

TroubleChute © Wesley Pyburn (TroubleChute)
Support Me Privacy Policy Cookies Policy Terms of Service Change privacy settings Contact