Back to Article List

Nextcloud - The complete self-hosting guide

Nextcloud - The complete self-hosting guide

Nextcloud is an open source platform for file sync and collaboration that you run on your own server: your files, calendars, contacts, video calls and document editing on hardware you control, reachable from a web interface, desktop clients and mobile apps. Think of the feature set of Dropbox, Google Drive and a slice of Microsoft 365, self-hosted. Mine has run since around version 24, currently on a 4 GB VPS with roughly 400 GB of family photos and client project files in it, and over the past months I've written fourteen deep guides on installing, tuning and repairing it. This page is the map that holds them together: what Nextcloud is, what it needs and the order I'd do things in, with a pointer into the right guide at each step.

What Nextcloud is

The project started in 2016 as a fork of ownCloud, led by ownCloud's founder and most of its core developers, and it has long since outgrown its origin. The same code now runs at every scale, from a single-board computer in a closet to public-sector deployments with tens of thousands of seats. The server is PHP, developed in the open at github.com/nextcloud/server, with a release cadence worth understanding before you commit: a new major version every four months, each supported for about a year with monthly maintenance releases. As I write this in August 2026, the current stable release is 34.0.3, version 33 is supported until February 2027, version 32 reaches end of support in September and 35 sits in release candidate phase. The practical reading of that cadence: you'll be upgrading two or three times a year, so pick an install method you can upgrade calmly, a theme this page returns to twice.

The naming needs one paragraph of decoding, because it confuses everyone. Marketing calls the product Nextcloud Hub, and majors carry seasonal names: version 34 is Hub 26 Spring, 33 is Hub 26 Winter, 35 will be Hub 26 Summer. When someone on a forum says "Hub 26" and the changelog says "34.0.3", they mean the same software. I'll use plain version numbers throughout, and so does every error message you'll ever read.

Is Nextcloud free? Yes, genuinely. The entire server is AGPL-licensed and every feature ships in the free release, Talk and Office included. The paid Nextcloud Enterprise subscription buys support contracts and longer maintenance windows for organizations, and deliberately buys no features. For a self-hoster the only real costs are the server it runs on and your own time, and this page exists to shrink the second one.

The moving parts, in one section

Every Nextcloud instance, no matter how it was installed, is the same five pieces wearing different clothes. A webserver (Apache in the docs' recommended setup) receives requests. PHP runs the application code. A database, MariaDB or PostgreSQL, holds users, shares and file metadata. Redis caches and handles file locking, which stops two devices corrupting the same file, and it stops being optional the moment a second person logs in. And the data directory holds your actual files as plain files on disk, the property I lean on hardest when things go wrong.

Two more names you'll meet constantly. config.php, in the config/ folder of the install, is the one configuration file that matters, and nearly every fix in this series touches it. And occ is the command-line tool for administering the server, run as the webserver user, like this:

sudo -u www-data php /var/www/nextcloud/occ status

Anyone comfortable with those five pieces plus those two names can operate a Nextcloud server. That's the whole secret, and it's why the troubleshooting half of this series is shorter than you'd fear.

What it's good at, and the honest limits

Nextcloud earns its place as the default answer for self-hosted files. Sync works well across every platform, sharing is flexible down to passwords and expiry dates on links, and the app catalog turns one server into a calendar host, a photo library, a Kanban board or an office suite as needed. The breadth is the point: one modest VPS, one login, four or five subscription services replaced. There's also a quieter argument that convinced me before any feature did. Files on your own server sit under your jurisdiction and your retention rules, and no product decision made in a boardroom next quarter can lock you out of them.

The honest limits: it's a PHP web application with a database, so its web interface and sync engine carry more weight than a single-purpose tool, and it rewards (quietly demands, really) proper caching and tuning. If all you want is the fastest possible file sync for a team and nothing else, dedicated sync servers have a case, and I've written fairly about the strongest one in my Seafile vs Nextcloud comparison. The other name that always comes up is its own ancestor, and my Nextcloud vs ownCloud comparison explains why that rivalry is mostly over. For the mix of files plus everything around them, Nextcloud stands alone, which is how it ended up with this whole tutorial series.

The install paths, compared

There are three real ways onto a server, and the choice shapes your next two years of maintenance more than any config option will. It's also sticky. Migrating between install methods later is possible, and nobody who has done it recommends the experience, so this is the decision to get right while the server is still empty.

The manual install puts the stack straight on the OS: Apache with PHP-FPM, MariaDB, Redis and the Nextcloud code itself, on Ubuntu 26.04 LTS, which ships PHP 8.5 in its default repos and is what the docs currently recommend. It's my own setup and the path I'd pick for anyone who wants to understand every layer. The full build, from bare server to green admin overview, is in how to install Nextcloud on Ubuntu.

The Docker route runs the official image with compose: standard tooling, clean coexistence with other containers and an update path of bumping an image tag. That build, reverse proxy included, is in my Nextcloud Docker Compose guide. Then there's AIO, the official all-in-one container that manages the entire stack for you, Talk and backups included, which is excellent when Nextcloud owns the whole machine and prickly when it doesn't. Picking between these three is a genuine decision with real trade-offs, and I've argued it through properly in Nextcloud AIO vs manual install.

A fourth path exists and I'll be fair to it in one sentence: the snap package works and updates itself, and I left it years ago because the config felt hidden behind the snap's abstractions, so I'd call it right for an appliance and wrong for anyone who plans to reach the config files. All the official options, snap included, are listed on nextcloud.com/install. And if you'd rather skip installation entirely, the LumaDock one-click Nextcloud template on Ubuntu 22.04 deploys a working instance in seconds, picked during ordering.

What hardware it needs

The official system requirements read modestly, 512 MB of memory recommended per process, and the docs aren't wrong, but real installs want more. My sizing after years of running one: 2 GB of RAM is the floor for a usable instance with a few users, once the webserver, PHP-FPM pool, MariaDB and Redis all take their share. 4 GB is comfortable, with room for photo previews and the occasional heavy app. A busy team of ten or more wants 8 GB and faster disks before it wants more CPU. Cores matter less than people expect; RAM and disk latency decide how Nextcloud feels. Keep the database on the same host at this scale, since splitting a five-user stack across servers adds latency and a second machine to patch in exchange for nothing you'll measure.

One number from my own box for calibration: with Apache, PHP-FPM capped at 12 workers, MariaDB and Redis serving a family plus occasional client hand-offs, the whole stack idles around 1.5 GB and peaks well inside 4 GB during photo uploads. The instances that struggle on that hardware are nearly always missing their caching config rather than short on cores.

Disk is the resource that grows forever, because a file server's job is to accumulate: file versions, trashed files on their retention clock, previews for every photo, all of it stacking on top of the data itself. Budget for three times your current data if you want backups and versions to breathe, and decide early where big libraries will live. Past a few hundred gigabytes you either give the VPS a large local volume, the kind of thing a storage VPS exists for, or you put the data in an object store. That second option is a day-one architectural decision with sharp edges, and I've laid them out in Nextcloud S3 primary storage before you make it by accident.

The first week

Whatever the install path, the first session is the same: create the admin account, get HTTPS working with a real certificate and set the basics. I keep a KB walkthrough of exactly that first login and certificate setup in the Nextcloud initial setup and HTTPS guide, and it's the page I send people on day one.

Two gotchas arrive in week one so reliably that they get their own guides. The first is the "Access through untrusted domain" screen, which appears the moment you reach the server by a name it wasn't configured for; the fix is one config array, explained in fixing the Nextcloud untrusted domain error. The second is background jobs. Nextcloud ships in AJAX cron mode, where maintenance tasks only run while someone has the web UI open, which on a quiet server means they barely run at all. Switching to a real system cron entry in the www-data crontab is the single highest-value five minutes of the first week:

*/5 * * * * php -f /var/www/nextcloud/cron.php

The why behind it, the Docker and AIO variants and the ways this quietly breaks later are in Nextcloud cron and background jobs.

Then connect the clients: desktop for Windows, macOS and Linux, mobile apps for both stores. The desktop client's virtual files mode on Windows deserves a mention, since it shows the whole server's contents in Explorer while downloading only what gets opened, which is how a laptop with a 256 GB drive lives comfortably with a 400 GB server. Give each device its own app password from the security settings instead of the account password; revoking one stolen laptop later shouldn't mean rotating everything. Watch the admin overview screen while you do all this (Administration settings, Overview). It's Nextcloud's own health report, and a fresh install that shows green checks there is a rare and satisfying sight worth chasing. I check that screen before and after every change I make, a habit that has caught more misconfigurations than any log file.

Keeping it healthy

Nextcloud rewards a boring routine. Updates go one major version at a time, never skipping (32 to 33 to 34, not 32 to 34), and I let every new major age to its .1 or .2 release before upgrading, a patience that has repeatedly paid for itself. I lost a Sunday to a stuck upgrade at version 32 once. The routine that came out of that Sunday, snapshots and dumps before every major, lives on in everything below.

The mechanics offer two routes. The web updater is fine for point releases and small instances; for majors I use the command line, occ upgrade after the updater stages the new code, because when something stalls, a terminal shows you where and a spinning browser page shows you nothing. Majors also disable apps that haven't declared compatibility yet, which is normal and reversible, and one more argument for waiting out the .0 release while app developers catch up.

Backups come first, and mean two things captured together: a database dump and the data directory, plus the config. My full playbook, restic to offsite storage and a tested restore drill included, is in Nextcloud backup and restore. When something misbehaves, the trail starts in the logs, and knowing where they live before the bad day (nextcloud.log in the data directory, JSON lines, plus the webserver and PHP logs around it) is half the diagnosis; the tour is in where are the Nextcloud logs.

If the instance feels slow, it's nearly always one of the same four suspects: missing Redis caching, an untuned PHP-FPM pool, no preview generation or a database without its indices. The fix order and the config that carries my own box are in Nextcloud performance tuning. Two specific failure states earn their own pages because they scare people out of proportion to their difficulty: the maintenance mode lock that upgrades occasionally leave behind, covered in Nextcloud stuck in maintenance mode, and the generic "internal server error" page that tells you nothing while the log tells you everything, decoded in fixing the Nextcloud internal server error. For everything else, I keep a symptom-to-fix reference in Nextcloud troubleshooting: common errors, organized by the exact error strings you'll see, because at 1 AM you search by the string.

Security on a public server

A file server on a public IP collects login attempts from the first hour, and the defaults handle more of this than people fear: Nextcloud ships brute force protection that slows repeated failures, and two-factor auth (TOTP or hardware keys via apps from the catalog) is the single strongest control you can add, starting with the admin account. Server-side, the same rules as any web host apply. Keep the OS patched, keep PHP current and put an intrusion prevention layer in front of SSH and the web ports; my current pick for that job is CrowdSec, which I've introduced from zero in what is CrowdSec, and fail2ban remains the classic alternative. None of this replaces the update discipline above. Most compromised Nextcloud instances I've read post-mortems on were simply months out of date, admin password reused from somewhere, no second factor, running a major that had left support. Boring hygiene would have saved nearly all of them.

Two settings I flip on every new instance: enforced two-factor for the admin group, and expiry dates as the default on public share links, because links outlive the reason they were created with remarkable consistency. Neither costs anything in daily use. Both have mattered.

Apps worth installing

The app catalog is large and uneven, so here's the short list I install on every box. Preview Generator, which pre-renders image previews on a schedule instead of on first view, the difference between a photo library that feels instant and one that stutters. The pattern is occ preview:generate-all once after install, then occ preview:pre-generate on a cron so new uploads get their previews before anyone scrolls past them; the initial run over my 400 GB archive took most of a night (once) and never again since. Calendar and Contacts, which quietly replace a Google account for a family. Notes, plain Markdown files that sync everywhere. And Memories for photos, which has become the strongest reason non-technical family members open the thing at all. Install them from the Apps screen, skim what else looks tempting and resist installing twenty at once; every app runs inside the same PHP processes as your file sync.

That's the map. If you take one habit from this page, take this one: after every upgrade, on every instance, I run sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices and then read the admin overview until it's green. Two minutes, and it has caught almost every problem this series teaches you to fix, back while it was still small.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
Ciclo de Pagamento

VPS.S1

£4.43 Save  17 %
£3.69 por mês
  • 2 vCPU AMD EPYC
  • 2 GB RAMMEMÓRIA
  • 30 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos

VPS.S3

£11.06 Save  33 %
£7.37 por mês
  • 4 vCPU AMD EPYC
  • 6 GB RAMMEMÓRIA
  • 70 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O

EPYC VPS.P1

£6.63 Save  22 %
£5.16 por mês
  • 2 vCPU AMD EPYC
  • 4 GB RAMMEMÓRIA
  • 40 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

EPYC VPS.P2

£12.53 Save  24 %
£9.58 por mês
  • 2 vCPU AMD EPYC
  • 8 GB RAMMEMÓRIA
  • 80 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

EPYC VPS.P4

£22.12 Save  23 %
£16.96 por mês
  • 4 vCPU AMD EPYC
  • 16 GB RAMMEMÓRIA
  • 160 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

EPYC VPS.P5

£29.54 Save  25 %
£22.16 por mês
  • 8 vCPU AMD EPYC
  • 16 GB RAMMEMÓRIA
  • 180 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

EPYC VPS.P6

£44.24 Save  25 %
£33.18 por mês
  • 8 vCPU AMD EPYC
  • 32 GB RAMMEMÓRIA
  • 200 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

EPYC VPS.P7

£51.70 Save  29 %
£36.93 por mês
  • 16 vCPU AMD EPYC
  • 32 GB RAMMEMÓRIA
  • 240 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

Genoa VPS.G2

£18.46 Save  20 %
£14.77 por mês
  • 2 vCPUAMD EPYC Genoa 4ª geração 9xx4 com 3,25 GHz ou similar, na arquitetura Zen 4. AMD EPYC G4
  • 4 GB DDR5MEMÓRIA
  • 50 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

Genoa VPS.G4

£33.24 Save  22 %
£25.85 por mês
  • 4 vCPUProcessador AMD EPYC com núcleos vCPU dedicados, em hardware de servidor empresarial. AMD EPYC G4
  • 8 GB DDR5MEMÓRIA
  • 100 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

Genoa VPS.G6

£66.48 Save  22 %
£51.70 por mês
  • 8 vCPUProcessador AMD EPYC com núcleos vCPU dedicados, em hardware de servidor empresarial. AMD EPYC G4
  • 16 GB DDR5MEMÓRIA
  • 200 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

Genoa VPS.G7

£118.19 Save  22 %
£92.34 por mês
  • 8 vCPUProcessador AMD EPYC com núcleos vCPU dedicados, em hardware de servidor empresarial. AMD EPYC G4
  • 32 GB DDR5MEMÓRIA
  • 250 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível no momento na França, Finlândia ou Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que você pode configurar para diário, semanal ou mensal.

AMD Ryzen VPS.R1

£12.55 Save  18 %
£10.34 por mês
  • 1 CPU dedicada AMD Ryzen 9 7950X com 4,5 GHz ou similar, na arquitetura Zen 4. vCPU
  • 4 GB DDR5MEMÓRIA
  • 50 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6 incluídos O suporte a IPv6 está indisponível no momento na França, Finlândia ou nos Países Baixos.
  • Backup automático incluso

AMD Ryzen VPS.R2

£22.15 Save  17 %
£18.46 por mês
  • 2 CPUs dedicadas AMD Ryzen 9 7950X com 4,5 GHz ou similar, na arquitetura Zen 4. vCPU
  • 8 GB DDR5MEMÓRIA
  • 100 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6 incluídos O suporte a IPv6 está indisponível no momento na França, Finlândia ou nos Países Baixos.
  • Backup automático incluso

AMD Ryzen VPS.R4

£81.25 Save  18 %
£66.48 por mês
  • 8 CPUs dedicadas AMD Ryzen 9 7950X com 4,5 GHz ou similar, na arquitetura Zen 4. vCPU
  • 32 GB DDR5MEMÓRIA
  • 400 GB NVMeDISCO
  • Banda ilimitada
  • IPv4 & IPv6 incluídos O suporte a IPv6 está indisponível no momento na França, Finlândia ou nos Países Baixos.
  • Backup automático incluso

Frequent questions

Can I mount storage I already have, like a NAS share or an S3 bucket?

Yes, the External Storage app (bundled, enable it from the Apps screen) mounts SMB shares, S3 buckets, WebDAV and more into a user's file tree, with the files staying where they are. It's separate from using S3 as primary storage, and far less committal: an external mount can be added or removed on a live instance any day of the week.

GPU products are in high demand at the moment. Fill the form to get notified as soon as your preferred GPU server is back in stock.