How to install Nextcloud on an OVHcloud VPS with Docker and Traefik
Objective
This guide is aimed at intermediate to advanced users wishing to deploy Nextcloud in a more robust architecture, closer to a production environment.
At the end of this guide, you will have:
- A Nextcloud instance accessible via HTTPS
- Automatic Let’s Encrypt certificates
- A persistent Docker stack (Nextcloud + MariaDB + Redis)
- A Traefik v2 reverse-proxy
Target architecture (simplified)
- OVHcloud VPS (Ubuntu)
- Docker and Docker Compose
- Traefik v2 (HTTPS reverse-proxy)
- Nextcloud (Apache)
- MariaDB (database)
- Redis (cache and locks)
Requirements
- An OVHcloud VPS offer under Ubuntu 22.04 LTS
- Access via SSH with sudo rights
- A domain name (e.g.,
cloud.example.com) pointing to the VPS IP - Ports 80 and 443 must be open
- A valid email address for Let’s Encrypt
Instructions
Table of contents:
- Step 1: Prepare the VPS
- Step 2: Install Docker
- Step 3: Deploy Traefik
- Step 4: Deploy Nextcloud
- Step 5: Checks and post-installation
Step 1: Preparing the VPS
Allow the required ports:
Step 2: Installing Docker
Step 3: Deploying Traefik
Create the directory structure:
Create the traefik.yml file:
Create the Traefik docker-compose.yml:
Step 4: Deploying Nextcloud
Create a .env file:
Create the Nextcloud docker-compose.yml:
Step 5: Post-installation checks
- Access https://cloud.example.com
- Check the HTTPS certificate
- Enable Cron mode in the Nextcloud settings
- Check Redis in the administration interface
Conclusion
Traefik is not mandatory, but it is an excellent practice for:
- Managing multiple HTTPS services on the same VPS
- Automating Let’s Encrypt certificates
- Centralising routing and security
For a first deployment or personal use, the guide for beginner users is sufficient.
For advanced or multi-service use, this guide is recommended.
Go further
Join our community of users.