How to self-host Nextcloud on a VPS: your own cloud drive (2026)

Self-host Nextcloud on a VPS: three install methods compared, plus RAM, database, cron, backups, safe upgrades and a one-click install with ZoPanel.

Illustration: Nextcloud on a VPS syncing files with a laptop and a phone

Key takeaways

  • There are three ways to self-host Nextcloud on a VPS - a one-click panel app, the official Nextcloud All-in-One, or a manual PHP and database install - trading effort for control.
  • Nextcloud's docs recommend SQLite only for testing and minimal instances; teams should use MariaDB or PostgreSQL.
  • Background jobs should run from cron every 5 minutes, not the default AJAX mode.
  • Nextcloud cannot skip major versions when upgrading, so update regularly.

To self-host Nextcloud on a VPS you have three options: a one-click app from your control panel (fastest, fine for one person or a family), Nextcloud All-in-One (AIO), the official Docker-based install that bundles PostgreSQL, Redis and backups, or a manual install of nginx, PHP and a database (most control, most work). For a small team, a 2 GB VPS with enough disk for your files and a domain name is a sensible start.

This guide helps you choose the right method, size the server, and then covers what many tutorials skip but what decides whether Nextcloud runs smoothly or flakily: the database, cron, caching, backups and upgrades.

What is Nextcloud, and should you self-host it?

Nextcloud is open-source software that replaces Google Drive or Dropbox: file sync across computers and phones, share links, plus calendar, contacts, notes and many more apps. Desktop clients exist for Windows, macOS and Linux, with mobile apps for iOS and Android.

Self-hosting makes sense when:

  • You want your data on your own server, not a big provider's.
  • You need plenty of space for a family or company without per-user fees.
  • You accept responsibility for updates and backups. This is the part people underestimate: lose the server, lose the data, unless a copy lives somewhere else.

Choosing how to self-host Nextcloud

Method Database Best for Effort
One-click panel app (for example ZoPanel) Built-in SQLite One person, a small family, trying it out Minutes
Nextcloud All-in-One PostgreSQL, with Redis and APCu Teams and small companies wanting the official setup 30 to 60 minutes
Manual nginx + PHP-FPM + MariaDB/PostgreSQL Your choice People who need deep customisation and already run LEMP stacks Hours, plus ongoing maintenance

According to the project's README, AIO is the official Docker installation: Nextcloud, PostgreSQL, Redis and the Client Push backend, with optional Nextcloud Office, Talk, ClamAV and a BorgBackup-based backup feature. It has its own admin interface on port 8080 and supports running behind an existing reverse proxy.

What size VPS do you need?

  • RAM. Nextcloud's system requirements list a minimum of 128 MB and a recommended 512 MB per PHP process. In practice, for a handful of users, budget around 1 GB for Nextcloud plus room for the OS, database and other services. A 2 GB VPS is a reasonable starting point; Nextcloud Office or Talk need more.
  • Disk. Usually the real limit. Estimate your data, then add room for old file versions and the trash bin (both kept by default), plus space for backups if they are staged on the server.
  • OS. Ubuntu 24.04 or Debian 12/13, 64-bit. Nextcloud strongly recommends 64-bit systems.
  • Domain and HTTPS. Desktop and mobile clients sign in through your domain; always use HTTPS. See how to point a domain to a VPS if you have not yet.

Self-host Nextcloud with ZoPanel (one click)

If your VPS runs ZoPanel, Nextcloud is in the App Store:

  1. If Docker is not installed yet, click App Store → Install Docker.
  2. Choose Nextcloud, enter a domain (for example cloud.example.com) and click Install. The task log shows the image download and start.
  3. Point the domain's A record at the server. The Let's Encrypt certificate is issued automatically.
  4. The new app is locked to you: other visitors see "This app is being set up". On the website's Docker tab, click Open the app (only for me), create the admin account in the Nextcloud installer, then click Setup finished — open to everyone. This lock matters: with Nextcloud, whoever opens the installer first creates the admin account.
  5. Install the desktop or mobile client and sign in with your domain.

What ZoPanel handles: the container runs with a 1024 MB memory limit and 1 CPU, listens only on 127.0.0.1 behind nginx with SSL, uses user namespaces, and cannot connect to the server's databases, Redis or the panel. Data lives in /var/lib/zopanel-apps/<instance>/, readable only by root and the container. Update to latest on the Docker tab pulls the newest image and keeps your data.

The honest limitation: the one-click app uses the built-in SQLite database, and Nextcloud shows a performance warning about it. That is fine for one person or a small family. If a whole company will sync lots of files, use AIO or a manual install with MariaDB or PostgreSQL. See what each app is for in the App catalog docs and how containers are isolated in the App Store docs.

Installing Nextcloud All-in-One by hand

For teams, AIO is what Nextcloud itself recommends. The outline:

  1. Install Docker from Docker's official repository (follow the Ubuntu or Debian guide on docs.docker.com rather than random scripts).
  2. Start the nextcloud-aio-mastercontainer with the command from the AIO README. The command changes over time, so copy it from the README, not from an old blog post.
  3. Open the AIO interface, save the passphrase it gives you, enter your domain, choose components (Office, Talk, ClamAV…) and start the containers.
  4. Schedule Borg backups in the AIO interface, and copy the backup repository off the server.

If the VPS already runs nginx or a panel on ports 80 and 443, read the reverse proxy section of the AIO docs: AIO runs on an internal port and your existing web server forwards to it.

What to do right after installing

Whatever the method, open Administration settings → Overview in Nextcloud: it lists security and setup warnings. The important points:

Background jobs: use cron

According to Nextcloud's documentation, the default AJAX mode is the least reliable; Cron every 5 minutes is recommended. On a manual install:

sudo crontab -u www-data -e
# add:
*/5 * * * * php -f /var/www/nextcloud/cron.php

Then select Cron under Administration settings → Basic settings → Background jobs. That page also shows when jobs last ran, which is the quickest way to confirm cron really works, including on Docker installs.

Useful occ commands

# run as the web server user (or: docker exec -u www-data <container> php occ ...)
sudo -u www-data php occ status
sudo -u www-data php occ config:system:get trusted_domains
sudo -u www-data php occ db:add-missing-indices
sudo -u www-data php occ maintenance:mode --on    # before a manual backup

trusted_domains must contain the domain you use, or Nextcloud shows "Access through untrusted domain". Behind an HTTPS reverse proxy, set overwriteprotocol to https so share links are not generated as http://.

Account security

  • Turn on two-factor authentication (the Two-Factor TOTP app) for every admin.
  • Keep open registration off; admins create user accounts.
  • Use a strong password for the admin account and avoid the name admin.

Backing up Nextcloud: three things you need

A complete Nextcloud backup has three parts: the data directory (user files), the database, and the config directory (config.php, with the instance secret and salt). Without the config you can recover the files, but you have to rebuild the setup and may lose settings tied to the old secret.

  • With AIO: use the built-in Borg backups and copy the Borg repository elsewhere.
  • With the ZoPanel one-click app: app data is in /var/lib/zopanel-apps/<instance>/, outside the hosting account's home directory. Check whether the backup method you use covers that path; if not, back up that directory separately (for example with restic) to storage off the server.
  • Either way, follow 3-2-1: three copies, on two different storage systems, one off the server. See our 3-2-1 website backup strategy.

Upgrading Nextcloud safely

The upgrade documentation is explicit: you cannot skip major releases. To go from version N to N+2 you must pass through N+1. In practice:

  • Update regularly so the server never falls several majors behind. A Docker image that jumps straight to the newest release can fail if the running version is too old.
  • Back up before every major upgrade.
  • Check that third-party apps support the new version; incompatible apps are disabled after the upgrade.

Conclusion

Self-hosting Nextcloud takes minutes to install, but running it well for years is about the right database, working cron, off-server backups and regular updates. For a person or family, a one-click app is enough; for a working team, use AIO or a manual install with a proper database.

If you want Nextcloud next to other apps such as Vaultwarden or n8n on one server, each with its own domain, SSL and memory limit, try ZoPanel's Free plan and see pricing. Self-hosting Vaultwarden is a popular next step.

Frequently asked questions

How much RAM does Nextcloud need?

For a few users, Nextcloud itself needs about 1 GB of RAM, plus memory for the OS and database, so a 2 GB VPS is a sensible start. Nextcloud Office, Talk or many users syncing at once need more.

Is SQLite good enough for Nextcloud?

Nextcloud's documentation recommends SQLite only for testing and minimal instances. It works for one person or a small family; teams syncing many files should use MariaDB or PostgreSQL.

Should I install Nextcloud with Docker or directly on the server?

Docker (AIO or a one-click app) is easier to install and update and stays separate from the host system. A direct install gives you control over every PHP and web server setting, but you maintain all of it. For most people Docker is the lower-risk choice.

Can I skip a major version when upgrading Nextcloud?

No. Nextcloud requires upgrading through each major version in turn. Update regularly and back up before every upgrade.

What does a Nextcloud backup need to include?

Three things: the data directory, the database and the config directory. Turn on maintenance mode before a manual backup so the data is consistent, and always keep one copy off the server.