# Docker Installation in Ubuntu/Debian

## Docker install in Ubuntu

## Update && upgrade the system

Update your system - Ensure that your system is up to date.

```
sudo apt-get update -y
```

### **Install the Required Packages**

To install the necessary packages and certification for installing the docker.

```
sudo apt-get install ca-certificates curl 
```

```
sudo install -m 0755 -d /etc/apt/keyrings 
```

### **Add Docker's official GPG key:**

```
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc 
```

```
sudo chmod a+r /etc/apt/keyrings/docker.asc
```

### **Add the repository to Apt Sources:**

```
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```

### **To install docker ->**

```
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

```
sudo docker run hello-world
```
