A one-command installer script that sets up Docker Engine and the Docker Compose plugin on a Raspberry Pi running Debian 13 (trixie), arm64 — straight from Docker's official apt repository.
This repository provides the fastest, most reliable way to install Docker on a Raspberry Pi. Instead of the unofficial get.docker.com convenience script or out-of-date distro packages, it adds Docker's official apt repository so you get up-to-date, GPG-verified packages and clean upgrades via apt.
Run the installer directly on your Raspberry Pi:
curl -fsSL https://raw.githubusercontent.com/net-shell/raspberry-pi-docker-compose/main/install-docker.sh | bashHeads up: Piping a script into
bashruns it immediately. If you'd rather read before you run (recommended), download and inspect it first:curl -fsSL -o install-docker.sh https://raw.githubusercontent.com/net-shell/raspberry-pi-docker-compose/main/install-docker.sh less install-docker.sh # review what it does bash install-docker.sh # then run it
After it finishes, log out and back in (or run newgrp docker) so your user's new docker group membership takes effect. Then verify:
docker --version
docker compose version
docker run --rm hello-worldThe install-docker.sh script performs a standard, idempotent Docker installation:
- Installs prerequisites —
ca-certificatesandcurl. - Adds Docker's official GPG key to
/etc/apt/keyrings/docker.ascfor package signature verification. - Adds Docker's official apt repository for Debian, auto-detecting your architecture (
dpkg --print-architecture) and release codename (from/etc/os-release). - Installs the full Docker stack:
docker-ce— Docker Enginedocker-ce-cli— the Docker command-line clientcontainerd.io— the container runtimedocker-buildx-plugin— multi-platform image buildsdocker-compose-plugin— Docker Compose v2 (docker compose)
- Adds your user to the
dockergroup so you can run Docker withoutsudo. - Prints the installed versions of Docker and Docker Compose.
The script uses set -euo pipefail, so it stops immediately on any error rather than continuing in a broken state.
| Requirement | Detail |
|---|---|
| Hardware | Raspberry Pi (3, 4, 5, or Zero 2 W) — any 64-bit capable board |
| OS | Debian 13 (trixie) or Raspberry Pi OS (64-bit, Debian-based) |
| Architecture | arm64 / aarch64 |
| Privileges | A user with sudo access |
| Network | Internet access to reach download.docker.com |
Although it targets Debian 13 (trixie) on a Raspberry Pi, the script is plain Debian apt setup and works on other Debian-based systems and architectures because it auto-detects the codename and architecture.
- Up-to-date packages — you get current Docker Engine releases, not the older versions shipped in distro repos.
- Verified and trusted — packages are GPG-signed and installed from Docker's official source.
- Clean upgrades — update Docker like any other package with
sudo apt-get update && sudo apt-get upgrade. - Includes Compose v2 — the
docker composeplugin is installed alongside the engine; no separatedocker-composebinary orpipinstall needed.
# Check versions
docker --version
docker compose version
# Run a test container
docker run --rm hello-world
# Start a multi-container app from a compose file
docker compose up -d
# Enable Docker to start on boot
sudo systemctl enable --now dockerDoes this work on Raspberry Pi OS? Yes. Raspberry Pi OS (64-bit) is Debian-based, and the script auto-detects the release codename and architecture.
Is it safe to run curl ... | bash?
The script only adds Docker's official repository and installs official Docker packages. For full transparency, read install-docker.sh before running, or download and inspect it as shown in the Quickstart.
Why do I get a permission error when running docker without sudo?
Your group membership hasn't refreshed yet. Log out and back in, or run newgrp docker.
Does this install docker-compose (the old v1 binary)?
No. It installs Docker Compose v2 as the docker-compose-plugin, used via docker compose (with a space).
Will this work on a 32-bit Raspberry Pi OS? This is intended for arm64 (64-bit). Use a 64-bit OS image for best compatibility with current Docker releases.
Raspberry Pi Docker install · install Docker on Raspberry Pi · Docker Compose Raspberry Pi · Docker Engine arm64 · Debian 13 trixie Docker · Raspberry Pi OS Docker setup · Docker apt repository · docker compose plugin · one-line Docker installer · curl | bash Docker script.
This project is provided as-is. See the repository for license details.
- Repository: https://github.com/net-shell/raspberry-pi-docker-compose
- Docker Engine docs: https://docs.docker.com/engine/install/debian/
- Docker Compose docs: https://docs.docker.com/compose/