Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
#### Set up the repository
1. Update the `apt` package index and install packages to allow `apt` to use a repository over HTTPS:
3. Use the following command to set up the **stable** repository. To add the **nightly** or **test** repository, add the word `nightly` or `test` (or both) after the word `stable` in the commands below.
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
#### Install Docker Engine
1. Update the `apt` package index, and install the *latest version* of Docker Engine and containerd, or go to the next step to install a specific version: