Open In App

How To Install Docker Engine On AWS Debian Linux Server?

Last Updated : 26 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The installation of Docker Engine on a Debian system is an initial step in deploying containerized applications. In this article, we explain how to perform effortless setup of Debian operating system and install Docker on top of this to adopt containerization technology. This article provides thorough step-by-step guidelines for Docker Engine installation. Understand the potential of containerization on Debian as we work through fundamental ideas and real-world applications.

What is Docker?

By providing containerization—a lightweight, portable approach that enables apps to execute effectively across diverse environments—Docker revolutionizes software deployment. Docker containers simplify the development, testing, and deployment processes by encapsulating a program and all of its dependencies in a self-contained, isolated environment.

What is the Debian operating system?

Debian is a well-known, dependable open-source operating system that is known for its stability and efficient package management system. It supports a variety of computing requirements and provides a solid foundation for both desktop and server setups. It facilitates both developers and system administrators who are looking for a flexible and safe platform. Debian is always a preferred option because of its dedication to the principles of free software and its well-maintained repository.

Step-by-Step Guide: Install Docker Engine on Debian

Firstly, let’s setup a Debian operating system on the AWS cloud platform, then go for the installation of the Docker Engine. The following is a step-by-step guide to this.

Step 1: Login to an Amazon Account

  • Navigate to the AWS account login console in your browser.
  • Login to the AWS account with your credentials.

AWS-login-in

Step 2: Navigate To EC2 Dashboard

  • After successfully login in to AWS account, Navigate to the Console home to EC2 Dashboard.
  • Click on the “Launch Instance” for creating the instance with debian operating system.

EC2-Dashboard

  • Provide the Name to this create instance Ex: my_debian_instance
  • Select the debian AMI image.
  • Specify the number of Instances labeled box in the right side with 1 as shown in the below screenshot.

Selecting-Debian-AMI

Step 3: Configure The Network Security Groups

  • Go for the Network security groups in that page.
  • Click on edit option beside to that name.
  • Now configure the network as shown in the below figure, allow the inbound traffic, to don’t face any network issue form the AWS account side.

Note: To improve the security you can restrict the inbound traffic.

Network-Security-Groups

Step 4: Connect To The Instance

  • Wait till the creating instance comes from the pending state to running state.
  • Once the instance came to the running state connect to it.

6-Connecting-to-Instance

Step 5: Establishing SSH connection With Local System

  • Go the ssh section in the networking section.
  • Then copy the ssh command from their.

SSH-Section

Step 6: Update System Software

  • Open the command line in the local system and redirect to the directory where ssh key is present.
  • Now run the ssh command and establish the remote login from the local system.
  • After successful connecting with remote login, update and upgrade the system software with the following commands.
sudo apt update     
sudo apt upgrade -y

  • The below screenshot shows practical execution of above two command updating and upgrading of system software.

Updating-the-system

Step 7: Install Docker Dependencies

  • Install necessary packages for Docker installation with the following command:
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release

Install-the-docker-dependencies

Step 8: Add Docker GPG Key

  • Add Docker’s official GPG key to ensure package integrity with following command:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg \
--dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Adding-Docker-gpgkey

Step 9: Set up Docker Repository

  • Run the following command for configuring the Docker repository for Debian.
echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]  \
https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Configuring-The-Docker-Registry

Step 10: Install Docker Engine

  • Update the package index with below showing command `sudo apt update` and then install the Docker with ` sudo apt install -y docker-ce docker-ce-cli containerd.io`
     sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io

Installing-The-DockerStep 11: Start and Enable Docker

  • Start the Docker service and enable it to start on boot with the following commands:
 sudo systemctl start docker
sudo systemctl enable docker

  • The below screenshot shows the starting of the docker service by executing the above command.

Starting-The-Docker-Servie

Step 12: Verify Installation

  • Check Docker version and run a test container with the following commands.
 docker --version

Verfying-the-Docker

and

docker run hello-world

Running-The-Docker-Container

Your AWS Debian instance is now available with Docker Engine, allowing you to efficiently deploy and manage your containers.

Docker On Debain System – FAQ’s

How To Install Docker Engine On Debian 11?

On using following commands you can install the docker engine:

sudo apt update
sudo apt install -y docker.io
sudo systemctl enable --now docker

How To Install Docker Engine Only?

For installing only docker engine, try on executing the following commands in debian Environment:

sudo apt update
sudo apt install -y docker.io

Which Is better Debian Or Ubuntu?

The choice of choosing between Debian and Ubuntu depends on your preferences and needs. Debian is known for its stability whereas Ubuntu is choosed while considered more user-friendly with regular releases and extensive community support. Choose The OS based on your specific requirements and experience level.

Is Docker Engine And Docker Daemon The Same?

Yes, Both the terms “Docker Engine” and “Docker daemon” are commenly used interchangeably. The Docker daemon is a part of the Docker Engine and is responsible for managing Docker containers on a system.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads