Install Docker Ubuntu 20.04 Lts

2/12/2022by admin
  1. Sep 06, 2020 While Docker is available on Windows, Mac, and various Linux distributions, we'll be working off an Ubuntu 20.04 server. $ lsbrelease -a Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal. Spin up and SSH into the server. When working with Linux, Docker follows the same basic steps when installing Docker.
  2. Docker and Nvidia Docker installation in Ubuntu 20.04 LTS - install-docker.sh.

While Docker is available on Windows, Mac, and various Linux distributions, we'll be working off an Ubuntu 20.04 server. $ lsbrelease -a Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal. Spin up and SSH into the server. When working with Linux, Docker follows the same basic steps when installing Docker.

Docker is an open source virtualization and containerization technology for building and containerizing your applications. It's a tool that allows you to create isolated containers that can be used to run your apps. In this tutorial, we'll go step by step in the process of installing the latest version of docker v19 on Ubuntu 20.04 LTS. We'll also see how to install docker-compose which is an indispensable tool for running multiple docker containers in your machine.

According to the official docs:

Docker Engine is an open source containerization technology for building and containerizing your applications. Docker Engine acts as a client-server application with:- A server with a long-running daemon process dockerd.- APIs which specify interfaces that programs can use to talk to and instruct the Docker daemon.- A command line interface (CLI) client docker.

We'll see how to:

  • Install docker 19 from the official Ubuntu 20.04 repositories
  • Enable docker to start after the system reboot
  • Install docker-compose from the official Ubuntu repositories,
  • Install the latest docker-compose version from the GitHub repository.

Before you can install docker in your Ubuntu 20.04 machine, make sure you have access to your system as root or you have the sudo rights.

How to Install Docker On Ubuntu 20.04 LTS Step by Step

Let's now see the required steps to install the latest version of docker on Ubuntu 20.04 LTS.

Open a new terminal and run the following command:

This will install the docker.io package from the official Ubuntu 20.04 repositories.

Wait for the process to complete and run the following command to start and set it to start after the system reboot:

Next, ensure you have docker installed by running the following command:

You should have the docker version displayed in your terminal.

Docker Ubuntu Install

Finally, you can run docker test using the hello-world container:

You should get the following output:

How to Install Docker-Compose on Ubuntu 20.04

Now that we have installed docker on our machine, let's also see how we can install docker compose.

In this section, we'll see how to:

  • Install docker-compose from the official Ubuntu 20.04 repositories,
  • Install the latest docker-compose version from the official GitHub repository.

Compose is an accompanying tool for docker that makes it easy to set up and run multi-container docker apps.

It allows you to automate creating and starting all the services required from running your app such as a database server and an HTTP server, etc. and communicate between all the entities without issues.

According to the official docs:

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. To learn more about all the features of Compose, see the list of features.

Install the Stable Docker-Compose Version from the Ubuntu Repository

In most cases, it's recommended that you install docker-compose from an official Ubuntu repository for a stable version but in case you need the latest version that's not available from the official repositories, you can install it from the source code available from its GitHub repository.

Head back to your terminal and run the following command to installing docker-compose using apt:

Wait for the process to complete, next run the following command to check that docker-compose has been successfully installed:

Install Docker Ubuntu 20.04 Lts

Install the Latest Docker-Compose Version from GitHub

Docker

If you want to install the latest available docker-compose version, you need to use the repository from GitHub to build it locally:

You can check the version using the following command:

Install Docker Ubuntu 20.04 Lts 64-bit

Conclusion

Ubuntu Download

We have seen the required steps for installing docker 19 and docker-compose in our Ubuntu 20.04 machine using the official Ubuntu repositories.

Docker Ubuntu Image

Docker is a powerful tool for creating development environments that provides you with lightweight containers which use the same kernel as your system but provides independent environment or operating systems for building and running your apps without interfering with the apps in your system or other containers.

Comments are closed.