Run OCC Maintenance Commands in Nextcloud AIO

🎯 Purpose

To perform maintenance, repairs, and database optimizations on your Nextcloud AIO instance using the built-in occ command-line interface.

📍 Requirements

🛠 Step-by-Step Instructions

1. SSH Into Your Server

ssh mslsadmin@cloud

2. Enter the Nextcloud Container

docker exec -it nextcloud-aio-nextcloud bash

Note: You'll now be inside the container as root. All occ commands must run as the www-data user.

3. Run Standard Repair

sudo -u www-data php occ maintenance:repair

This command performs:

4. Run Full Repairs with Expensive Operations (Optional)

sudo -u www-data php occ maintenance:repair --include-expensive

This version also:

🔁 Other Common OCC Maintenance Tasks

Disable Maintenance Mode

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

Enable Maintenance Mode

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

Clear File Cache (Use with caution)

sudo -u www-data php occ files:cleanup

✅ After Running

Maintained by MSLS Partners LLC — Internal Nextcloud Guide


Revision #1
Created 2 May 2025 23:40:58 by joliveira
Updated 2 May 2025 23:42:08 by joliveira