Nextcloud Sync Not Working: Complete Fix Guide
Quick Checks
Before diving in, verify these basics:
- Can you access the Nextcloud web UI? If not, the server is down or unreachable.
- Is the server healthy? Check Settings → Administration → Overview for warnings.
- What version are you running? Check Settings → Administration. Update if outdated.
Common Causes and Fixes
1. Trusted Domains Not Configured
Symptom: “Access through untrusted domain” error.
Fix: Add your domain/IP to trusted domains in config.php:
'trusted_domains' => [ 0 => 'localhost', 1 => 'cloud.yourdomain.com', 2 => '192.168.1.100',],Or set via environment variable:
environment: - NEXTCLOUD_TRUSTED_DOMAINS=localhost cloud.yourdomain.com 192.168.1.1002. Reverse Proxy Misconfiguration
Symptom: Redirects loop, mixed content errors, or mobile app can’t connect.
Fix: Add these to config.php:
'overwriteprotocol' => 'https','overwritecliurl' => 'https://cloud.yourdomain.com','trusted_proxies' => ['172.16.0.0/12'], // Docker network range3. PHP Memory Limit Too Low
Symptom: Large file uploads fail, sync drops out mid-transfer.
Fix: Increase PHP memory in your Docker environment:
environment: - PHP_MEMORY_LIMIT=1024M - PHP_UPLOAD_LIMIT=16G4. Database Lock Issues
Symptom: Sync freezes, “file is locked” errors.
Fix:
# Clear file locksdocker exec -u www-data nextcloud php occ maintenance:mode --ondocker exec -u www-data nextcloud php occ files:scan --alldocker exec -u www-data nextcloud php occ maintenance:mode --off5. Desktop Client “Checking for Changes” Forever
Symptom: Client shows “Checking for changes” indefinitely.
Fix:
- Delete the sync journal: remove
.sync_*.dbfiles in the sync folder - Restart the desktop client
- Let it rescan (may take a while for large libraries)
6. Background Jobs Not Running
Symptom: Slow syncing, notifications delayed, previews not generating.
Fix: Verify the cron container is running:
docker compose ps cron# Should show "Up"
# Or check last cron execution:docker exec -u www-data nextcloud php occ background:cronIn Settings → Administration → Basic settings, ensure “Cron” is selected (not AJAX or Webcron).
Still Not Working?
- Check Nextcloud logs:
docker exec nextcloud cat /var/www/html/data/nextcloud.log | tail -50 - Check container logs:
docker compose logs nextcloud - Run a server health check:
docker exec -u www-data nextcloud php occ status
See also: Nextcloud setup guide | Nextcloud slow performance | Docker Compose Basics