Install docker and docker-compose on Ubuntu 16.04 server


Install Docker

In this guide, I use the Ubuntu 16.04 server but it works equally well to install on the Ubuntu 17.04 server.
It is based on an article from DigitalOcean

I use docks to run all my applications in containers on an unbuntu server. This allows me to easily add and remove apps from the server.

Docker installation package available in the official Ubuntu 16.04 archive, but it may not be the latest dock version available. To get the latest and best version, I install Docker from the official Docker repository.

  1. First, I add the GPG key to the official Docker archive to the system
  2. Add Docker Repository to APT sources
  3. Installing docker community edition

curl -fsSL | Sudo apt-key add -
sudo add-apt repository "deb [arch = amd64] $ (lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker

You can also add your user to docker so you do not have to run sudo command every time you run docker, this step is optional:
sudo usermod -a ${USER}

Here you can read more about Docker and how to use it. Docker Documentation

Install Docker Compose

Docker Compose I use to deploy multiple accounts at the same time and smoothly get the apps to communicate. Tex I do not have to start wordpress and a database separately, but instead everything is synchronized in a docking compose file.

In order not to get error messages, I had to run underlying installation commands as a super admin user. You become super-admin through the following command.
sudo -i

Docker Compose Installation Commands:
curl -L$dockerComposeVersion/docker-compose-union -s` -`uname -m` -o/usr/local/bin/docker -compose
chmod +x /usr/local/bin/docker-compose
docker-compose - version

Leave a Reply

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