How to install Docker and Docker Compose on a VPS
Objective
By the end of this guide, your VPS will have:
- Docker Engine
- Docker Compose (official plugin)
- Permissions configured to avoid using
sudowith Docker
Installing via the official Docker repository ensures regular updates, improved stability and maximum compatibility with recent tools.
This guide explains how to install Docker Engine and Docker Compose on an OVHcloud VPS.
Requirements
- An active OVHcloud VPS running Debian 11/12 or Ubuntu 22.04 and later
- SSH access with a user that has sudo privileges
Table of Contents
- Step 1 - Update the system
- Step 2 - Install dependencies
- Step 3 - Add the Docker GPG key
- Step 4 - Add the Docker repository
- Step 5 - Install Docker
- Step 6 - Configure Docker permissions
- Step 7 - Verify the installation
Instructions
Step 1 - Update the system
Before installing anything, update your system:
Step 2 - Install dependencies
Install the required packages:
Step 3 - Add the official Docker GPG key
Step 4 - Add the Docker repository
Step 5 - Install Docker Engine and Docker Compose
Step 6 - Configure Docker permissions
By default, Docker commands require sudo.
To avoid permission issues when using Docker Compose or installation scripts, add your user to the docker group:
Reload your session:
Do not run your future Docker scripts with sudo unless specifically required. Using sudo can create root-owned files and cause permission errors.
Step 7 - Verify the installation
Check that Docker is working correctly:
You should get output similar to:
Go further
You can now use Docker to:
- Install OpenClaw behind Traefik on an OVHcloud VPS with OVHcloud AI Endpoints
- Install n8n on an OVHcloud VPS
- Install Nextcloud on an OVHcloud VPS with Docker and Traefik
Join our community of users.