Skip to content
Nextcloud & DockerUpdated: 02/11/2026

Nextcloud on Netcup: Docker Compose, TLS and backups

Nextcloud on a VPS or root server: a compact Docker stack, TLS via Caddy and a backup routine that actually restores.

1. Choose a plan

For a small Nextcloud with a few users, VPS 1000 (8 GB RAM) is enough. For multiple apps, Collabora and larger files, RS 2000 with dedicated cores is the more robust choice. Web hosting works, but is not ideal for full control and Docker.

  • VPS 1000: smaller teams, 8 GB RAM.
  • RS 2000: multiple apps, Collabora, more headroom.
  • Storage: local NVMe is fine to start; keep backups external.

2. Docker Compose

The stack contains Nextcloud, MariaDB and Redis. Change all passwords and set the domain after the first start. In production, put a reverse proxy in front.

services:
  nextcloud:
    image: nextcloud:apache
    restart: unless-stopped
    ports:
      - "8080:80"
    environment:
      MYSQL_HOST: db
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: change-me
      REDIS_HOST: redis
    volumes:
      - nextcloud_data:/var/www/html
    depends_on:
      - db
      - redis
  db:
    image: mariadb:11
    restart: unless-stopped
    environment:
      MARIADB_DATABASE: nextcloud
      MARIADB_USER: nextcloud
      MARIADB_PASSWORD: change-me
      MARIADB_ROOT_PASSWORD: change-root
    volumes:
      - db_data:/var/lib/mysql
  redis:
    image: redis:7-alpine
    restart: unless-stopped
volumes:
  nextcloud_data:
  db_data:

Note: Start with docker compose up -d and check the logs. The first start can take a few minutes.

3. Reverse proxy and TLS

Caddy handles TLS automatically. Point the domain via A/AAAA to the server, open 80/443 in the SCP and host firewall, and set trusted proxies plus overwriteprotocol in Nextcloud.

nextcloud.example.com {
  reverse_proxy 127.0.0.1:8080
}

# In Nextcloud:
docker compose exec -u www-data nextcloud php occ config:system:set trusted_proxies 0 --value=127.0.0.1
docker compose exec -u www-data nextcloud php occ config:system:set overwriteprotocol --value=https

Note: Without trusted proxies and overwriteprotocol you get wrong URLs or login loops behind the proxy.

4. Backups and updates

Back up the database and data directory separately. Enable maintenance mode before updates, update containers and apps, then test login. A backup without a restore test is not a backup.

docker compose exec -T db mariadb-dump -u root -p"$MARIADB_ROOT_PASSWORD" nextcloud > nextcloud-db.sql
docker run --rm -v nextcloud_data:/data -v "$PWD":/backup alpine tar czf /backup/nextcloud-data.tar.gz -C /data .
docker compose exec -u www-data nextcloud php occ maintenance:mode --on

Official sources

Matching plans

RS 2000 G12.5

Bestseller
Root server • G12.5
1 Month Free
€40.70/ moincl. 19% VAT12-month term

8 Dedicated Cores (AMD EPYC 9645) · 16 GB RAM · 256 GB NVMe · 2.5 Gbit/s

GB6: 2,295/13,420 · Steal: 0.0 %

Loading current code…

VPS 1000 G12.5

Bestseller
VPS • G12.5
1 Month Free
€14.50/ moincl. 19% VAT12-month term

4 vCores (x86) · 8 GB RAM · 128 GB SSD · 2.5 Gbit/s

GB6: 1,720/4,650 · Steal: 1.2 %

Loading current code…

RS 1000 G12.5

Bestseller
Root server • G12.5
2 Months Free
€21.73/ moincl. 19% VAT12-month term

4 Dedicated Cores (AMD EPYC 9645) · 8 GB RAM · 128 GB NVMe · 2.5 Gbit/s

GB6: 2,290/7,559 · Steal: 0.0 %

Loading current code…

Frequently asked questions

How much RAM does Nextcloud need?

For a few users without Collabora, 4–8 GB RAM is a good start. With Collabora, multiple apps and larger files, 16 GB on RS 2000 makes sense.

Web hosting or VPS for Nextcloud?

Web hosting can run Nextcloud, but is limited for Docker, Collabora and full control. A VPS or root server is the more flexible production choice.

How do I back up Nextcloud correctly?

Back up the database dump, data directory and configuration separately, store them externally, and test a restore regularly. Snapshots alone are not a backup.