I’ve been wanting to get into self hosting for a long time and messed about a bit with setting up a nextcloud. But while I am reasonably well versed in linux and programming all things to do with the internet are quite confusing and mostly after reading blogposts and the like I am feel like I am missing so much knowldedge. From why people use traefik, how and why to use docker containers, what settings to change on the router, how to connect and setup the domain, and probably most importantly how to do this safely. Is there a good book or site that explains these more basic things?

  • Leigh Weigh@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    9 hours ago

    Ooohh I’m going to save this post. Looking to dip my toes into some self hosting and I don’t even know where to begin. Thanks for asking OP!

  • NaibofTabr@infosec.pub
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    1
    ·
    edit-2
    12 hours ago

    Computer networking is basically a completely different field from operating systems and programming, though obviously some of the concepts are relevant. Turns out plugging these things into each other so that they can share information in a useful way is kind of difficult. A lot of very smart people have been working on it for almost 70 years, and frankly it’s still a fucking mess, so don’t feel bad if you feel a little lost.

    Starting with the basics is the right instinct, in my opinion. Start with the OSI model:

    https://jakarta.telkomuniversity.ac.id/7-osi-layer-the-building-blocks-of-networking/

    https://www.geeksforgeeks.org/computer-networks/osi-model-analogy-osi-7-layers-explained/

    This helps to break down the actual functioning of the network into logical steps. It’s very helpful when you’re trying to visualize the operation of some of the more abstract bits of the technology stack (like TCP/UDP), and when you’re trying to think through what piece of it might be causing your problem in the moment (the router is on and the cables are plugged in, why is there no connection?). It’s a map that can help you when you’re lost. It’s also a guide to how a lot of people who work on networking technology think, so it can help you understand how things are supposed to work.

    Beyond that, Professor Messer is a great resource: https://www.professormesser.com/

    If you feel reasonably confident with computer hardware components and various types of cable connectors, you can probably skip the A+ part and go straight into Network+. Because you’re doing this as a home hobbyist (not for the actual certification), I recommend just listening to the courses like you would a podcast. Don’t try to memorize or fully understand everything, just use it to get a grasp of the terminology and purpose of the various pieces.

    I also recommend taking on a project to gain experience. Implenting PiHole https://pi-hole.net/ for your home network will cover routing, DHCP and DNS, plus you can do it with a Docker container.

    • Leigh Weigh@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      8 hours ago

      it can help you understand how things are supposed to work.

      Man knowing what the intent probably was and the thought process to get there helps with so much troubleshooting. Not just in tech but everywhere.

    • Envidon@feddit.nlOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 hours ago

      Thanks a lot, I think these resources will help me a lot, something breaking down all the layers will help understand what is talking to what and why.

    • BaroqueInMind@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      2
      ·
      10 hours ago

      Your OSI model image is weird af: an ethernet cable is also layer one (iee 803.x, so is a coax line), dunno why you have it labeled like that, just confuses people.

      If you meant ethernet protocol, thats a completely different thing, and you never labeled it as such.

  • frongt@lemmy.zip
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 hours ago

    No, there is not one resource for all of these things. Any guide that takes you end to end setting up one service is going to omit a lot of important context. I would research each step individually.

  • Denys Nykula@piefed.social
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    11 hours ago

    To your specific questions:

    why people use traefik

    Reverse proxies let you serve multiple apps from one server, encrypt your traffic and automate updates of encryption certificates. I use Apache (virtual hosts, mod_md) for this.

    how and why to use docker containers

    Modern web apps have many constantly shifting dependencies and don’t work closely with distributions on packaging them, so they have to be updated separately from the base system. They might also need different versions of these dependencies, and multiple instances of one dependency (e.g. database). Containers are one way to achieve that, and also ease backups, monitoring of individual apps, and installing an application in exact same way on development and testing machines.

    what settings to change on the router

    To expose ports 22 (ssh), 80 (http) and 443 (https) to world, forward them to your server.

    how to connect and setup the domain

    In the DNS settings for your domain, point “A” record to your home IP. That’s if you rent a static IP. If you don’t, things will be more complicated, research on your own.

    how to do this safely

    Bare minimum: set up daily backups of container volumes and reverse proxy configuration, same for updates of base system and containers, and turn off SSH password login in favor of keys. Test that a backup can be successfully restored in a virtual machine at least once a month.

    • non_burglar@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      9 hours ago

      Op specifically asked for resources for learning and not sparse answers from users.

      research on your own

      Come on, man. Did you even read the post.

      • Denys Nykula@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 hours ago

        Where does OP say that they only want resources and no answers at all? Also you sadly misquote me by stripping context, I replied that there’s a simple solution (and how specifically to look for it) to one of their questions if one condition if satisfied, and that the problem doesn’t have an easy answer otherwise, therefore needing more research. I went out of my way to give OP brief answers and more specific questions for research, like I do for my students, and you make it look like I just wrote RTFM.

  • lntl@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    11 hours ago

    Like 10 years ago, I got started by doing this project:

    OpenBSD PF: Building a Router

    In general, I’d recommend ANY BSD documentation or guides, they’re all written by knowledgeable ppl who are also likely educators in CS departments. Also, I’d recommend actually doing a project. Reading is useful and IMO the doing is much more effective.

  • gedaliyah@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    11 hours ago

    Following because I am really a beginner myself. That said, I have been self-hosting a dozen or so services for about 2 years now. It is very intimidating to begin.

    A docker container is basically a sort of virtual machine stripped down to what is precisely essential for a given container. That means that apps running in docker are repeatable and will run identically on any hardware and software.

    When it comes to networking, you can choose to have services exposed to the internet or not. If they are not exposed, you can only access them over a local network. That might be fine for a nightly backup or HomeAssistant that’s only operated locally. It’s a good place to start.

    You can also use a certain type of VPN to create a virtual local network. That allows you to access your home server from any connected device. That’s what I do, using Tailscale. It is fine if you are only connecting to the server from a limited number of devices, since each one will need to be logged in to the same network.