Why pay for Dropbox or Google One when you can self-host Nextcloud on a $3/month VPS? That's what I asked myself six months ago, and now my whole family is on it—photos, documents, calendar, the works.
The setup: 1GB RAM KVM at KnownHost, Debian 12, docker compose with mariadb:10.6, redis for file locking, and caddy as reverse proxy. I followed the official Nextcloud AIO project initially but it was too heavy, so I stripped it down to manual compose.
Tweaks that made it viable:
- php memory limit to 512MB
- mariadb innodb_buffer_pool_size to 256MB
- cron every 5 minutes instead of default ajax background jobs
- preview generator app with strict limits, 2048px max
It worked. Wife synced 30GB photos. Kids use the calendar. I even got the office document collaboration running with OnlyOffice, though that needed 512MB swap to not choke.
Then yesterday: Nextcloud 29.0.4 update. Database migration failed. Corruption in oc_filecache. I had backups... theoretically. Restic to Backblaze B2, but I never tested restore. Never. The one thing you preach to everyone and don't do yourself.
The restore failed because I forgot the B2 application key had expired. Three hours of panic, finally found a week-old manual sql dump on my laptop. Lost a week of family photos.
Lesson: test your backups. Test them. docker exec into your container, restore to temp database, verify. I was so focused on the self-hosting purity that I skipped the boring part.
Still self-hosting though. Just with tested backups now. And a second offsite copy.
For anyone starting out, I use https://restic.net for backups.