(: September 7, 2019)

How do I install Docker Compose on Ubuntu 18.04 / Debian 10 / CentOS 8 / Fedora 30?. This guide will show you how to Install the Latest Docker Compose on Linux. Compose is a tool for defining and running multi-container Docker application. A YAML file is used to configure your application’s services.

This post aims to be a concise instructional step-by-step guide for developers and SysAdmins seeking to setup Docker Compose on Linux. We will check the Github API releases page for the project, and pull the latest binary file.

Install Latest Docker Compose on Linux

You need curl installed on your system for this operation. And definitely, access to the Terminal as a user with sudo privileges.

.td_uid_2_5d908a24da58c_rand.td-a-rec-img{text-align:left}.td_uid_2_5d908a24da58c_rand.td-a-rec-img img{margin:0 auto 0 0}
---- CentOS / RHEL -----
$ sudo yum -y install curl

---- Debian / Ubuntu ----
$ sudo apt install -y curl

----- Fedora -----
$ sudo dnf -y install curl

Once curl has been installed, download the latest Compose binary.

curl -s https://api.github.com/repos/docker/compose/releases/latest 
  | grep browser_download_url 
  | grep docker-compose-Linux-x86_64 
  | cut -d '"' -f 4 
  | wget -qi -

Make the binary file executable.

chmod +x docker-compose-Linux-x86_64

Move the file to your PATH.

sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose

Confirm version.

$ docker-compose version
docker-compose version 1.24.1, build 4667896b
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018

Configure Compose Command-line completion

Compose has command completion for the bash and zsh shell.

For Bash users

Place the completion script in /etc/bash_completion.d/.

sudo curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose

Source the file or re-login to enjoy completion feature.

source /etc/bash_completion.d/docker-compose

For Zsh users

Download the completion script in your ~/.zsh/completion/

mkdir -p ~/.zsh/completion
curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose

Include the directory in your $fpath by adding in ~/.zshrc:

fpath=(~/.zsh/completion $fpath)

Make sure compinit is loaded or do it by adding in ~/.zshrc:

autoload -Uz compinit && compinit -i

Then reload your shell:

exec $SHELL -l

Test Docker Compose installation.

Create a test Docker Compose file.

$ vim docker-compose.yml

Add below data to the file.

version: '3'  
    image: nginx:latest
     - "8080:80"
     - php
    image: php:7-fpm

Start service containers.

$ docker-compose up -d
Starting root_php_1 … done
Starting root_web_1 … done


Show running Containers

$ docker-compose ps
   Name                 Command              State          Ports        
root_php_1   docker-php-entrypoint php-fpm   Up      9000/tcp            
root_web_1   nginx -g daemon off;            Up>80/tcp

Destroy containers

$ docker-compose stop
Stopping root_web_1 ... done
Stopping root_php_1 ... done

$ docker-compose rm -f
Going to remove root_web_1, root_php_1
Removing root_web_1 ... done
Removing root_php_1 ... done

Go through Official Docker documentation and Docker Compose documentation to learn more.

More guides:

Ctop – Top command for container metrics

How to Install Portainer Docker UI manager

How To run Local Kubernetes clusters in Docker

Deploy Lightweight Kubernetes with MicroK8s and Snap

How to run Minikube on KVM

.td_uid_4_5d908a24da7ae_rand.td-a-rec-img{text-align:left}.td_uid_4_5d908a24da7ae_rand.td-a-rec-img img{margin:0 auto 0 0}
  • IC3 Blockchain Initiative Expands Research Team to Europe
  • Lawyers Be DAMNed: Andreas Antonopoulos Takes Aim at Arbitration With DAO Proposal
  • ZFS Concepts and Tutorial
  • Bitcoin: New Plumbing for Financial Services
  • Documents Suggest Tether Has Fiat Funds to Back Stablecoin: Report
  • Bitcoin Node Numbers Fall After Spam Transaction ‘Attack’
  • Linux OpenSSH server deny root user access / log in
  • Facebook’s Libra Is a ‘Wake-Up Call’ for Regulators, Says ECB Policymaker
  • Windows Displaying the Contents of DNS
  • Bash Shell: Remove (Trim) White Spaces From String / Variable
  • Ethereum’s Gavin Wood Is Calling for More ‘Conservative’ Hard Forks
  • $20,000: IRS to Exempt Casual Bitcoin Buyers From Coinbase Data Request
  • Linux Mint Cinnamon vs MATE
  • EU Commits €5 Million to Fund Blockchain Surveillance Research
  • Santander and UBS Discuss Blockchain at Bank of England Event
  • SXI LLC Company
    SXI.IO is a global Blockchain software company, specialized in developing white label crypto exchange platforms , Wallet platforms, ICO platforms, Token Erc20 .....
    Fully Managed VPS Fully Managed VPS Fully Managed VPS

    You Might Also Enjoy NewS Post

    Best Free Web Hosting 2020

    Free Hosting 1GB $0.00 USD/mo Disk space 1GB Traffic 10GB/Month Domains 2 Plesk Cpanel Databases 10 Free 12 Month https://my.sxi.io/cart.php?a=add&pid=196

    02/05/2020 READ MORE