Quick Reference

Cheatsheets

Practical command references for Linux, networking, servers, containers, databases, and more.

Cheatsheet#owncloud-cheatsheet

ownCloud Cheatsheet

ownCloud is an open-source file sync and share solution. Similar to Nextcloud (which was forked from it), administration is heavily reliant on the occ command-line tool.

Important: The occ command must be run as the web server user (usually www-data on Debian/Ubuntu or apache on RHEL/CentOS).

Basic occ Execution

# Run occ (Ubuntu/Debian)
sudo -u www-data php /var/www/owncloud/occ
 
# Alias for convenience (Add to ~/.bashrc)
alias occ='sudo -u www-data php /var/www/owncloud/occ'

Maintenance

occ status                 # Show ownCloud version and status
occ maintenance:mode --on  # Enable maintenance mode (blocks user access)
occ maintenance:mode --off # Disable maintenance mode
occ upgrade                # Run the database upgrade script

User Management

occ user:list              # List all users
occ user:add alice         # Add a new user
occ user:resetpassword alice # Reset user password
occ user:delete alice      # Delete user

File Management

If you bypass the web interface and place files directly on the server, you must rescan.

occ files:scan --all       # Scan all files for all users
occ files:scan alice       # Scan files for a specific user

App Management

occ app:list               # List all apps
occ app:enable contacts    # Enable the contacts app
occ app:disable contacts   # Disable the contacts app

Configuration

occ config:system:get trusted_domains      # View trusted domains
occ config:system:set trusted_domains 1 --value=cloud.example.com # Add trusted domain