Skip to content

net-shell/raspberry-pi-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Install Docker and Docker Compose on Raspberry Pi

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.

Shell Script Platform Docker

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.


Quickstart

Run the installer directly on your Raspberry Pi:

curl -fsSL https://raw.githubusercontent.com/net-shell/raspberry-pi-docker-compose/main/install-docker.sh | bash

Heads up: Piping a script into bash runs 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-world

What this script does

The install-docker.sh script performs a standard, idempotent Docker installation:

  1. Installs prerequisitesca-certificates and curl.
  2. Adds Docker's official GPG key to /etc/apt/keyrings/docker.asc for package signature verification.
  3. Adds Docker's official apt repository for Debian, auto-detecting your architecture (dpkg --print-architecture) and release codename (from /etc/os-release).
  4. Installs the full Docker stack:
    • docker-ce — Docker Engine
    • docker-ce-cli — the Docker command-line client
    • containerd.io — the container runtime
    • docker-buildx-plugin — multi-platform image builds
    • docker-compose-plugin — Docker Compose v2 (docker compose)
  5. Adds your user to the docker group so you can run Docker without sudo.
  6. 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.


Requirements

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.


Why use the official Docker apt repository?

  • 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 compose plugin is installed alongside the engine; no separate docker-compose binary or pip install needed.

Usage after installation

# 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 docker

Frequently asked questions

Does 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.


Keywords

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.


License

This project is provided as-is. See the repository for license details.

Links

About

install Docker on a Raspberry Pi

Resources

Stars

Watchers

Forks

Contributors

Languages