Skip to main content

docker installation

This documentation shows how to install docker from the docker ppa

Create users and groups

First create a user and group cloud

useradd -u 1002 -m cloud

Add the user cloud to the sudo group

usermod -a -G sudo cloud

Add a docker group

groupadd docker

Add the user cloud to the docker group

usermod -aG docker cloud

Gibe the user the bash shell

usermod --shell /bin/bash cloud

basic dependencies

Install some basic dependencies

apt update && apt upgrade -y && apt install vim screen lsof apt-transport-https ca-certificates curl software-properties-common -y 

Ubuntu 20.04

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

docker repository configuration

Add the repository key of the docker repository

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

Now add the apt configuration for the repository

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

You could also alternatively add the testingrepository instead of the stablerepository

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

install docker

apt update && apt install docker-ce docker-ce-cli containerd.io -y

install docker-compose

Get the latest docker-compose

curl -L  https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

Set the proper rights

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

And check if docker-compose works

docker-compose --version

This should give a response like this

docker-compose version 1.25.0-rc2, build 661ac20e