# Docker

# Installing docker

[![image.png](http://wiki.lalco.la/uploads/images/gallery/2024-09/scaled-1680-/tWBimage.png)](http://wiki.lalco.la/uploads/images/gallery/2024-09/tWBimage.png)

To install docker, run the following commands in the terminal. (This installation was done in Ubuntu 22.04.5 lts)

- First, update your existing list of packages.

```bash
$ sudo apt update
```

- Next, install a few prerequisite packages which let apt use packages over HTTPS.

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

- Then add the GPG key for the official Docker repository to your system.

```bash
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```

- Add the Docker repository to APT sources.

```bash
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

- Update your existing list of packages again for the addition to be recognized.

```bash
$ sudo apt update
```

- Make sure you are about to install from the Docker repo instead of the default Ubuntu repo.

```bash
$ apt-cache policy docker-ce
```

[![image.png](http://wiki.lalco.la/uploads/images/gallery/2024-09/scaled-1680-/Ydcimage.png)](http://wiki.lalco.la/uploads/images/gallery/2024-09/Ydcimage.png)

- Finally, install Docker

```bash
$ sudo apt install docker-ce
```

- Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running.

```bash
$ sudo systemctl status docker
```

[![image.png](http://wiki.lalco.la/uploads/images/gallery/2024-09/scaled-1680-/opBimage.png)](http://wiki.lalco.la/uploads/images/gallery/2024-09/opBimage.png)

For more information refer to this website: [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04)