Docker is a tool that makes it easy to run applications in isolated environments called containers.
Think of it like this:
📦 A container is like a “portable box” that has everything an app needs to run (code, libraries, dependencies).
🚢 Docker is the system that builds, runs, and manages these boxes.
Why use Docker?
✅ Works everywhere – Runs the same on your PC, server, or cloud.
✅ No “it works on my machine” issues – Everything is inside the container.
✅ Lightweight & fast – Uses less space than virtual machines.
- Stop and Remove the Old Container:
sudo docker stop remark42 && sudo docker rm remark42
- Recreate and Start the Container with the Updated
docker-compose.yml
:
sudo docker-compose up -d
- Check if the New Container is Running:
sudo docker ps
Installation
I chose to go with the docker engine rather than Docker Desktop for Linux because I’m using this to deploy a server and I don’t need Kubernetes and all that extra stuff. Additionally, Docker Desktop for Linux runs in a VM, while the engine runs locally (I think).
Using the apt
Repository
Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
-
Set up Docker’s
apt
repository.# 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 the Docker packages.
Latest Specific version
To install the latest version, run:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
-
Verify that the installation is successful by running the
hello-world
image:sudo docker run hello-world
Docker Compose
Installation
-
Update the package index, and install the latest version of Docker Compose:
-
For Ubuntu and Debian, run:
$ sudo apt-get updatesudo docker stop remark42
-
sudo docker rm remark42
$ sudo apt-get install docker-compose-plugin
```
- For RPM-based distributions, run:
```console
$ sudo yum update
$ sudo yum install docker-compose-plugin
```
2. Verify that Docker Compose is installed correctly by checking the version.
```console
$ docker compose version
```
Expected output:
```text
Docker Compose version vN.N.N
```
Where `vN.N.N` is placeholder text standing in for the latest version.
Update Docker Compose
To update the Docker Compose plugin, run the following commands:
- For Ubuntu and Debian, run:
sudo apt-get update
sudo apt-get install docker-compose-plugin
- For RPM-based distributions, run:
sudo yum update
sudo yum install docker-compose-plugin