How to install Docker & Docker-compose on Ubuntu 18.04

Login to the server using ssh terminal or putty

First, install docker using the below command

sudo apt-get update

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

 curl -fsSL | sudo apt-key add -

 sudo add-apt-repository -y \
 "deb [arch=amd64] \
 $(lsb_release -cs) \

 sudo apt-get -y update
 sudo apt-get -y install docker-ce

 sudo usermod -a -G docker $(whoami)

After that, install the latest version of docker-compose (the below version may not be the latest, please check the official Docker site). Type below command

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

Leave a Reply