DEV Community

Cover image for Install docker and docker-compose on ubuntu 20.04
goffity
goffity

Posted on

Install docker and docker-compose on ubuntu 20.04

Docker

Add dependency and install prerequisite packages

apt update
apt install -y apt-transport-https ca-certificates curl software-properties-common
Enter fullscreen mode Exit fullscreen mode

Add docker repository

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
Enter fullscreen mode Exit fullscreen mode

Install Docker

apt install docker-ce
systemctl status docker

Enter fullscreen mode Exit fullscreen mode

Docker compose

mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
docker compose version
Enter fullscreen mode Exit fullscreen mode

Discussion (0)