DEV Community

klo2k
klo2k

Posted on β€’ Edited on

4 2

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

Install docker, docker-compose in Ubuntu 24.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 -o /etc/apt/keyrings/docker.asc
chmod 0644 /etc/apt/keyrings/docker.asc
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-compose-plugin

# Add yourself to 'docker' group
sudo usermod --append --groups docker "${USER}"

# 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 πŸ˜‰

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay