What the message looks like
Nextcloud is in maintenance mode, no apps are loaded.Common causes
- The web updater or a package update was aborted and
occ upgradenever completed. - A backup script enabled maintenance mode and failed before turning it off.
'maintenance' => trueis still set inconfig/config.php.- Wrong file ownership after the update, so occ cannot write
config.php.
Check
- Show status and versions
sudo -u www-data php /var/www/nextcloud/occ status - Check maintenance in the config
grep -n maintenance /var/www/nextcloud/config/config.php - Latest errors in the Nextcloud log
tail -n 20 /var/www/nextcloud/data/nextcloud.log - Is the web updater stuck?
ls -la /var/www/nextcloud/data/updater-*/
Fix
- Finish the pending upgrade:
sudo -u www-data php occ upgrade. - Then turn it off:
sudo -u www-data php occ maintenance:mode --off. - Stuck web updater: remove the
.stepfile indata/updater-*/and rerun the update withphp updater/updater.phar. - Fix ownership:
chown -R www-data:www-data /var/www/nextcloud. - Use
trapin backup scripts so maintenance mode is switched off even on failure.
Typical scenario
An admin starts the update through the web updater and the browser tab is closed after a PHP timeout. The next request shows only 'Nextcloud is in maintenance mode, no apps are loaded'. First run sudo -u www-data php occ status and check whether needsDbUpgrade is true and which versions the code and the database have. That tells you whether the update was interrupted or someone simply forgot to switch the mode off.
FAQ
Can I just set maintenance to false in config.php?
Yes, but only if no upgrade is pending. Otherwise Nextcloud shows the update page or errors afterwards. Check occ status first.
How is this different from maintenance:singleuser?
Single-user mode still lets admins in through the browser; regular maintenance mode locks out everyone.
Is data lost when maintenance mode gets stuck?
As a rule, no. The mode only blocks access; the files and the database stay as they were. What carries risk is what you do next, such as swapping the code version without a backup or switching the mode off during a half-finished migration.
Why is maintenance:mode --off sometimes not enough?
If the update stopped between swapping the code and migrating the database, code and schema no longer match. occ upgrade has to run through first; only then does it make sense to end the mode.
How do I avoid this on the next update?
Update larger instances from the command line with occ upgrade or the CLI updater rather than in the browser, and back up data and database beforehand. The browser updater depends on nginx and PHP timeouts.