Hands-on!

# update the current list of packages
sudo apt update

# installing packages
sudo apt install apt-transport-https ca-certificates curl software-properties-common

# adding GPG key from the official Docker repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# add Docker's repository to the apt source list
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

# update again
sudo apt update

# finally, install docker
sudo apt install docker-ce

# and install docker-compose:
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# create the docker group and add your current user to it
sudo usermod -aG docker ${USER}

# checking if it works
id -nG
sudo docker login
# type to build and run the container
sudo docker pull hello-world

# type to access a new container. The 'hello-world' is just a test container to check if everything is installed and running
sudo docker run hello-world
# to install subversion and git
sudo apt-get install subversion git

References