Home How to Install Docker and Docker Compose Ubuntu
Post
Cancel

How to Install Docker and Docker Compose Ubuntu

This guide will walk you through how to Install Docker Engine, containerd, and Docker Compose on Ubuntu.

If you have an existing version of Docker install, it is best to remove it first. See the Cleaning Up

if you’re installing this on Debian, see Docker’s Debian Install Guide

1
2
3
4
5
6
sudo apt-get update
sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
1
2
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
1
2
3
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
1
2
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Check Installed version

1
docker -v

Check docker compose

1
docker compose

Check runtime

1
 sudo docker run hello-world

Use Docker without sudo

1
sudo usermod -aG docker $USER

You’ll need to log out then back in to apply this

Cleaning Up

If you need to uninstall Docker, run the following

1
 sudo apt-get remove docker docker-engine docker.io containerd runc

⚙️ See all the hardware I recommend at https://l.technotim.live/gear

🚀 Don’t forget to check out the 🚀Launchpad repo with all of the quick start source files

This post is licensed under CC BY 4.0 by the author.

Self-Hosted, DIY, Open Source Alternative to Linktree

Meet File Browser, a Small but Mighty Web File Browser