Skip to main content
Nextcloud is a self-hosted alternative to Dropbox, Google Drive, and iCloud combined. Running it on your Opus Host VPS gives you a private cloud for files, calendars, contacts, and photos that you fully control. We will use Docker Compose because it is the fastest, cleanest way to get Nextcloud running with a proper database.

Prerequisites

  • Docker and Docker Compose installed. See Docker.
  • A domain pointing to your VPS. See Custom Domain.
  • Ports 80 and 443 open. See Firewall.

1. Create the project folder

2. Write the compose file

Create docker-compose.yml:
Replace the passwords and cloud.example.com with your own values.

3. Start it

Check the logs until Nextcloud finishes initializing:

4. Put Nginx in front and add HTTPS

Install Nginx if you have not already:
Create /etc/nginx/sites-available/cloud.example.com:
Enable it and reload:
Add HTTPS with Certbot (see Let’s Encrypt SSL):

5. Finish the setup in the browser

Open https://cloud.example.com and create your admin account. Nextcloud will finish its first-run setup automatically.

Everyday commands

Back it up

Nextcloud’s data lives in two Docker volumes (db and nextcloud). Include both in your backup strategy, or take a panel backup of the whole VPS before major changes.
Bump client_max_body_size in the Nginx config if you want to upload large files. The 10 GB above is a sensible default for a self-hosted cloud.
Nextcloud stores every file you upload plus a full database. Keep an eye on disk usage — see Resource Limits — or you will run out of space faster than you think.