02-03-2022

Install Docker @ Ubuntu VPS

Install docker

To install docker you don't need a lot of things. Just copy + paste the following commands.

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

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

sudo apt update

sudo apt install docker-ce

Make sure it's working:

sudo systemctl status docker

If everything went well, you could see something like the following:


docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-07-26 12:31:55 UTC; 1 day 23h agoDocs: https://docs.docker.com

When we can see the loaded & active texts, we are good to go.

To make our work easier in the future, add ourselves to docker group. With the help of this, you don't have to use sudo command in the future.

sudo usermod -aG docker ${USER}

Now install docker compose also:

curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url  | grep docker-compose-linux-x86_64 | cut -d '"' -f 4 | wget -qi -
sudo chmod +x docker-compose-linux-x86_64
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose

Now you can check ther version via:

docker-compose version

That's all! Have a nice day!

© 2024 PappZ. All rights reserved.