DEV Community

klo2k
klo2k

Posted on • Edited on

Install docker, docker-compose in Ubuntu 22.04 in 5 commands

The official guide takes a bit of reading...

So here's the TL;DR version of it, in 5 commands:

# Install Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-compose-plugin

# Install docker-compose
sudo ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose
Enter fullscreen mode Exit fullscreen mode

Add yourself to docker group (no need for sudo docker every time)

sudo usermod -aG docker $USER
Enter fullscreen mode Exit fullscreen mode

Profit 😉

Top comments (0)