I’ve been following this community for some time in order to learn about self-hosting and, while I have learnt about a bunch of cool web services to host, I’m still lost on where/how to start. Does anyone have, like, a very beginner guide that is not just “install this distro and click these buttons”? I have an old laptop that runs Arch (btw), but I’m not familiar with networking at all. So anything starting from “you can check your IP address using ip a” would be appreciated.

More specifically, I have a domain that I want to point to an old laptop of mine (I intend to switch to a VPS if/when I feel like the laptop is starting to lose it). How do I expose my laptop to the internet for this to work (ideally without touching my router, because I’ll be traveling quite a bit with my laptop and don’t mind the occasional downtime). I assume that once I’m able to type my domain name on my mobile and see it open anything from my laptop, I can then setup all the services I want via nginx, but that’s step 2. I tried to follow a few online guides but, like I mentioned, they’re either too simplistic (no I don’t want to move to Ubuntu Server just for this) or too complex (no I don’t know how DHCP works).

Thanks in advance

  • skankhunt42@lemmy.ca
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    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.

    • Goddard Guryon@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      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!

      • skankhunt42@lemmy.ca
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        1 year ago

        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.

        • Goddard Guryon@sopuli.xyzOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          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)

          • skankhunt42@lemmy.ca
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            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.