# Docker Installation

We’ll be using Docker in this course as a platform-agnostic way of ensuring that all development is done on the same operating system, letting us (the course staff) take care of installation issues, and avoid OS-specific installation issues.

## Installation Instructions

### Mac

#### 1) Install Docker

{% embed url="<https://docs.docker.com/docker-for-mac/install/>" %}

### Windows

[Docker on Windows](https://docs.docker.com/docker-for-windows/install/) works fairly well on newer machines. You may have to install the [Linux kernel update package](https://docs.microsoft.com/windows/wsl/wsl2-kernel). Try this and if it doesn't work, come to Office Hours, because the other option is daunting.

#### 1) Install Docker

{% embed url="<https://docs.docker.com/desktop/install/windows-install/>" %}

### Windows (Really Bad Alternative)

The other option is downloading a [Virtualbox](https://www.virtualbox.org/) (a Virtual Machine) and installing Docker through there.

#### 1) Set up your VM

{% embed url="<https://www.cs.unm.edu/~bradykey/ubuntuVMInstallGuide.html>" %}

#### 2) Install Docker on your VM

{% embed url="<https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04>" %}

#### 2) Install Docker Compose on your VM

{% embed url="<https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-18-04>" %}

### Linux

#### 1) Install Docker (Ubuntu)

{% embed url="<https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04>" %}

#### 2) Install Docker Compose (Ubuntu)

{% embed url="<https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-18-04>" %}

#### For other Linux distributions, see the individual guides:

{% embed url="<https://docs.docker.com/v17.12/install/#server>" %}

## Is It Working?

You can check that you've successfully installed Docker with: `docker --version`

## Typical Errors

### Is Docker daemon running?&#x20;

If you're using Docker Desktop, make sure to **start the Docker application before attempting to run** Docker commands.

### Has Docker daemon been "starting" for a long time, and unable to run?

`Error response from daemon: dial unix docker.raw.sock: connect: no such file or directory`

This means that your Docker desktop is having trouble running (it may be "starting" for a long time), and that might be because you don't have enough space on your computer -- try to delete some stuff!

### Is the port already being used somewhere?

Try `docker rm -fv $(docker ps -aq)` but it's **recommended** that you use the Docker Compose command (that is, if you've installed Docker Compose and have a `docker-compose.yml` file in the directory that you will be running the following command): **`docker-compose down`**
