Project

General

Profile

Actions

Essential Commands for Managing Apps with 'occ'

The sudo -u www-data php occ command in Nextcloud allows you to execute various administrative tasks and commands. Here are some common commands you can use with occ:

occ app:list : Lists all installed apps and their versions.

occ app:enable <app_name> : Enables a specific app.

occ app:disable <app_name> : Disables a specific app.

occ app:update <app_name> : Updates a specific app to the latest version.

occ maintenance:mode --on : Puts Nextcloud into maintenance mode, preventing user access.

occ maintenance:mode --off : Takes Nextcloud out of maintenance mode, allowing regular user access.

occ db:add-missing-indices : Adds missing database indices for performance optimization.

occ db:convert-filecache-bigint : Converts file cache to use bigint for large installations.

occ config:system:set <parameter> --value=<value> : Sets a configuration parameter with the specified value.

occ config:system:get <parameter> : Retrieves the value of a specific configuration parameter.


User Management:

occ user:list : Lists all users in Nextcloud.
occ user:add <username> --password=<password> : Adds a new user.
occ user:delete <username> : Deletes a user.
occ user:resetpassword <username> : Resets the password for a user.

Group Management:

occ group:list : Lists all groups in Nextcloud.
occ group:add <groupname> : Adds a new group.
occ group:delete <groupname> : Deletes a group.
occ group:adduser <groupname> <username> : Adds a user to a group.
occ group:removeuser <groupname> <username> : Removes a user from a group.

File Operations:

occ files:scan <user> : Triggers a rescan of files for a specific user.
occ files:cleanup : Cleans up file versions and deleted files.

Server Maintenance:

occ maintenance:repair : Performs repair operations on the Nextcloud instance.
occ maintenance:update:htaccess : Updates the .htaccess file.

Logs and Debugging:

occ log:manage : Manages log files.
occ log:show <file> : Displays the contents of a log file.

App Management:

occ app:check-code <app_name> : Checks the code of an app for potential issues.
occ app:install <app_name> : Installs a specific app.
occ app:uninstall <app_name> : Uninstalls a specific app.
occ app:enable <app_name> : Enables a specific app.
occ app:disable <app_name> : Disables a specific app.
occ app:update <app_name> : Updates a specific app to the latest version.

h3. Background Jobs:

occ background:webcron : Executes Nextcloud background jobs via the webcron method.
occ background:cron : Executes Nextcloud background jobs via the system cron method.

Encryption and Security:

occ encryption:enable: Enables server-side encryption.
occ encryption:disable: Disables server-side encryption.
occ encryption:scan: Scans and repairs encrypted files.

Sharing and Collaboration:

occ files:scan-app-data : Rescans the app data folder.
occ files:scan:all : Rescans all files for all users.
occ group:adduser <groupname> <username> : Adds a user to a group.
occ group:removeuser <groupname> <username> : Removes a user from a group.

Database and Maintenance:

occ db:add-missing-indices : Adds missing database indices for performance optimization.
occ db:convert-filecache-bigint : Converts file cache to use bigint for large installations.
occ maintenance:mode --on : Puts Nextcloud into maintenance mode.
occ maintenance:mode --off : Takes Nextcloud out of maintenance mode.

System Information and Status:

occ status : Displays the system status and information.
occ status --output=json : Retrieves the system status in JSON format.

Theming and Customization:

occ config:system:set theme <theme_name> : Sets the active theme for Nextcloud.
occ config:system:set logo <path_to_logo> : Sets a custom logo for Nextcloud.
occ config:system:set background <path_to_background_image> : Sets a custom background image for Nextcloud.

Collaborative Tags:

occ dav:sync-system-tags : Synchronizes system tags across all files.

External Storage Management:

occ files_external:list : Lists all external storage configurations.
occ files_external:info <config_id> : Displays information about a specific external storage configuration.
occ files_external:create <backend> <config_id> <config_options> : Creates a new external storage configuration.
occ files_external:delete <config_id> : Deletes an external storage configuration.

Configuring and Checking Integrity:

occ config:system:set <parameter> --value=<value> : Sets a configuration parameter with the specified value.
occ config:system:get <parameter> : Retrieves the value of a specific configuration parameter.
occ integrity:check-core : Checks the integrity of Nextcloud core files.

Updated by Gareth Eaton 11 months ago · 1 revisions