Docker and docker-compose installation

1 min read

A couple of commands for installing docker base on a VPS.

Docker

The following command will install the latest stable docker on your server.

apt update apt install -y apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" apt update apt install -y docker-ce

docker-compose

Find current stable version: https://github.com/docker/compose/releases and replace VERSION word in the following command.

VERSION=v2.11.2 curl -L https://github.com/docker/compose/releases/download/$VERSION/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose