Install Docker on Linux



This guide will walk you through the steps to install Docker and Docker Compose on a Linux system.

Step 1: Update Package Index

sudo apt-get update

Step 2: Install Dependencies

sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Step 3: Add Docker's Official GPG Key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Step 4: Add Docker Repository to APT Sources

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Step 5: Update Package Index Again

sudo apt-get update

Step 6: Install Docker

sudo apt-get install -y docker-ce docker-ce-cli containerd.io

Step 7: Add Current User to Docker Group

sudo usermod -aG docker $USER

Step 8: Install Docker Compose

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Step 9: Apply Executable Permissions to Docker Compose Binary

sudo chmod +x /usr/local/bin/docker-compose

Step 10: Verify Installation

Print Docker and Docker Compose versions:

echo "Docker version:"
docker --version
echo "Docker Compose version:"
docker-compose --version
docker, docker hub, docker desktop, dockers pants, docker compose, docker install ubuntu, docker vs kubernetes, docker run, docker build, docker install, docker container, docker download, docker alternatives, docker alpine, docker attach to running container, docker and kubernetes, docker arg, docker add vs copy, docker api, docker architecture, docker app, docker aws, add user to docker group, alpine docker, ansible docker, aws docker, airflow docker, azure docker, apt install docker, add vs copy docker, apache docker, arg docker, docker build command, docker buildx, docker build no cache, docker build args, docker build dockerfile, docker buildkit, docker bind mount, docker buildx build, docker build show all output, brew install docker, build docker image, busybox docker, bitwarden docker, bind mount docker, buildx docker, buildkit docker, build docker, build args docker, bridge network docker, docker compose up, docker commands, docker compose volumes, docker compose build, docker copy, docker compose file, docker cp, docker cli, container docker, copy docker, command docker compose, compose docker, cheat sheet docker, cli docker, command to run docker, command docker build, commands docker, cp docker, docker desktop download, docker delete image, docker desktop for windows, docker delete container, docker desktop for mac, docker documentation, docker docs, docker daemon, download docker, docker in docker image, docker hub docker, docker and docker compose, docker in docker container, docker install docker, docker volumes docker compose, docker in docker windows, docker in docker ubuntu, docker registry docker, docker exec, docker entrypoint, docker exec into container, docker engine, docker environment variables, docker expose port, docker expose, docker entrypoint vs cmd, docker engine stopped, docker export image, elasticsearch docker, entrypoint docker, export docker image, expose docker, expose port docker, env docker, entrypoint vs cmd docker, entrypoint docker compose, env file docker compose, environment variables docker, docker for windows, docker for mac, docker file, docker file example, docker from, docker force rebuild, docker for desktop, docker for linux, docker for dummies, docker flags, from python docker, from docker to kubernetes, file docker compose, from command docker, from docker file, from command not found docker, from docker image, from ubuntu docker, from docker.io, from node docker, docker github, docker gui, docker getting started, docker golang, docker glassdoor, docker grafana, docker gpu, docker group, docker group membership error, docker gitlab, grafana docker, gitlab docker, get docker, gitlab runner docker, golang docker, gitea docker, gitlab docker registry, guacamole docker, github docker, github docker registry, docker hello world, docker hub login, docker hat, docker healthcheck, docker hub python, docker hub postgres, docker hub ubuntu, docker hub nginx, docker hub node, how to install docker on ubuntu, how to install docker, how to run docker, how to docker compose, how to download docker, how to build docker, how to login to docker, how to docker compose up, how to prune docker, how to build docker compose, docker images, docker invalid reference format, docker in docker, docker interview questions, docker image vs container, docker install mac, docker image prune, install docker, install docker ubuntu, install docker windows, install docker compose, install docker ubuntu 22.04, image docker, interview questions on docker, invalid reference format docker, is docker a container, . in docker build command, docker jobs, docker jenkins, docker jellyfin, docker jeans, docker java, docker jupyter notebook, docker jacket, docker jackett, docker jammy, docker jenkins/jenkins, jenkins docker, jacob bernard docker, jenkins docker image, jellyfin docker, jenkins docker plugin, jenkins agent docker, jupyter notebook docker, java docker image, jenkins docker compose, jupyter docker, docker kill all containers, docker kill container, docker kubernetes, docker kafka, docker keep container running, docker keycloak, docker khaki pants, docker kali linux, docker kubernetes tutorial, docker kibana, kubernetes vs docker, keycloak docker, kafka docker, kubernetes docker, kafka docker image, kafka docker compose, kill docker container, keycloak docker compose, kibana docker, kaniko docker, docker login, docker list containers, docker logs, docker list images, docker logo, docker load, docker logs tail, docker list running containers, docker linux, docker latest version, linux install docker, learn docker, localstack docker, list docker images, lxc vs docker, latest docker version, linux docker, laravel docker, list docker containers, latest docker compose version, docker mac, docker mysql, docker mount volume, docker minecraft server, docker mount, docker multistage build, docker mongodb, docker mount local directory, docker mariadb, docker meaning, mysql docker, mongodb docker, mariadb docker, mac docker, minio docker, mssql docker, mysql docker compose, mongodb docker compose, minio docker compose, mac start docker daemon, docker nginx, docker networking, docker no space left on device, docker node, docker network create, docker network host, docker nvidia, docker nextcloud, docker network bridge, docker name container, nginx docker, nextcloud docker, node docker, nvidia docker, node docker image, no space left on device docker, netbox docker, docker node js, nextjs docker, nextcloud docker compose, docker on windows, docker on mac, docker override entrypoint, docker on raspberry pi, docker on proxmox, docker overlay2 cleanup, docker overlay2, docker on ubuntu, docker os, docker osx, opensearch docker, ollama docker, openjdk docker, openvpn docker, oracle docker, odoo docker, openldap docker, openwrt docker, openvas docker, owncloud docker, docker prune, docker pull, docker postgres, docker ps, docker push, docker pants, docker python, docker port mapping, docker prune all, docker prune images, podman vs docker, postgres docker, play with docker, python docker, pihole docker, portainer docker, prometheus docker, pgadmin docker, php docker, pull docker image, docker qbittorrent, docker quickstart, docker qemu, docker quickstart terminal, docker qbittorrent vpn, docker questions, docker qnap, docker quick tutorial, docker qdrant, docker quit container, qbittorrent docker, qnap docker, qemu docker, quay docker, qdrant docker, quarkus docker, qbittorrent docker compose, qbittorrent vpn docker, qgis docker, questions on docker, docker run command, docker registry, docker remove image, docker remove container, docker run image, docker remove all images, docker restart container, docker run environment variables, docker repository, redis docker, remove docker images, rabbitmq docker, remove all docker images, run docker image, restart docker container, restart docker, run docker compose, remove docker container, redis docker compose, docker swarm, docker stop container, docker stop all containers, docker system prune, docker save, docker start container, docker start, docker swarm vs kubernetes, docker scout, docker shoes, start docker daemon, stop docker container, start docker daemon mac, sonarqube docker, ssh into docker container, sql server docker, synology docker, start docker container, spring boot docker, stop all docker containers, docker tutorial, docker tag, docker tag image, docker tail logs, docker toolbox, docker training, docker terminal, docker top, docker tedeschi, docker traefik, tail docker logs, tutorial docker, tag docker, to install docker on ubuntu, the docker daemon, to start docker daemon, to install docker on windows, to stop docker container, to remove all images in docker, the docker cli, docker ubuntu, docker ubuntu image, docker ubuntu install, docker update, docker update image, docker user, docker ubuntu 22.04, docker uninstall, docker unknown server os, docker up, ubuntu install docker, ubuntu docker image, uninstall docker ubuntu, uninstall docker, ubuntu install docker-compose, unifi controller docker, update docker, ubuntu 22.04 install docker, unifi docker, update docker image, docker volumes, docker versions, docker vs podman, docker volume mount, docker vs vm, docker volume create, docker vs containerd, docker vs docker-compose, docker volume prune, volumes docker, vscode docker, vagrant vs docker, vaultwarden docker, vm vs docker, vault docker, vaultwarden docker compose, version docker compose, version docker, verbose docker build, docker windows, docker workdir, docker watchtower, docker wsl, docker wyze bridge, docker wordpress, docker windows install, docker without sudo, docker wiki, docker windows container, windows docker, what is docker container, what is docker compose, what is docker image, what is docker desktop, what is docker swarm, what is kubernetes vs docker, what is docker hub, what is docker volume, what is docker registry, docker x11 forwarding, docker x11, docker x86 on m1, docker x11 display, docker xcode, docker xvfb, docker xampp, docker x86_64, docker xhost, xwiki docker, xteve docker, xampp docker, xibo docker, xvfb docker, xdebug docker, x11 docker, xen orchestra docker, xdebug docker vscode, xdebug phpstorm docker, docker yaml, docker youtube, docker yacht, docker yum repo, docker yaml file example, docker youtube downloader, docker yarn, docker yocto, docker yaml volumes, docker youtube-dl, yum install docker, you must be in the docker-users group, yacht docker, yum install docker-compose, youtube docker, you are not allowed to use docker, yum update docker, yocto docker, yt-dlp docker, youtrack docker, docker zookeeper, docker zabbix, docker zfs, docker zscaler, docker zigbee2mqtt, docker zip image, docker zsh completion, docker zsh, docker zerotier, docker zoneminder, zsh command not found docker, zabbix docker, zsh command not found docker-compose, zookeeper docker, zoneminder docker, zabbix docker compose, zigbee2mqtt docker, zipkin docker, zerotier docker, zap docker, docker 0.0.0.0, docker 0.0.0.0 refused to connect, docker 0 gb available, docker 0.0.0.0 vs 127.0.0.1, docker 0.0.0.0 not working, docker0 down, docker 0.0 0.0 vs localhost, docker-0 probably didn't start properly, docker@0 task, 0.0.0.0 docker, 0.0.0.0 vs 127.0.0.1 docker, 0 connecting to download.docker.com, 0.0.0.0 inside docker container, 0x5000 docker, 0.0.0.0 docker compose, 000webhost docker, 0x docker, 0.0.0.0 docker not working, $0 docker, docker 101, docker 1.13.1, docker 137 error, docker 127.0.0.1 refused to connect, docker 19.03, docker 127.0.0.1, docker 1.13, docker 18, docker 125, docker 172.17, 1/35 docker street elwood, 127.0.0.1 kubernetes.docker.internal, 172.17.0.x docker, 1password docker, 172.18.0.x docker, 137 docker, 1001 user in docker, 100dp slim docker, 127.0.0.1 docker, 139 exit code docker, docker 25, docker 26, docker 24, docker 20.10.25, docker 2375, docker 2024, docker 22.04, docker 20.10 eol, docker 2376, docker 23, 20 awesome docker containers, 20 docker street wagga, 255 exit code docker, 22.04 install docker, 2375 port docker, 2fauth docker, 2 docker containers communication, 2376 docker, 20.10.17 docker, 20.04 install docker, docker 32 bit, docker 3d printer, docker 3.11-slim, docker 3306 already in use, docker 3.6.0 download windows, docker 32 bit windows, docker 3d model, docker 310, docker 310cc, 3cx docker, 36 docker street wagga, 35 docker street elwood, 3/34 docker street elwood, 389ds docker, 34 docker street elwood, 36 docker street wangaratta, 37 docker street richmond, 3cx sbc docker, 3/31 docker street elwood, docker 4.27.2, docker 4.28, docker 401 unauthorized, docker 4.28.0, docker 403 forbidden, docker 4.19 download, docker 4.26, docker 429 too many requests, docker 4.23, docker 404, 403 forbidden nginx docker, 44 docker street wagga, 403 forbidden docker, 404 not found nginx docker, 403 forbidden pihole docker, 429 too many requests docker, 401 unauthorized docker, 401 unauthorized docker login, 400 bad request docker login, 404 not found docker, docker 502 bad gateway, docker 500 error, docker 504 gateway time-out, docker 503 service unavailable, docker 500 internal server error, docker 5000 port, docker 5 years experience reddit, docker 50cc, docker 500, docker 503 service temporarily unavailable, 502 bad gateway nginx docker, 504 gateway time-out nginx docker, 54 docker street wagga, 52 docker street richmond, 503 service unavailable docker, 500 internal server error docker, 500 server error docker, 502 bad gateway nginx docker compose, 502 bad gateway nginx docker laravel, 502 bad gateway nginx php-fpm docker, docker 64 bit, docker 6.1.3, docker 666, docker 64 bit raspbian, docker 6443, docker 6to4, docker 64 bit download, 6 docker street elwood, 60 docker street wangaratta, 64 docker circuit mickleham, 62 docker street richmond, 60 docker circuit mickleham, 60 best docker containers, 63 docker street richmond, 64 docker street wangaratta, 6/10 docker street elwood, 61 docker street wangaratta, 6/35 docker st elwood, docker 7zip, docker 7.0.0, docker 7 days to die, docker 7946, docker 7.4-apache, docker 777, docker 7.4-fpm, docker 7.4-fpm-alpine, docker 7ea0a9c3f273fcd8, 78 docker street richmond, 7 days to die docker, 73 docker street wangaratta, 74 docker street richmond, 74-76 docker street wangaratta, 7zip docker, 72 docker street richmond, 75 docker street wagga, 77 docker street wagga, 7/121 docker street wagga wagga, docker 8080 not working, docker 8080, docker 8.8.8.8, docker 8gb ram, docker 8.2-fpm, docker 8nv, docker 8.2-apache, docker 8.1-apache, docker 8000, 80 docker street wangaratta, 82 docker street wangaratta, 81 docker street wagga wagga, 8/30 docker street elwood, 8080/tcp not bound docker, 8n8 docker, 8080/tcp docker, 8-jdk-alpine docker, 80 port docker, 8.1-apache docker, docker 9323, docker 999 user, docker 9 letters, docker 9000/tcp, docker 999, docker 9000, docker 9000 port, docker 9001, docker 997, docker 991, 92 docker street wagga wagga, 9/10 docker street elwood, 9/7 docker street richmond, 9/10 docker st elwood, 9/7 docker street, 9/30 docker street elwood, 92 docker st, 92 docker street, 923+ docker, 999(docker)
Previous Post Next Post