Install Docker on Linux
Install Docker and run your first container.
- For a test machine, the official convenience script is the quickest. For a production server, prefer your distribution's official repository (see the Docker documentation).
- Download, read, then run the script:
curl -fsSL https://get.docker.com -o get-docker.sh less get-docker.sh sudo sh get-docker.sh
- Test with a minimal container:
sudo docker run --rm hello-world
- To use docker without sudo, add yourself to the group (log out and back in required):
sudo usermod -aG docker $USER
- Common commands:
docker ps -a docker images docker system prune
⚠️ Being in the docker group is equivalent to root access on the machine: reserve it for trusted accounts.