Can this be applied to self hosting on something like a raspberry pi?
I don't talk about on-premise specifically, but if you control your router, you can open specific ports and forward them. You might want to make sure your Raspberry has a static IP (and not dynamically assigned).