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:
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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):
|
|
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.
|
|
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:
|
|
If you wish to use a different directory, change the mkdir
and curl
commands above to reflect that.
To start Dockge, run the following:
|
|
If you are using docker-compose V1 or Podman (which you can install with sudo apt install podman-docker
), use the following:
|
|
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.