If I’m not mistaken airdrop and quickshare should be your go-to for iphones/android devices within their ecosystem. Localsend can fill in the gaps and as far as I remember just requires the app to be installed, no port forwarding required.
Hosting a fileserver depends on a bit more than just RAM, but you can just try out some solutions (Nextcloud comes to mind besides the things you already mentioned), and see what runs best on your hardware.
Actually, instead of 5150-ing people the solution that works in other countries is to provide medical access to drugs. So basically allow someone to live a life with their illness after treatments have failed to cure them: https://www.cbc.ca/news/canada/british-columbia/canada-now-allows-prescription-heroin-in-severe-opioid-addiction-1.3753312