How to install Docker on Linux


Docker is a fairly common container utility, designed to simplify tasks such as developing and deploying applications on Linux distributions. To learn how to delete the old Docker as well as how to install Docker on Linux, read along with the following article of Taimienphi.vn.


Virtualization technology, containers are increasingly popular, offering users the benefits of isolation, security and mobility. For example, if you provide some type of cloud service, these services will make it easier to isolate your customers’ data and services. If you’re a Linux application developer, you’ll quickly realize how difficult it is to make the app available to all Linux distributions.

After your program works in Ubuntu, it will also work in Arch Linux, Debian and other Linux distributions. Every Linux distribution will be different, and you’ll have to make adjustments so that utility features are included in the distributions.

Containers help develop, deploy applications easier on the distribution. Instead of relying on the operating system to provide what your application needs, all dependencies are packaged in a container. Once the container is operational, you can move it from computer to computer and between operating systems easily.

installing docker on linux 2

Docker is a fairly common container utility, designed to simplify such tasks. Moreover, when there are problems with the operating system, instead of having to install and reconfigure the application, we just need to reinstall the operating system, copy the container and continue.

Refer to the following article of Taimienphi.vn to learn how to install Docker on Linux.

Delete old Docker settings

This step is optional, only required if you have installed older versions of Docker, as older versions may conflict with newer versions, especially in the case if these versions are Install from different repositories.

On Debian or Ubuntu, to delete the old version of Docker, use the following command:

sudo apt –purge autoremove docker docker-engine docker.io containerd runc

On Fedora:

sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

How to install Docker on Ubuntu

Open the Terminal emulator and install the prerequisites:

sudo apt update && sudo apt install software-properties-common gnupg2 curl ca-certificates apt-transport-https

Check the Docker’s GPG lock fingerprint:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg

installing docker on linux 3

At the time of writing, the fingerprint is 9DC858229FC7DD38854AE2D88D81803C0EBFCD88. However fingerprints may change in the future.

Check the official Docker homepage to see if the fingerprint matches. The key is used to verify the digital signature, so you can ensure that the software you are installing is legitimate and not malware uploaded to the server by the attacker.

After confirming the correct key, the next step is to add the APT reliable keys:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

Add Docker repositories for Ubuntu to your software sources.

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

Install Docker using the command:

sudo apt update && sudo apt install docker-ce

If needed, you can install Docker Compose using the command:

sudo apt install docker-compose

Most of the way docker commands start with sudo. If you don’t want to enter your password multiple times, you can add users to the docker group.

sudo adduser $ USER docker

Log out of the user interface and log back in. You can now use commands like docker ps instead of sudo docker ps.

Install Docker on Debian

Because Ubuntu is based on Debian, the steps to install Docker on Debian are similar:

sudo apt update && sudo apt install software-properties-common apt-transport-https ca-certificates curl gnupg2

Check that the fingerprint matches the previous version:

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg

Add a trusted key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add –

Add software sources:

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

Install Docker using the command:

sudo apt update && sudo apt install docker-ce

If needed, you can install Docker Compose using the command:

sudo apt install docker-compose

To use the Docker command without the sudo prefix:

sudo adduser $ USER docker

Finally log out and log back in.

Install Docker on Fedora

Install prerequisites:

sudo dnf install dnf-plugins-core

Add the Docker software repository:

sudo dnf config-manager –add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Install Docker:

sudo dnf install docker-ce

installing docker on linux 4

On some systems, this process may take some time to complete and sometimes you may feel like the process is hanging. Your task is to wait until the process is complete.

To enable Docker to start automatically on startup, use the following command:

sudo systemctl enable docker.service

Open Docker using the command:

sudo systemctl start docker.service

Add users, that is, you in the Docker group:

sudo usermod -aG docker $ USER

Finally log out and log back in.

Also, if you want to install Docker Compose, you use the command:

sudo dnf install docker-compose

Install Docker on Arch Linux

Arch has Docker included in the community repository, so the steps to install Docker on Arch Linux will be simpler.

sudo pacman -S docker

installing docker on linux 5

If you want to install Docker Compose:

sudo pacman -S docker

Add users, that is, you in the Docker group:

sudo pacman -S docker-compose

Log out and log back in to apply the settings.

Activate Docker to automatically start:

sudo systemctl enable docker

Run the Docker service:

sudo systemctl start docker

https://thuthuat.taimienphi.vn/cach-cai-dat-docker-tren-linux-44102n.aspx
The article above Taimienphi.vn has just taught you how to install Docker on Linux, you refer to how Install Hyperledger Fabric on Ubuntu here. If you have any questions or questions, you can leave your comments in the comment section below the article, Taimienphi.vn will answer your questions as soon as possible.

.

Add a Comment

Your email address will not be published. Required fields are marked *