Activate maintenance mode for nextcloud from BASH command line

Sometimes, one wants to put a nextcloud installation into “Maintenance mode” from the command line. Assuming your nextcloud is installed in /var/www/nextcloud/, the following command will put it in maintenance mode:

sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on

The following command will deactivate maintenance mode:

sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off


(Last update on September 1, 2026 was done by Editor F.)

Leave a Reply

Your email address will not be published. Required fields are marked *