更新于
Install Docker Engine on Debian and Ubuntu (2026)
Systems: Ubuntu 24.04 (Noble), 25.10 (Questing), 22.04 (Jammy); Debian 13 (Trixie), 12 (Bookworm), 11 (Bullseye).
Step 0: Remove old Docker config (critical)
Remove all old Docker sources and keys to avoid conflicts:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
sudo apt-get remove --purge -y $pkg || true
done
sudo rm -f /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/docker.sources
sudo rm -f /etc/apt/sources.list.d/*docker*
sudo rm -f /etc/apt/keyrings/docker* /usr/share/keyrings/docker* /usr/share/keyrings/*docker*
sudo apt-get update
Then add the official Docker APT repo (deb822 format), install docker-ce, and add your user to the docker group so you can run Docker without sudo. For the exact repo and package steps, see the Chinese version of this guide.