How to run Nextcloud via a reverse SSH tunnel (f.ex. hosting at home)

Reverse SSH tunnel to run behind a router/NAT you cannot edit

Seems familiar? Well, at least for me.
I used quite some time back in 2017 when I wanted to set it up and it wasn’t the most documented case out there. After a few weeks of reading on it, testing out things, I finally got my own home server online, behind a router that I could not edit or port forward on. I had a VPS in germany with 1 core, and it was plenty enough to use as a route for my traffic. And on top of that I could use Cloudflare.

As I thought about it, I came to think about that I never shared this setup with anyone. So after a whole day of writing last Sunday, I compiled a full guide of everything from testing a simple reverse SSH connections until setting up Nextcloud to run behind such a reverse proxy solution. It is a massive 3000 word article on over 18 pages.

I also want you to read through and suggest edits/improvements to do, in case you see there are mistakes or more details required.

You can check it out here on


Nice work! Interesting guide. I have thought many times similar setup. But didn’t have time to study. Your guide looks good for me. Thanks.

Glad to hear it might be what you need! Just let me know if you need any help with issues, I’ll gladly try to help out.