Install Docker & Docker Compose
This guide covers how to install the modern Docker Engine and Docker Compose plugin on Ubuntu and macOS.
Ubuntu (22.04 / 24.04)
The best way to install Docker on Ubuntu is using the official Docker repository. This ensures you get the latest version and the docker compose (v2) command.
1. Uninstall old versions
Clean up any 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
2. 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 "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
3. Install Docker packages
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4. Verify Installation
Check that Docker Compose is working:
docker compose version
# Output: Docker Compose version v2.x.x
Run a test container:
sudo docker run hello-world
5. Run Docker without sudo (Optional)
To avoid typing sudo before every docker command:
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
macOS
Using Docker Desktop (Recommended)
- Download Docker Desktop for Mac.
- Drag the Docker icon to your Applications folder.
- Open Docker Desktop to start the engine.
This installs both docker and docker compose automatically.
Using Homebrew
If you prefer a CLI-only approach (e.g., using Colima):
brew install docker docker-compose
brew install colima
colima start
Troubleshooting
"unable to locate package docker-compose-plugin"
If you see this error on Ubuntu, it usually means you haven't added the official Docker repository (Step 2 above). The default Ubuntu repositories might not have the latest plugin.
Fix:
- Run
sudo apt-get update. - Ensure you followed Step 2 to add
https://download.docker.com/linux/ubuntu. - Try installing again.
"docker: command not found"
Ensure /usr/bin or /usr/local/bin is in your $PATH. If you just installed it, try opening a new terminal window.
Ready to deploy?
Once you have Docker Compose running locally, you can deploy your apps to the cloud with the same ease.
We support Docker Compose natively. Just paste your docker-compose.yml and we handle the rest—SSL, volumes, and databases included.