Maintenance mode from admin console

Is there a way to enable/disable maintenance mode from the admin console? I could not find anything.

hello @mothership and welcome to the community forum of NC.

What do you mean by “admin console”? If you mean if there’s a way from within NC the answer would be “no” (like if NC isn’t running how could you disable maintenance mode then?)
if “admin console” means bash of your OS the answer would be “yes”… (manual and forum would know how doing that correctly - I’m just blanking on the exact command)

Thanks @JimmyKater , yes I meant the NC GUI where you would set theme, security etc. So I guess then maintenance mode can only be controlled via the command line.

at least it’s not controllable via NC-GUI. afaik

There was an app once but it isn’t maintained anymore…
See https://apps.nextcloud.com/apps/occweb

@szaimen it ran well with some versions above it’s limits… I dunno about NC23, though

@mothership if your asking because you don’t have access to your commandline… here’s another idea: you could put the correct command into a batchfile and run it via cron… or you could enter a maintenance = true; (again: pls look up the correct syntax at forum or manual) in your config.php and then change it back to false after you did whatever you needed to do

Great thanks guys. Will check out the app and if that does not run with NC23 I will cron or config route.

Hi @mothership

Did you read this… adphi/occweb

…especially the warning at the very end :wink:

For obvious reasons, you will not be able to disable maintenance mode again after you enabled it through occ web!

But even on a shared web hosting without command line access, you should be able to edit the config.php file. There you can manually change the value ‘maintanance_mode’ => false, to true, and vice versa.

Thanks, @bb77 I do have access to the config.php so I will use that.

1 Like

Instead of editing the config file manually, you can use the console.

Not sure what OS you’re using, but on FreeBSD I use:

cd /usr/local/www/nextcloud
su -m www -c "php ./occ maintenance:mode --off"

Of course, adjust that command appropriately for your system. (On FreeBSD, the Nextcloud user is www.) But hopefully this points you in the right direction! Using the console, you can turn maintenance mode off in scripts and the like.