You have now successfully installed and started Docker Engine.
{{% include "root-errors.md" %}}
#### Upgrade Docker Engine
To upgrade Docker Engine, follow step 2 of the
[installation instructions](#install-using-the-repository),
choosing the new version you want to install.
### Install from a package
If you can't use Docker's `apt` repository to install Docker Engine, you can
download the `deb` file for your release and install it manually. You need to
download a new file each time you want to upgrade Docker Engine.
<!-- markdownlint-disable-next-line -->
1. Go to [`{{% param "download-url-base" %}}/dists/`]({{% param "download-url-base" %}}/dists/).
2. Select your Raspberry Pi OS version in the list.
3. Go to `pool/stable/` and select the applicable architecture (`amd64`,
`armhf`, `arm64`, or `s390x`).
4. Download the following `deb` files for the Docker Engine, CLI, containerd,
and Docker Compose packages:
- `containerd.io_<version>_<arch>.deb`
- `docker-ce_<version>_<arch>.deb`
- `docker-ce-cli_<version>_<arch>.deb`
- `docker-buildx-plugin_<version>_<arch>.deb`
- `docker-compose-plugin_<version>_<arch>.deb`
5. Install the `.deb` packages. Update the paths in the following example to
where you downloaded the Docker packages.
```console
$ sudo dpkg -i ./containerd.io_<version>_<arch>.deb \
./docker-ce_<version>_<arch>.deb \
./docker-ce-cli_<version>_<arch>.deb \
./docker-buildx-plugin_<version>_<arch>.deb \
./docker-compose-plugin_<version>_<arch>.deb
```
The Docker daemon starts automatically.
6. Verify that the installation is successful by running the `hello-world` image:
```console
$ sudo service docker start
$ sudo docker run hello-world
```
This command downloads a test image and runs it in a container. When the
container runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine.
{{% include "root-errors.md" %}}
#### Upgrade Docker Engine
To upgrade Docker Engine, download the newer package files and repeat the
[installation procedure](#install-from-a-package), pointing to the new files.
{{% include "install-script.md" %}}
## Uninstall Docker Engine
1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:
```console
$ sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
```
2. Images, containers, volumes, or custom configuration files on your host
aren't automatically removed. To delete all images, containers, and volumes:
```console
$ sudo rm -rf /var/lib/docker
$ sudo rm -rf /var/lib/containerd
```
3. Remove source list and keyrings
```console
$ sudo rm /etc/apt/sources.list.d/docker.list
$ sudo rm /etc/apt/keyrings/docker.asc
```
You have to delete any edited configuration files manually.
## Next steps
- Continue to [Post-installation steps for Linux](linux-postinstall.md).