Install Docker Compose Ubuntu 20.04

What is Docker Compose?

Step 2: Create Docker Playbook. The next thing we need to do is create the Ansible playbook that will be used to install Docker and Docker Compose on the Ubuntu servers. Edit the playbook called docker.yml and add the following contents: There is one variable that may need changed called dockercomposeversion. Docker Compose is yet another useful Docker tool. It allows users to launch, execute, communicate, and close containers with a single coordinated command. Essentially, Docker Compose is used for defining and running multi-container Docker applications. This tutorial shows you how to install Docker Compose on Ubuntu 20.04 and how to run a container.

DockerCompose is a command-line tool for defining and running multi-container applications. With Docker compose, you can run multiple containers as a single service. The containers are still isolated, but they can interact with each other. With Docker compose, you get the benefits of single-host deployment, great security, ease of setup and configuration which leads to really high productivity and efficiency.

For example, if you have an application that requires an Apache web server and MariaDB database, you can create a docker-compose.yaml file that can run both the containers as a service without the need to start each one separately.

What is Compose File?

Docker Compose uses a YAML (docker-compose.yaml) file for defining configure application services, networks and volumes. The default path for a Compose file is ./docker-compose.yaml. It contains a service definition which configures each container started for that service. With a single command, you can create and start all the services from your YAML configuration file.

In this tutorial, we will show you how to install and use Docker Compose on Ubuntu 20.04 18.04.



  • A server running Ubuntu 20.04 with Docker installed.
  • A root password is configured on your server.

Note: Please refer to my guide on How to Install and Use Docker for a more detailed reference on Docker.

Install Docker Compose Ubuntu

Docker Compose available in a single binary file. So you don’t need to install it from the Ubuntu repository. At the time of writing this article, the latest version of Docker Compose is 1.28.0. Before downloading the Docker Compose, I would recommend visiting the Docker Compose download page for the latest available version.

First, install the curl command-line tool with the following command:

Next, pick the latest version of DockerCompose from their download page and run the following command:

After the successful download, set the execution permission to the downloaded binary with the following command:

Next, verify the installed version of DockerCompose with the following command:


Create a docker-compose.yml File

In this section, we will create a docker-compose.yaml to demonstrate how to use Docker Compose. We will then create a web server environment using the Nginx image.


First, create a project directory inside your home directory:

Next, create a webapp directory for Nginx document root:

Next, create an index.html file inside the webapp directory:

Add the following codes:

Install Docker Compose Ubuntu 20.04 Full

Save and close the file then change the directory to your project and create a docker-compose.yaml file:

Add the following lines:

Save and close the file when you are finished.

Run Docker Compose

At this point, docker-compose.yaml is ready for use. Now, you can use “docker-compose up” command to pull the necessary Docker images, create a container for the web service, and run the containerized environment in background mode:

You should see the following output:

Install Docker On Ubuntu 20.04.1 Lts

You can now verify all running container with the following command:

You should see all information about your running container in the following output:

Docker Compose Basic Commands

In this section, we will show you some most commonly used Docker Compose Commands to manage and interact with your containerized environment.

Install docker on ubuntu 20.04 wsl 2

To start all services, run the following command:

To stop all services, run the following command:

To pause and unpause all services, run the following command:

To check the version of Docker Compose, run the following command:

To scale a service, run the following command:

To check the logs produced by containers, run the following command:


In the above post, you learned how to install and use Docker Compose on Ubuntu 20.04. I hope you can now deploy and scale your application easily with Docker Compose.

Docker Compose is a great tool for development, testing, and staging environments, as well as CI workflows. Install Docker Compose on RHEL 8 / CentOS 8. Follow our separate guide on installation of latest Docker Compose on Linux. Install Docker Compose on Linux. For the sake of keeping this guide brief, we won’t dive into Docker compose usage. In order to install Prometheus on Docker, you will need to have sudo rights on your host. If you are not sure about it, run the following command $ sudo -v 1. Installing Docker on Ubuntu. Before installing Prometheus on Docker, it is important that Docker is already correctly installed and configured on your instance. Docker installed on your server, following Steps 1 and 2 of How To Install and Use Docker on Ubuntu 20.04. Docker Compose installed on your server, following Step 1 of How To Install and Use Docker Compose on Ubuntu 20.04. Step 1 — Obtaining the Demo Application. To get started, we’ll fetch the demo Laravel application from its Github.

Estimated reading time: 3 minutes

Docker Desktop for Mac is the Community version of Docker for Mac.You can download Docker Desktop for Mac from Docker Hub.

By downloading Docker Desktop, you agree to the terms of the Docker Software End User License Agreement and the Docker Data Processing Agreement.

System requirements

Your Mac must meet the following requirements to successfully install Docker Desktop:

  • macOS must be version 10.14 or newer. That is, Mojave, Catalina, or Big Sur. We recommend upgrading to the latest version of macOS.

    If you experience any issues after upgrading your macOS to version 10.15, you must install the latest version of Docker Desktop to be compatible with this version of macOS.


    Docker supports Docker Desktop on the most recent versions of macOS. That is, the current release of macOS and the previous two releases. As new major versions of macOS are made generally available, Docker stops supporting the oldest version and supports the newest version of macOS (in addition to the previous two releases). Docker Desktop currently supports macOS Mojave, macOS Catalina, and macOS Big Sur.

  • At least 4 GB of RAM.

  • VirtualBox prior to version 4.3.30 must not be installed as it is not compatible with Docker Desktop.

What’s included in the installer

The Docker Desktop installation includes Docker Engine, Docker CLI client, Docker Compose, Notary, Kubernetes, and Credential Helper.

Install and run Docker Desktop on Mac

  1. Double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder.

  2. Double-click Docker.app in the Applications folder to start Docker. (In the example below, the Applications folder is in “grid” view mode.)

    The Docker menu in the top status bar indicates that Docker Desktop is running, and accessible from a terminal.

    If you’ve just installed the app, Docker Desktop launches the onboarding tutorial. The tutorial includes a simple exercise to build an example Docker image, run it as a container, push and save the image to Docker Hub.

  3. Click the Docker menu () to seePreferences and other options.

  4. Select About Docker to verify that you have the latest version.

Congratulations! You are now successfully running Docker Desktop.

If you would like to rerun the tutorial, go to the Docker Desktop menu and select Learn.

Automatic updates

Starting with Docker Desktop 3.0.0, updates to Docker Desktop will be available automatically as delta updates from the previous version.


When an update is available, Docker Desktop automatically downloads it to your machine and displays an icon to indicate the availability of a newer version. All you need to do now is to click Update and restart from the Docker menu. This installs the latest update and restarts Docker Desktop for the changes to take effect.

Install Docker Compose Ubuntu 20.04 Download

Install Docker Compose On Ubuntu 1604

Uninstall Docker Desktop

Install Docker Compose Ubuntu 20.04 64-bit

To uninstall Docker Desktop from your Mac:

Install Docker-compose On Ubuntu Digitalocean

  1. From the Docker menu, select Troubleshoot and then select Uninstall.
  2. Click Uninstall to confirm your selection.


Uninstalling Docker Desktop destroys Docker containers, images, volumes, andother Docker related data local to the machine, and removes the files generatedby the application. Refer to the back up and restore datasection to learn how to preserve important data before uninstalling.

Where to go next

  • Getting started provides an overview of Docker Desktop on Mac, basic Docker command examples, how to get help or give feedback, and links to other topics about Docker Desktop on Mac.
  • Troubleshooting describes common problems, workarounds, howto run and submit diagnostics, and submit issues.
  • FAQs provide answers to frequently asked questions.
  • Release notes lists component updates, new features, and improvements associated with Docker Desktop releases.
  • Get started with Docker provides a general Docker tutorial.
  • Back up and restore data provides instructionson backing up and restoring data related to Docker.

Install Docker Compose On Ubuntu 20.04

Install Docker On Ubuntu 20.04 Wsl

mac, install, download, run, docker, local

Most Viewed Posts