Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Install Docker Magento on Ubuntu 18.04

Installation Instructions

  1. First, update your existing list of packages:
sudo apt update
  1. Next, install a few prerequisite packages which let apt use packages over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
  1. Then add the GPG key for the official Docker repository to your system:
curl -fsSL | sudo apt-key add -
  1. Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] bionic stable"
  1. Next, update the package database with the Docker packages from the newly added repo:
sudo apt update
  1. Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
apt-cache policy docker-ce

You’ll see output like this, although the version number for Docker may be different:

  Installed: (none)
  Candidate: 18.03.1~ce~3-0~ubuntu
  Version table:
     18.03.1~ce~3-0~ubuntu 500
        500 bionic/stable amd64 Packages
  1. Finally, install Docker:
sudo apt install docker-ce
  1. Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
sudo systemctl status docker

Installation Compose (optional)

  1. Run this command to download the current stable release of Docker Compose
sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  1. Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
  • Note: If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path. For example:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  1. Test the installation.
docker-compose --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment