Installing Docker and Docker Compose on Ubuntu

Basic steps and script to get Docker and Docker Compose up and running quickly

You may want to check out the step before this, Building a Linux Open-Source GIS Environment with Windows: Part 1 - WSL!

Installing Docker and Docker-Compose

Docker lets you run containers on your computer (or Subsystem in this case).

Docker-compose is a simple Docker orchestrator that’s great for small systems.

  1. Docker and digitalocean have put together some great information on this, and I could never do better, so I used their documents to put together a script:
  4. You can paste this into Terminal
export user=$(whoami)
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update && sudo apt-get install \
    docker-ce \
    docker-ce-cli \

sudo usermod -aG docker ${USER}
# This step will ask you for your password again
su - ${USER}
# start docker (This is needed with WSL)
sudo service docker start
# exit out of the su command
  1. Let’s install docker-compose
  2. Get the latest version number of Docker Compose
        export DOCKERCOMPOSEVERSION=$(curl -s | perl -pe 's/^.+\/tag\/(.+?)">.+/\1/g')
  3. Install the latest docker-compose
        sudo curl -L "${DOCKERCOMPOSEVERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
        sudo chmod +x /usr/local/bin/docker-compose
  4. Verify your version by running this command
     docker-compose --version
  5. You now have Docker and docker-compose installed!