How to Install Docker and Docker Compose on Ubuntu Server using get-docker.sh Script

A simple method to install docker and docker compose on linux in just 3 commands.

How to Install Docker and Docker Compose on Ubuntu Server using get-docker.sh Script
Photo by Rubaitul Azad / Unsplash

Docker and Docker Compose are powerful tools for developers and system administrators alike. They enable you to run applications in isolated containers, promoting consistency, portability, and efficient resource management. Today, we'll explore how to effortlessly install both on your Ubuntu server using the official get-docker.sh script.

Benefits of Using get-docker.sh:

  • Simple and Efficient: This script automates the installation process, saving you time and effort compared to manual configuration.
  • Official Source: Downloading from the official Docker repository ensures you're getting the latest stable version and reliable updates.
  • Streamlined Workflow: Once installed, you'll be ready to leverage containerized applications and development environments with ease.

Prerequisites:

  • An Ubuntu server with internet access.
  • Administrative (sudo) privileges.
  • Basic familiarity with the terminal and sudo commands.

Step 1: Update Your System

First, SSH into your server and update your package index to ensure you have the latest information about available packages.

sudo apt update && sudo apt dist-upgrade

Step 2: Download and Run the get-docker.sh Script

The get-docker.sh script is an official Docker installation script that simplifies the installation process.

Download the script:

curl -fsSL https://get.docker.com -o get-docker.sh

Run the script:

sh get-docker.sh

This script will install Docker Engine, Docker CLI, Docker Compose and containerd.

Docker and Docker Compose installation process

When the installation finish, you will see Docker version on the terminal screen as follow:

Docker and Docker Compose installation finished

Step 3: Verify Docker Installation

After the installation is complete, verify that Docker is installed correctly by running the following commands:

docker --version
docker compose version

You should see the version number of Docker and Docker Compose, confirming that it is installed correctly.

Conclusion:

By following these steps, you've successfully installed Docker and Docker Compose on your Ubuntu server using the get-docker.sh script. Now, you're ready to leverage the power of containerized applications and development environments to streamline your workflow and enhance your development experience.

Additional Notes:

  • Remember to restart your terminal session after installation for the changes to take effect.
  • Consult the official Docker and Docker Compose documentation for further details and advanced usage.

I hope this blog post has been helpful! Feel free to leave any comments or questions below.