Self-host Nextcloud with Docker: set up your own cloud | ComputeBox
Self-Hosting
How to self-host Nextcloud with Docker and Caddy
Your own cloud for files, calendar, and contacts, on your own server. Here is how to set up Nextcloud with Docker Compose and serve it with Caddy and HTTPS.
How to install Docker and Docker Compose on Linux/Ubuntu
Nextcloud is your own cloud for files, calendar, contacts, and much more. Instead of storing your data with a big provider, it runs on your own server, under your control. With Docker Compose, Nextcloud is set up quickly, and with Caddy you get automatic HTTPS on top. This guide walks you through the complete setup.
15 minIntermediateTested on Ubuntu 24.04Updated 2026-06-18
In short
Start a Compose file with Nextcloud and a database, then serve it under your domain with HTTPS using Caddy.
Nextcloud needs a database. Here is a lean configuration with MariaDB:
Replace the passwords
Replace all STRONG-...-PASSWORD placeholders with your own strong passwords. Ideally put them in a .env file so they are not sitting in plain text in the Compose file. Enter your real domain at NEXTCLOUD_TRUSTED_DOMAINS and in the Caddyfile.
OVERWRITEPROTOCOL=https makes sure Nextcloud generates correct HTTPS URLs behind the reverse proxy.
Open https://cloud.example.com in your browser. Log in with the admin user and password from the Compose file. Your own cloud is running. Through the app you upload files, set up calendars and contacts, and install more apps as needed.
For HTTPS via Caddy, yes. Internally you can test Nextcloud over the IP and port 8080, but for production use a domain with a certificate is part of it.
How much storage do I need?
That depends on your files. You expand the server storage in the panel as needed, and for an active cloud you should plan generously.
Is this GDPR-friendly?
Self-hosted, your data sits on your server. At ComputeBox that server is in a German data center, and you keep full control.