> ## Documentation Index
> Fetch the complete documentation index at: https://help.onetsolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Install Docker

> Install Docker on your VPS for containerized applications

Docker is a popular containerization platform that allows you to run applications in isolated, portable containers.

<Info>
  **Prerequisites**

  * A VPS with OnetSolutions running Ubuntu/Debian
  * SSH access to your server
  * Root or sudo privileges
</Info>

## Installation Steps

<Steps>
  <Step title="Update package lists">
    ```bash theme={null}
    sudo apt update
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
    ```
  </Step>

  <Step title="Add Docker GPG key">
    ```bash theme={null}
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    ```
  </Step>

  <Step title="Add Docker repository">
    ```bash theme={null}
    echo "deb [arch=amd64 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
    ```
  </Step>

  <Step title="Update package lists again">
    ```bash theme={null}
    sudo apt update
    ```
  </Step>

  <Step title="Install Docker">
    ```bash theme={null}
    sudo apt install docker-ce docker-ce-cli containerd.io
    ```
  </Step>

  <Step title="Start Docker service">
    ```bash theme={null}
    sudo systemctl start docker
    sudo systemctl enable docker
    ```
  </Step>

  <Step title="Verify installation">
    ```bash theme={null}
    sudo systemctl status docker
    ```

    You should see "active (running)" in the output.
  </Step>
</Steps>

## Post-Installation

### Run Docker without sudo

Add your user to the docker group:

```bash theme={null}
sudo usermod -aG docker $USER
```

<Note>
  Log out and back in for the group changes to take effect.
</Note>

### Test Docker

```bash theme={null}
docker run hello-world
```

If successful, you'll see a message confirming Docker is working properly.

## Next Steps

<CardGroup cols={2}>
  <Card title="Docker Documentation" icon="book" href="https://docs.docker.com/">
    Official Docker documentation
  </Card>

  <Card title="Docker Hub" icon="docker" href="https://hub.docker.com/">
    Find pre-built Docker images
  </Card>
</CardGroup>
