How to Setup Docker Compose on Ubuntu in Azure/AWS/GCP

To run the Docker Compose on Linux in Azure, AWS or GCP, the best way is to install the Docker Compose image from the marketplace.  It comes preinstalled with Docker Engine Community and is fully configured as per the requirements to run Docker Compose in the cloud. Click on the links below to deploy into your environments

Setup Docker Compose on Azure

 

Deploy Docker Compose on Ubuntu 20.04 in Azure

docker compose on azure

Setup Docker Compose on AWS

 

Deploy Docker Compose on Ubuntu 20.04 in AWS

Docker compose on aws

Setup Docker Compose on GCP

 

Deploy Docker Compose on Ubuntu 20.04 in GCP

install docker compose on gcp

Getting Started

 

Once your Docker Compose server has been deployed, the following links explain how to connect to a Linux VM:

 

 

Once connected and logged in, the following section explains how to start using Docker Compose

Using Docker Compose

 

Once logged in via your terminal you are ready to get started. (Note: depending on the type of containers you would like to build, make sure you have the correct firewall ports open. Refer to the section Docker Compose Firewall Ports, further down.

 

Test your Docker Engine 

 

To verify that Docker Engine is working correctly, type the following command 

 

sudo docker run hello-world

 

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits as per the following screenshot:

 

docker_run_hellow_world

 

If you receive a message ‘Cannot connect to the Docker daemon‘, means that you will need to start the Docker service. Run the following command:

 

sudo systemctl start docker

 

or

 

sudo service docker start

 

Then re run the command to verify Docker is running 

 

sudo docker run hello-world

 

Test Docker Compose

 

Run the following command to confirm Docker Compose is installed:

 

Azure / AWS Customers

For Docker version, Try :

 

docker-compose -version

 

or

 

docker compose version

 

GCP Customers

Docker compose version 2, try :

 

docker compose version

 

The Docker Compose version should be displayed.

Docker Compose Firewall Ports

 

Depending on the type of containers you will be creating, you’ll need to make sure your Docker server has the required ports open, in order for them to communicate on your network. The following guides show the steps to setup firewall rules for each cloud provider:

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Docker Compose Documentation

 

Please refer to Dockers documentation on how to use Docker Compose

 

https://docs.docker.com/compose/gettingstarted/

Support

 

Any questions regarding the installation of this solution, please leave a comment below or contact us and we will assist as much as we can to help you get Docker up and running in your environment.

 

Disclaimer: Docker is a registred trademark of Docker Inc and is licensed under Apache LicenseV2. No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.

Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.

3 2 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x