# docker installation This documentation shows how to install docker from the docker ppa ### Create users and groups First create a user and group `cloud` ```bash useradd -u 1002 -m cloud ``` Add the user `cloud` to the sudo group ```bash usermod -a -G sudo cloud ``` Add a `docker` group ```bash groupadd docker ``` Add the user `cloud` to the docker group ```bash usermod -aG docker cloud ``` Gibe the user the bash shell ```bash usermod --shell /bin/bash cloud ``` ### basic dependencies Install some basic dependencies ```bash apt update && apt upgrade -y && apt install vim screen lsof apt-transport-https ca-certificates curl software-properties-common -y ``` Ubuntu 20.04 ```bash 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 ```bash curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ``` Now add the apt configuration for the repository ```bash add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ``` You could also alternatively add the `testing`repository instead of the `stable`repository ```bash add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) test" ``` ### install docker ```bash apt update && apt install docker-ce docker-ce-cli containerd.io -y ``` ### install docker-compose Get the latest docker-compose ```bash 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 ```bash chmod +x /usr/local/bin/docker-compose ``` And check if `docker-compose` works ```bash docker-compose --version ``` This should give a response like this ```bash docker-compose version 1.25.0-rc2, build 661ac20e ```