VPS to Home Lab for Cloud Storage reddit / selfhosted ---------------------------------------------------------------------- _ghidra_ · 2023-10-24 13:54 Hi guys, Not sure if this is possible or how it might work but I am trying to get away from using commercial Cloud storage such as OneDrive and set up my own securely but as well as being convenient. While I can connect to a vpn and then upload and download the files, that is a hassle that I do not want to deal with if possible. My idea is to get a VPS, install owncloud, and then install a VPN back into my network, and have the owncloud database stored locally on my machine but only be able to access the owncloud instance on the VPS so that I don't have to let anything through my own network etc. ​ The only problem I am seeing here is how to set the owncloud database locally and link it back to the instance on a VPS. I did look into using zerotrust cloudflare tunnels, just not something I want to expose to cloudflare, as well as running it through NPM souly. If anyone has any additional ideas or input on this, that would be greatly appreciated! ---------------------------------------------------------------------- lolappapalol · 2023-10-24 15:33 So, not exactly a fix for you but you could automate your phone's VPN turn on while you're away from certain networks and turn off when you're back on your home network again. Your VPN would act like an exit node for your network as well, meaning you could access the internet while on WIFI that isn't yours as well. Basically if you're not comfortable with Cloudflare tunnels, I think you'll end up not liking any cloud solution or host. Remember that any host has direct access to your machine and could, without your knowledge, have keys to enter your VPS at any moment, they do create the images you use and have dashboards that let you reset root passwords and such. If you do trust the VPS, then it would make more sense to just create a tunnel between the VPS and your selfhosted server instead of dealing with two databases and keeping them in sync. Cloudflare's tunnels are pretty much your best option for a trustless solution beyond a VPN. ---------------------------------------------------------------------- danya02 · 2023-10-24 17:01 I don't think you need to trust the VPS for this to work: you could have a VPN between the homelab and the VPS, and use the VPS as an entrypoint to it. I have a homelab behind a NAT and I needed to have external access to it, so what I did is I got a VPS that acts as a VPN server, the homelab connects to it, and there's a route manager on the VPS. In my setup, the VPS itself does not do any authentication, and instead it's just directly exposing things in the homelab, and those things are what's responsible for authentication. This means that even if you take over the VPS, you'll still need to break the authentication on the internal services in order to do any damage. In my particular setup, the VPS also does public TLS termination, so you could steal the certificates and MITM a connection with those. For extra paranoia, you could just have the VPS directly forward the packets, and the secure homelab services would take care of decrypting them. Also, if you're going to that extent, you might want to know that VPS providers can MITM you regardless just by issuing extra certificates for your domain, which they can do because they control the IP address. It's not a very likely thing to happen, but it is a distinct possibility, and the only thing that would protect against that is certificate pinning, using your own private CA, or else just using the VPN. Here's a write-up of how it's happened on Hetzner and Linode: https://notes.valdikss.org.ru/jabber.ru-mitm/ ---------------------------------------------------------------------- arcadianarcadian · 2023-10-25 12:59 I'm using Nextcloud, it's forked from Owncloud. Of course, it's possible to link your database to a local machine. Why do you want to store your database on a local machine? Why don't you want to put the database together with Owncloud? Your steps should be like this with my approach. \- Install wireguard software on VPS. \- Install wireguard client on your local machine as a service. \- Install database software on your local machine and use the IP address of wireguard client IP as management. \- Install Owncloud on your VPS. While installing it will ask for the database IP address, so point it as wireguard client IP address. ---------------------------------------------------------------------- _ghidra_ · 2023-10-25 18:31 Thank you for that information! I appreciate it. ​ I dont want the database on the VPS since I would like full control of the storage, backups etc, as well as security purpose, would rather it be on something I own rather then what someone else owns.