Linux Mint supports Docker through its standard repository, though enabling the service requires a few post-installation steps. This guide walks you through exactly How To Install Docker On Linux Mint using both the easy repo method and the official Docker repository for the latest features. Whether you’re a developer or a hobbyist, you’ll have Docker containers running in under twenty minutes.
Prerequisites For Docker On Linux Mint
Before you start, make sure your system meets these basic requirements. You need a 64-bit version of Linux Mint (19, 20, or 21 series). You also need sudo privileges or the root password. A stable internet connection is essential for downloading packages.
- A Linux Mint installation (Cinnamon, MATE, or Xfce)
- At least 2 GB of RAM (4 GB recommended)
- 10 GB free disk space for images and containers
- Terminal access (Ctrl+Alt+T)
Check your current kernel version with uname -r. Docker works with kernel 3.10 or newer. Linux Mint 21 uses kernel 5.15, so you’re good.
How To Install Docker On Linux Mint
There are two main ways to install Docker. The first uses Linux Mint’s own repositories. The second uses Docker’s official repository. I’ll show you both, but I recommend the official repo for the newest version.
Method 1: Install Docker From Linux Mint Repositories
This method is simpler but gives you an older Docker version. It’s fine for basic testing or learning.
- Open your terminal.
- Update your package list:
sudo apt update - Install Docker:
sudo apt install docker.io -y - Start the Docker service:
sudo systemctl start docker - Enable Docker to start on boot:
sudo systemctl enable docker - Verify the installation:
docker --version
You should see output like Docker version 20.10.21, build 20.10.21-0ubuntu1. The version number depends on your Mint release. This method works, but you miss out on newer features and security patches.
Method 2: Install Docker From Official Docker Repository (Recommended)
This method gives you the latest Docker Engine. It also includes Docker Compose as a plugin. Follow these steps carefully.
Step 1: Remove Old Docker Versions
If you have an older Docker installation, remove it first. Run these commands:
sudo apt remove docker docker-engine docker.io containerd runc
Don’t worry if apt says nothing to remove. That means you have a clean system.
Step 2: Install Prerequisite Packages
Docker needs some tools to work with apt over HTTPS. Install them with:
sudo apt update
sudo apt install ca-certificates curl gnupg lsb-release -y
These packages let you add Docker’s official GPG key and repository.
Step 3: Add Docker’s Official GPG Key
Download and add the GPG key to verify package signatures:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
This command creates a keyring directory and stores the key. The key ensures you download authentic Docker packages.
Step 4: Add Docker Repository
Now add the repository to your sources list. Linux Mint is based on Ubuntu, so you use Ubuntu’s repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
This command detects your architecture and Mint version. It adds the correct repository automatically.
Step 5: Install Docker Engine
Update your package list again, then install Docker:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
This installs the Docker Engine, CLI, containerd runtime, and the Compose plugin. Wait for the download to finish.
Step 6: Start and Enable Docker
Start the Docker service and enable it to run at boot:
sudo systemctl start docker
sudo systemctl enable docker
Check the service status with sudo systemctl status docker. You should see “active (running)” in green.
Step 7: Verify Installation
Run the hello-world container to confirm everything works:
sudo docker run hello-world
You’ll see a welcome message. Docker pulled the test image and ran it successfully. Your installation is complete.
Post-Installation Steps For Docker On Linux Mint
Docker works with sudo by default. To run Docker commands as a regular user, add your user to the docker group.
Add User To Docker Group
- Create the docker group if it doesn’t exist:
sudo groupadd docker - Add your user:
sudo usermod -aG docker $USER - Log out and log back in, or run:
newgrp docker - Test without sudo:
docker run hello-world
If you get a permission denied error, restart your system. This step is optional but highly recommended for convenience.
Configure Docker To Start On Boot
Docker should already be enabled from the installation steps. Verify with:
sudo systemctl is-enabled docker
If it says “enabled,” you’re set. If not, run sudo systemctl enable docker.
Install Docker Compose (Standalone Version)
The Docker Compose plugin is installed with the official method. If you prefer the standalone version, download it separately:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Verify with docker-compose --version. The plugin version works with docker compose (no hyphen). Both are fine.
Common Issues And Fixes When Installing Docker On Linux Mint
Sometimes things go wrong. Here are typical problems and how to solve them.
GPG Key Error
If you see “GPG error: The following signatures couldn’t be verified,” the key wasn’t added correctly. Repeat Step 3. Make sure you use the exact curl command. Check file permissions on /etc/apt/keyrings/docker.gpg.
Repository Not Found
Linux Mint uses codenames like “una” or “vanessa.” The Docker repository expects Ubuntu codenames. If you get a 404 error, edit the repository file:
sudo nano /etc/apt/sources.list.d/docker.list
Replace the codename with the corresponding Ubuntu one. For Mint 21 (vanessa), use “jammy.” For Mint 20 (ulyana), use “focal.” Save and run sudo apt update again.
Permission Denied When Running Docker
If you see “permission denied” even after adding your user to the docker group, log out completely. Then log back in. If it still fails, restart your system.
Docker Service Fails To Start
Check the logs with sudo journalctl -u docker.service. Common causes include AppArmor conflicts or missing kernel modules. Install linux-modules-extra if needed:
sudo apt install linux-modules-extra-$(uname -r)
Basic Docker Commands To Test Your Installation
Now that Docker is installed, try these commands to get comfortable.
docker ps– List running containersdocker images– List downloaded imagesdocker pull nginx– Download the Nginx imagedocker run -d -p 8080:80 nginx– Run Nginx in detached modedocker stop <container_id>– Stop a containerdocker rm <container_id>– Remove a containerdocker rmi <image_id>– Remove an image
Open your browser and go to http://localhost:8080. You should see the Nginx welcome page. That’s your first container running.
Uninstalling Docker From Linux Mint
If you need to remove Docker completely, follow these steps.
- Stop Docker:
sudo systemctl stop docker - Remove packages:
sudo apt purge docker-ce docker-ce-cli containerd.io docker-compose-plugin -y - Remove images and containers:
sudo rm -rf /var/lib/docker - Remove the repository:
sudo rm /etc/apt/sources.list.d/docker.list - Remove the GPG key:
sudo rm /etc/apt/keyrings/docker.gpg
This cleans everything. Your system returns to its pre-Docker state.
Frequently Asked Questions About Docker On Linux Mint
Can I Install Docker On Linux Mint 21?
Yes. Linux Mint 21 (Vanessa) fully supports Docker. Use the official repository method for best results. The Ubuntu jammy repository works perfectly.
Do I Need To Enable Virtualization In BIOS For Docker?
No. Docker does not require hardware virtualization. It uses the host kernel directly. Virtualization is only needed for running virtual machines, not containers.
Is Docker Free To Use On Linux Mint?
Yes. Docker Engine is open-source and free. Docker Desktop is a separate product with a paid tier for commercial use. On Linux, you only need Docker Engine.
How Do I Update Docker On Linux Mint?
Run sudo apt update && sudo apt upgrade docker-ce docker-ce-cli containerd.io. This updates Docker to the latest version from the repository.
Can I Run Docker Containers As A Non-root User?
Yes. Add your user to the docker group as shown in the post-installation steps. After logging out and back in, you can run Docker without sudo.
Conclusion
You now know How To Install Docker On Linux Mint using both the default repository and the official method. The official repository gives you the latest features and security updates. After installation, you added your user to the docker group for convenience. You also tested Docker with a hello-world container and an Nginx web server.
Docker opens up a world of containerized applications. You can run databases, web servers, development environments, and more without cluttering your host system. Start with small projects like a WordPress site or a Python app. The official Docker documentation has excellent tutorials for beginners.
If you run into any issues, check the Docker forums or the Linux Mint community. Both are active and helpful. Remember to keep Docker updated for the best performance and security. Happy containerizing