Deployment guide

Hosting Nextcloud on your own VPS

Deploy on a VPS Cloud →

Self-hosting7 min read

Hosting Nextcloud on your own VPS

Nextcloud is the open-source alternative to Google Drive, Dropbox and Office 365: files, calendar, contacts, video calls and document editing, all on your own server. Self-hosted on a VPS, it means total sovereignty over your data. Here is a durable and high-performance deployment.

Why self-host Nextcloud on a VPS

Entrusting your documents, photos and calendars to a cloud giant means accepting that they are analyzed, monetized and subject to a foreign jurisdiction. Nextcloud brings all of this back onto a VPS you control: multi-device synchronization, link sharing, CalDAV calendars, CardDAV contacts, and even collaborative document editing with Collabora or OnlyOffice. For an agency or a team, it is also a shared workspace with no per-user subscription. You pay for the VPS, not the number of accounts or the gigabytes stored.

What you regain by hosting it yourself

  • Total sovereignty over your files, calendars and contacts
  • No per-user or per-gigabyte subscription: the fixed cost of the VPS
  • Desktop and mobile synchronization via official clients (WebDAV)
  • Collaborative document editing with OnlyOffice or Collabora
  • Link sharing with password and expiry date
  • An application catalogue (notes, tasks, mail, Talk video calls) extensible at will

Realistic prerequisites

Nextcloud remains reasonable but needs a real foundation: aim for 2 vCPU / 4 GB of RAM for a handful of users, 8 GB if you add OnlyOffice/Collabora or grow to several dozen accounts. The disk is the crux: size it according to your files. You need Docker + Compose, a database (PostgreSQL or MariaDB), Redis for caching, and a cloud.yourdomain.com domain with its SSL certificate.

Step-by-step deployment

01

Compose the complete stack

Create a docker-compose.yml bringing together three services: nextcloud:apache, a mariadb (or postgres) database and redis for caching and file locking. Link them on an internal Docker network and place the data in named volumes.

02

Configure the variables and the trusted domain

Pass the database credentials as environment variables and add NEXTCLOUD_TRUSTED_DOMAINS=cloud.yourdomain.com to avoid the untrusted-domain error on first access.

03

Launch and finish the installation

Start with docker compose up -d, then open https://cloud.yourdomain.com to create the administrator account. Then check the Overview tab to resolve the configuration warnings.

04

Set up reverse proxy and SSL

In front of the container, configure Nginx/Caddy in HTTPS and increase client_max_body_size (e.g. 10G) as well as the timeouts to allow large transfers. Add the recommended headers (HSTS) for the security score.

05

Enable cron and the memory cache

Switch the background tasks to cron mode (via a container or a system job calling cron.php every 5 minutes) and declare Redis in config.php as memcache.locking for stable performance.

06

Schedule backups

Back up the data folder, the config.php and a database dump every night. Push it all to a remote object storage (for example a MinIO on another VPS) for reliable restoration.

Offload file storage to an S3 object backend (MinIO or other) directly from config.php via the primary objectstore: your Nextcloud VPS stays light on its system disk, storage becomes infinitely expandable, and you separate application data from user data, which greatly simplifies future backups and migrations.

The official documentation

For advanced configuration and options specific to the tool, refer to the official Nextcloud documentation. This guide covers going live on a VPS; the vendor's docs remain the reference for fine-tuning, major updates and specific use cases.

Your private cloud, on your VPS

The ServOrbit Cloud VPS provides the disk, the RAM and Docker that Nextcloud needs to host the files and calendars of your entire team. Ready-to-use template.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.