> For the complete documentation index, see [llms.txt](https://preston.gitbook.io/cloud-eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://preston.gitbook.io/cloud-eng/running-docker-on-ubuntu-16.4.md).

# Running Docker on Ubuntu 16.4

Docker Quick start on Ubuntu 16.4 - Command Reference - these notes assume you have general Linux experience and assumes you know what docker is.

To follow along with this tutorial you need an existing virtual machine running Ubuntu. Any cloud provider is fine.&#x20;

## Update the existing packages&#x20;

```
sudo apt update
```

{% hint style="info" %}
Install packages required to use apt over HTTPS
{% endhint %}

```
sudo apt install apt-transport-https ca-certificates curl software-properties-common
```

```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```

&#x20;**Add the Docker repository to APT sources:**

&#x20;`sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"`

Install docker from the docker repo

&#x20;`apt-cache policy docker-ce`

```
sudo apt install docker-ce
```

Now that docker is installed let's see the status&#x20;

```
sudo systemctl status docker
```

Output&#x20;

```
docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: en
   Active: active (running) since Mon 2018-08-06 13:23:17 UTC; 10h ago
     Docs: https://docs.docker.com
 Main PID: 3827 (dockerd)
    Tasks: 20
   Memory: 141.3M
      CPU: 1min 26.849s
   CGroup: /system.slice/docker.service
           ├─3827 /usr/bin/dockerd -H fd://
           └─3852 docker-containerd --config /var/run/docker/containerd/container
```

use this command to add users to docker if you prefer not to use sudo for every command&#x20;

```
sudo usermod -aG docker ${USER}
```

```
docker ps -a #listg all containers active and inactive 
```
