Nextcloud
- Source: https://github.com/nextcloud/server
- License: AGPL-3
- Alternatives: ownCloud, Seafile, Syncthing
File sharing and sync — Dropbox/Google Drive alternative.
Setup
Update .env with your variables before first run — many configuration settings are only applied on initial startup.
Housekeeping
Any occ command can be run from the host:
docker exec -u www-data nextcloud php /var/www/html/occ <command>
Migrate mimetypes (after major updates)
docker exec -u www-data nextcloud php /var/www/html/occ maintenance:repair --include-expensive
Add missing indices (after major updates)
docker exec -u www-data nextcloud php /var/www/html/occ db:add-missing-indices
Cron job
Nextcloud wants cron.php run every 5 minutes:
sudo crontab -e
# Add:
*/5 * * * * docker exec -u www-data nextcloud php /var/www/html/cron.php
Verify in Nextcloud: Administration → Basic settings — it should switch from AJAX to Cron (Recommended).
Set maintenance window (UTC)
docker exec -u www-data nextcloud php /var/www/html/occ config:system:set maintenance_window_start --type=integer --value=8
External Storage (MinIO/S3)
- Enable External storage app:
/settings/apps/featured - Go to Administration settings → External storage
- Add AmazonS3 type with Access key:
- Bucket:
nextcloud - Hostname:
minio - Port:
9000 - Uncheck "Enable SSL"
- Check "Enable Path Style"
- Paste MinIO access key and secret key
- Bucket:
Maintenance
# Enter maintenance mode
docker exec -u www-data nextcloud php occ maintenance:mode --on
# Exit maintenance mode
docker exec -u www-data nextcloud php occ maintenance:mode --off
Restart order
- TrueNAS
- MinIO
- Nextcloud
- Everything else
Debugging
# Check pending background jobs
docker exec -it nextcloudsql mysql -u root -p
SELECT COUNT(*) FROM nextcloud.oc_jobs WHERE last_run = 0;
# Manually run cron
time docker exec -u www-data nextcloud php /var/www/html/cron.php