Menu Close

Installing Docker and Docker Compose

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

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.

The first step is to install Docker on your Ubuntu system

  • Open terminal session and SSH into the Ubuntu Server

ssh paul@192.168.1.xxx   (and enter password to log into the server)
  • Update packages
sudo apt update && sudo apt upgrade -y
  • Install the required dependencies for Docker:
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
  • Add the Docker CPG Key (don’t omit the trailing “-“)
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
  • Add the Docker Repository
add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
  • install Docker Engine.   The following command will download Docker and install it:
apt-get updateapt-get install docker-ce docker-ce-cli containerd.io
  • Verify Setup
docker run hello-world

Upon a successful installation of Docker you will receive a “Hello” message from Docker

 

Installing Docker Compose:

  • The following command will download the 1.29.2 release and save the executable file at /usr/local/bin/docker-compose, which will make this software globally accessible as docker-compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  • Next, set the correct permissions so that the docker-compose command is executable:
sudo chmod +x /usr/local/bin/docker-compose 
  • To verify that the installation was successful, you can run:
docker-compose --version

You’ll see output similar to this:

docker-compose version 1.29.2, build 5becea4c

Docker Compose is now successfully installed on your system. In the next post, you’ll see how to set up a docker-compose.yml file and get a containerized environment up and running with this tool.

Leave a Reply

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