# How to install Docker on Ubuntu

Docker lets you run applications in containers. Fast, portable, and efficient.

***

### Requirements

* Linux [VPS](https://ititanhosting.com/vps)/[Dedicated Server](https://ititanhosting.com/dedicated)
* SSH + sudo

***

### Step 1: Remove old versions

```bash
sudo apt remove docker docker.io containerd runc -y
```

***

### Step 2: Install dependencies

```bash
sudo apt update
sudo apt install ca-certificates curl gnupg -y
```

***

### Step 3: Add Docker repo

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

***

### Step 4: Install Docker

```bash
sudo apt install docker-ce docker-ce-cli containerd.io -y
```

***

### Step 5: Start Docker

```bash
sudo systemctl start docker
sudo systemctl enable docker
```

***

### Step 6: Test

```bash
docker run hello-world
```

***

### Step 7: Run without sudo

```bash
sudo usermod -aG docker $USER
newgrp docker
```

***

### Basic commands

Run container:

```bash
docker run -d -p 8080:80 nginx
```

List:

```bash
docker ps
```

***

### Done 🐳

Docker is ready!
