Blog Logo

3-Mar-2024 ~ 1 min read

Installing Docker and Docker Compose on Ubuntu via Terminal


Installing Docker and Docker Compose on Ubuntu via Terminal

Installing Docker and Docker Compose on Ubuntu via the terminal is a straightforward process that can be accomplished with a few simple commands. In this guide, we’ll walk you through the steps to install both Docker and Docker Compose on your Ubuntu system.

Script:

sudo apt update
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 focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

docker --version
docker-compose --version

That’s it! You have successfully installed Docker and Docker Compose on your Ubuntu system using the terminal.

Conclusion:

Installing Docker and Docker Compose on Ubuntu via the terminal is a simple process that involves adding the Docker repository, installing Docker CE, and then downloading and configuring Docker Compose. Once installed, you can start using Docker and Docker Compose to build, deploy, and manage your containerized applications with ease.