Self-Hosting Behind a NAT

But… why??

Wait a minute, we have the cloud now! Why should I bother about self-hosting at all?

  • You can have your own alternative to Dropbox or Google Drive. Just buy a cheap 8TB hard drive and forget about paying monthly fees for getting as much online storage as you want.
  • You can use mStream or Koel as an alternative to a music streaming service (Spotify, Deezer, Apple Music…). If you happen to have an mp3 collection from the days where an iPod was a cool gadget you might as well have been missing it! It’s time to give it a second chance.
  • The same idea applied to Netflix: Streama
  • Who wants to upload photos to Flickr when you have Lychee 😄
  • You can even set up your own Kubernetes cluster using Raspberry PIs. Hours of entertainment await you with that.

Okay, you’ve convinced me, I’m behind a NAT and I want your magic solution!

Setup a Reverse Proxy

http { upstream backend-home { server 0.0.0.0:17899; } server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 301 https://$host$request_uri; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass_request_headers on; proxy_pass http://backend-home; } } }

Some Considerations

[Unit] Description=SSH Tunnel After=network.target [Service] Restart=always RestartSec=20 User=[YOURLAPTOPUSER] ExecStart=/usr/bin/ssh -N -g -R 17899:localhost:8080 yourusername@[YOURONLINEIP] [Install] WantedBy=multi-user.target
sudo systemctl enable sshtunnel sudo systemctl start sshtunnel

--

--

--

The Software Engineering and electric guitar Spanish nerd who lives in Germany. https://www.jdonado.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

npm weekly #194: Read the 2019 JavaScript Ecosystem Survey results, join the future of JavaScript…

How they started: 6 Female Developers Tell Their Story

CSS Grid — Cards Layout & Aspect Ratio

[Job Opportunity] Project SEED is Hiring Game Marketing Manager

RxRepository: Building a testable, reactive, network data repository using RxSwift (part 1)

Serverless session handling for PHP applications

Big Update in Space SIP Game Version 1.2

Free Wizard Of Oz Slots For Ipad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
F. Javier R. Donado

F. Javier R. Donado

The Software Engineering and electric guitar Spanish nerd who lives in Germany. https://www.jdonado.com

More from Medium

CS373 Spring 2022: Daniel Fernandez: Final Entry

CS373: Week of 18 Apr — 24 Apr

$KAWA Security Protocols Explained

Rhythm and Execution Flow