Toggle maintenance on or off for your Nextcloud server

How to toggle maintenance mode on or off for your Nextcloud server

135 views
d

By. Jacob

Edited: 2023-09-11 08:58

sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ maintenance:mode --off

Turn maintenance mode on- or off by first navigating to your Nextcloud root folder. E.g. /var/www/mynextcloud and running the relevant command. E.g:

sudo -u www-data php occ maintenance:mode --on

Like many other things, maintenance mode can be controlled with the occ CLI management tool that comes with Nextcloud.

As an alternative option that might be even safer than placing your Server in maintenance mode, you can also simply stop the relevant services and start them again when you are done performing maintenance. E.g. the Apache HTTP server:

systemctl stop apache

Due to the nature of some tasks. E.g. Switching your Nextcloud domain name or moving your Nextcloud data directory, you may want to stop the relevant services entirely until you are done.

It is also generally a good idea to put your server in maintenance mode while taking backups with tools like tar.

Links

  1. Maintenance commands - docs.nextcloud.com

Tell us what you think:

  1. You need to route ocm-provider requests to index.php to have the error go away. The error started showing after I upgraded my Nextcloud server some time ago, and I have not had time to fix it until now.
  2. The Nextcloud notes app is worth using, because it stores notes in a logical and natural way, secures your notes and ensures you will never lose access to them.
  3. This can happen when the Redis environment is configured incorrectly, and/or when the redis-server.sock file has the wrong permissions.
  4. Prevent your Nextcloud data directory from being accessible from the internet.

More in: Nextcloud