1. Install Nextcloud Server.
2. Install the Nextcloud Client on your phone.
3. Set up autosync of media files (photos, videos) with local deletion enabled.
Bonus Tip: Don't expose your Nextcloud server over the public Internet, hide it behind a Pfsense firewall and keep a persistent VPN connection open.
This way you never keep personal or private data on your phone. The moment you take a photo, it's immediately synchronized to your server and deleted afterwards.
@melik I like this. Add in an offsite RAID drive that will protect from being disappeared.