×
Community Blog How to Install Docker on Alibaba Cloud ?

How to Install Docker on Alibaba Cloud ?

This article provides step-by-step instructions on how to install Docker on an Alibaba Cloud ECS instance.

To install Docker on Alibaba Cloud, you can follow the steps outlined below:

1.  Create an Alibaba Cloud ECS Instance:

  • Log in to the Alibaba Cloud Console.
  • Navigate to the Elastic Compute Service (ECS) section.
  • Click on Create Instance to create a new ECS instance.
  • Select the desired instance type, region, and other configuration options according to your requirements.
  • Configure the network settings, storage, and security group for the
  • Complete the instance creation process by following the on-screen instructions.

2.  Connect to the ECS Instance:

  • Once the ECS instance is created, you need to connect to it using SSH.
  • Retrieve the SSH key pair associated with the instance or create a new one during instance creation.
  • Use an SSH client (e.g., PuTTY for Windows or OpenSSH for Linux/macOS) to connect to the ECS instance's public IP address or domain name.

3.  Update the System Packages:

After connecting to the ECS instance via SSH, update the system packages to ensure you have the latest versions:

sudo apt update
sudo apt upgrade

4.  Install Docker:

  • Install the Docker dependencies by running the following command:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
  • Add the Docker GPG key to the system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  • Add the Docker repository to the system's software sources:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • Update the package index again:
sudo apt update
  • Install Docker:
sudo apt install docker-ce docker-ce-cli containerd.io

5.  Verify the Docker Installation:

  • Check the Docker version to confirm the successful installation:
docker version

6.  (Optional) Allowing Non-root Users to Use Docker (Recommended):

  • By default, Docker requires root or sudo privileges to run commands. To allow non-root users to use Docker, you can add them to the "docker" group:
sudo usermod -aG docker <username>

Replace with the actual username of the non-root user.

  • To apply the changes, either reboot the ECS instance or run the following command:
newgrp docker

That's it! You have successfully installed Docker on your Alibaba Cloud ECS instance. You can now use Docker to deploy and manage containers on your Alibaba Cloud infrastructure.

0 1 0
Share on

Dikky Ryan Pratama

63 posts | 14 followers

You may also like

Comments

Dikky Ryan Pratama

63 posts | 14 followers

Related Products