Nextcloud OCC Cheat Sheet

Nextcloud is a powerful open-source platform that provides a range of cloud-based services, including file sharing, collaboration tools, and more. One of the key features of Nextcloud is the ability to manage your installation using the OCC (ownCloud Console) tool. The OCC tool is a command-line interface that allows you to perform various administrative tasks and manage your Nextcloud installation.

In this blog post, we’ll provide you with a handy reference guide for using the Nextcloud OCC tool. This cheat sheet will help you quickly and easily perform common administrative tasks in Nextcloud.

Nextcloud OCC Commands

The OCC tool provides a range of commands that you can use to manage your Nextcloud installation. Here are some of the most commonly used commands:

  • occ files:scan: This command scans the file system and updates the Nextcloud database with any changes. This is useful when files are added or deleted outside of Nextcloud.
  • occ maintenance:mode --on: This command puts Nextcloud into maintenance mode, which disables the ability to log in or use the platform. This is useful when performing upgrades or other maintenance tasks.
  • occ app:list: This command lists all of the installed apps in Nextcloud, along with their status (enabled or disabled).
  • occ config:system:set: This command sets a system configuration variable in Nextcloud. For example, you can use this command to set the maximum file size that users can upload.
  • occ user:add: This command adds a new user to Nextcloud.
  • occ group:adduser: This command adds a user to a group in Nextcloud.

Examples of Nextcloud OCC Commands

To help you get started using the OCC tool, here are some examples of how to use some of the most commonly used commands:

  1. To scan the file system and update the Nextcloud database with any changes:
sudo -u www-data php /var/www/nextcloud/occ files:scan
  1. To put Nextcloud into maintenance mode:
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
  1. To list all of the installed apps in Nextcloud:
sudo -u www-data php /var/www/nextcloud/occ app:list
  1. To set the maximum file size that users can upload:
sudo -u www-data php /var/www/nextcloud/occ config:system:set max_filesize --value="10G"
  1. To add a new user to Nextcloud:
sudo -u www-data php /var/www/nextcloud/occ user:add --display-name="John Smith" --group="users" john.smith
  1. To add a user to a group in Nextcloud:
sudo -u www-data php /var/www/nextcloud/occ group:adduser group1 john.smith

Section 3: Conclusion

The Nextcloud OCC tool is a powerful command-line interface that allows you to manage your Nextcloud installation with ease. By using the commands provided in this cheat sheet, you can quickly and easily perform common administrative tasks in Nextcloud. We hope you find this cheat sheet useful in your Nextcloud administration.