Docker Install

Installing Docker on Ubuntu MATE
Installing Docker on Ubuntu MATE

Setting up Docker on Ubuntu MATE involves uninstalling old versions, setting up the repository, installing Docker Engine, and performing post-installation steps. Ubuntu MATE is based on Ubuntu, so the installation follows the standard Ubuntu process. This guide is based on the official Docker documentation as of September 2025.

Prerequisites

Ensure your system meets the requirements:

  • 64-bit Ubuntu Oracular 24.10, Noble 24.04 (LTS), or Jammy 22.04 (LTS).
  • Compatible architectures: x86_64 (amd64), armhf, arm64, s390x, ppc64le (ppc64el).
  • Ubuntu MATE aligns with Ubuntu LTS releases, so it should work, though not officially tested.
  • Be aware of firewall limitations if using ufw or firewalld; Docker may bypass rules.
Step 1: Uninstall Old Versions

Remove any older versions or conflicting packages to avoid issues.

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
Note: If none of these packages are installed, that's fine. This step ensures a clean slate. Images, containers, volumes, and networks in /var/lib/docker/ won't be removed automatically.
Step 2: Set Up the Docker Repository

Set up Docker's official APT repository.

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
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
Step 3: Install Docker Engine

Install the latest version of Docker Engine and related tools.

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Note: To install a specific version, list available versions with apt-cache madison docker-ce | awk '{ print $3 }', then install using the version string, e.g., sudo apt-get install docker-ce=5:28.4.0-1~ubuntu.24.04~noble ....
Step 4: Verify Docker Installation

Check if Docker is running and test it with a hello-world container.

sudo systemctl status docker

If not running, start it:

sudo systemctl start docker

Test Docker:

sudo docker run hello-world
Note: This should download a test image and print a confirmation message if everything is working.
Step 5: Manage Docker as a Non-Root User (Optional)

To run Docker commands without sudo, add your user to the docker group.

sudo groupadd docker # If the group doesn't exist
sudo usermod -aG docker $USER

Log out and back in, or run newgrp docker for the change to take effect. Verify with docker run hello-world.

Warning: The docker group grants root-level privileges, which can be a security risk.

If permission issues arise with ~/.docker/, fix by changing ownership:

sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R
Step 6: Configure Docker to Start on Boot (Optional)

On Ubuntu, this is enabled by default. To ensure:

sudo systemctl enable docker.service
sudo systemctl enable containerd.service
Step 7: Using Docker Compose

Docker Compose is included as a plugin. Use docker compose commands. Verify:

docker compose version
Troubleshooting Tips
  • Docker service not starting: Check logs with journalctl -u docker.service.
  • Permission issues: Ensure your user is in the docker group or use sudo. Fix ~/.docker/ permissions if needed.
  • Repository issues: Verify your Ubuntu codename (e.g., noble for 24.04) matches a supported version.
  • Firewall issues: Docker may bypass ufw/firewalld; use iptables for rules in DOCKER-USER chain.
Notes
  • Ubuntu MATE Specificity: As an Ubuntu derivative, the process is the same, though not officially supported.
  • Docker Desktop: Not available on Linux; use the CLI and Compose plugin.
  • Security: Avoid running untrusted containers, as they can access the host with root privileges. Consider rootless mode for better security.
  • Uninstall: To remove, use sudo apt-get purge docker-ce ... and delete /var/lib/docker/ if needed.