this post was submitted on 19 Aug 2023
104 points (95.6% liked)

Selfhosted

40347 readers
312 users here now

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:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. 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.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 1 year ago (3 children)

Holy shit dude, that was actually very helpful! I'll need a few more go-throughs to fully grasp every piece here, but thanks a ton for writing it so precisely.

Based on this though, is there no way to have port-forwarding except setting it up explicitly in my router? I ask this because 1) in my personal setup, I'll be switching between wifi and mobile data quite often, and 2) I may end up on an institutional wifi after some time, in which case I won't have access to the router

[–] [email protected] 6 points 1 year ago (1 children)

You might want to consider setting up a VPN tunnel to your own network. Main benefit is that you can access your home network as if you were connected to it locally. Which makes switching between mobile data and WiFi a non-issue.

This requires some sort of VPN server and usually a single port-forwarding rule for the protocol which your VPN software of choice uses. For the simplest default configuration of OpenVPN this means setting UDP port 1194 to point to your OpenVPN server.

Generally, keeping things simple, there's two types of VPN you can set up:

  • split tunnel VPN, which gives you access to your home network but accesses the internet directly.
  • full tunnel VPN, which sends all of your traffic through your home router.

It is a little more complicated than that, and there's more nuance to it, such as wether to user your own DNS server or not, but all that is best left to some further reading.

I've setup an OpenVPN server myself, wich is open source and completely free to mess around with. (Save for maybe some costs for registring your own domain or DDNS serviced. Those are all optional though, and mainly provide convienience and continuity benefits. You can definitely just setup a VPN server and connect with your external IP adress)

[–] [email protected] 5 points 1 year ago

Or use Tailscale, it's quite easy and it's how I access all of my services

[–] [email protected] 3 points 1 year ago (1 children)

Sorry for the late reply, we had a yard sale today and then company this evening so I'm just getting back to the computer. God this feels like the longest I've been offline in like a decade! Anyway I'm glad it was helpful, I literally rolled out of bed and this was the first post I read this morning so I just started typing, I was a bit worried I might have been incoherent writing so much before I even had breakfast but hey if it came across then I'm glad I helped!

Happy to see others have already stepped in to answer your questions, as with most things there are multiple solutions to your challenges but the first goal is to understand what's going on so you know the right questions to ask. Get your basic setup in place, poke around to see how it all interconnects, and you'll start understanding how other things come in to play. The bit I mentioned about being able to direct your port 80 incoming traffic without affecting your web browsing from another computer (which of course ALSO talks on port 80) really tripped me up until I realized I was overthinking things, so I just trusted that it would keep working and eventually I did find the answers.

So as I mentioned, yep there really is a lot of information to digest when you're learning how networking works, but once you get some of these basics concepts down then the rest will start coming easier. A lot of what I have learned comes from taking a single piece, playing with it a bit to get the hang of essentially what it is doing without getting so deep that I'm overwhelmed, and then moving on to the next piece to see how they interconnect. If you do that long enough you'll start coming back to the first pieces and going deeper into them. Or you'll find some pieces that you can get by only knowing the basics and you'll never need to dig any deeper. The big thing is having an overview of how things connect to each other because yeah, you're going to want to try different things with your servers. Just wait until you build your first firewall with multiple internal networks and even multiple ISP connections (my home network has five local zones plus two ISPs -- just because I can!)...

[–] [email protected] 1 points 1 year ago (1 children)

Haha I think it's best if I stop running towards just getting my own server up and actually learn this stuff instead, regardless of how long it takes. I'll try to follow through on this, thanks again for all the help :D

[–] [email protected] 2 points 1 year ago

Hey no worries, you'll get there. Just kick back and enjoy the ride, because its a lot of fun learning all this stuff!

[–] [email protected] 3 points 1 year ago

Correct. What you'd need in that case is a reverse proxy like ngrok, which is a bit more difficult to set up.