view the rest of the comments
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
If you want something publicly accessible (like google, etc) you will have to open a port on your router and point it to your laptop.
If you want something privately accessible (like your router website) then you do not need to touch your router but both devices (laptop and phone) will need to be on the same private network.
What is not possible is to take your laptop to a hotel somewhere, leave it on while you take your phone out in the city and access your laptop via the public internet. You would need access to the hotel router to allow it. I believe this is what you're trying to do from your post above.
IF you want to do something like what I said. You'll need an overlay network. It's basically a virtual private network you can install on your devices. Personally I love tailscale(with headscale) but there are lots. Then you'll be able to connect to your laptop in a hotel from your phone while you're away.
I would start with a website that says hello world without SSL/HTTPS. Get this accessible from your phone on the same network, then decide what you want to do and take it one step at a time. SSL next? Public access? Tailscale access? The idea would be to do it all but one thing at a time.
I did try launching a website on my local network, but widening it to the public network is what I was confused about, like you said. But the idea of overlay network sounds interesting, I'll give it a shot. Thanks!
Your router will get a public IP. For example 1.2.3.4. This is the port your ISP is plugged into. (Perhaps the WAN labeled port) this IP is what you want to access from a different network (cell data, friends house, etc). It's important that you confirm the WAN IP on your router is a real public IP. Some providers actually give you a private (CGNAT) IP and its a huge pain in the ass. Going to what is my IP or whatever and compare it to your WAN IP on the router website is a good test. They should be the same. If they are, no matter where you are in the world you can access the wan side of your router. If not, tailscale is a good option.
The other port on a router has a private IP, for example 192.168.0.1. This could look 4+ ports but that's basically just a switch and more or less the same thing.
Anyway, you have to tell your router, if you get something on the WAN port 1.2.3.4 to TCP port 80 you need to forward it to laptop IP 182.168.0.100 TCP port 80.
If this is successful, you need to make sure the laptop firewall allows access to TCP 80 from anywhere. If you can access the laptop website from your phone on WiFi then its pretty safe bet that its allowed from anywhere, unless you told it otherwise.
I like to test public access from on https://canyouseeme.org/
Edit: to add, this will only ever work if you're at home. Each new network you connect to, you will need to access the router and do the exact same thing to provide access to your laptop. Not ideal, and impossible at something like a hotel or hospital. Overlay network give you a second virtual network that you plug a virtual cable into for all your devices, including phones. If you do this you can just use that second virtual IP to access your stuff no matter where you are.
Ah now it makes a lot more sense. I'll have to stick with things like overlay network simply because my ISP is super unreliable (for example, I'm out of wifi right now because of mildly incovenient weather lmao)
Its worth it. Super cool. However, it does need internet to work. It just gets around CGNAT and networks you don't own (hospital, school, hotel, etc) so you can still access your stuff while you're not at home.