Hey guys,

after reading up on selfhosting for weeks now I finally decided to take the plunge today and tried setting up my own nextcloud & jellyfin instances. For this purpose I am using a mini PC. (similiar to an Intel NUC)

Now I would like to make both services available to the internet so I could show images to friends while I’m at their place / watch movies with them.

The problem is I am currently not very educated on which security measures I would have to take to ensure that my server / mini PC doesn’t immediately become an easy target for a hacker, especially considering that I would host private photos on the nextcloud.

After googling around I feel like I find a lot of conflicting information as well as write-ups that I don’t fully grasp with my limited knowledge so if you guys have any general advice or even places to learn about all these concepts I would be absolutely delighted!

Thank you guys sooo much in advance for any and all help, the c/selfhosted community has been nothing but a great resource for me so far!!!

    • @RxBrad@lemm.ee
      link
      fedilink
      English
      611 months ago

      Cloudflare is nice if your ISP uses CGNAT or blocks incoming port traffic (e.g. Starlink or T-Mobile 5G Home Internet).

      • @foonex@feddit.de
        link
        fedilink
        English
        911 months ago

        I see. That‘s a valid use case. Although, in the spirit of self-hosting, I personally would either get another ISP or run a reverse proxy on a cheap VPS and connect the homeserver to that via Wireguard.

        • @RxBrad@lemm.ee
          link
          fedilink
          English
          111 months ago

          Yep. I actually do both. Wireguard on Oracle Cloud for my Plex.

          Cloudflare to serve up stuff like Overseerr & my WordPress blog.

        • @RxBrad@lemm.ee
          link
          fedilink
          English
          211 months ago

          I actually do use raw Wireguard on an Oracle VCN instance so I can share my Plex on T-Mobile Home Internet.

          (Plex is against Cloudflare’s ToS, which is why I don’t use them for Plex)

          Tailscale is good for people who are techy enough to use it. But it’s not much help for my grandma if she wants to watch a Plex movie on her Roku.

    • @Melco@lemmy.world
      link
      fedilink
      English
      5
      edit-2
      11 months ago

      I agree with this assessment. You do not need an overlay mesh network like tailscale for your use case that is way overkill.

      And if you are running Jellyfin as opposes to Plex then you probably care about realizing the security benefits of open source so you definately don’t need a closed source proprietary solution like tailscale or creating accounts on someone elses computer for protection from x. Cloudflair is selling a closed source solution to a problem you don’t have.

      This is selfhosting yet these recommendations are all for signing up for accounts and software from the largest centralized systems on the Internet and routing all your traffic through Oracle or cloudflair, Lol You don’t need any of that noise.

      Your best bet is to create a reverse proxy- a single ingress point in front of those few services with a single open port. Pick whatever web server you want your server already has Apache and it like 10 lines of config very simple.

    • @ttk@feddit.de
      link
      fedilink
      English
      2
      edit-2
      11 months ago

      Two remarks:

      • Containers are (and never were) no security instruments but only fancy ways of bundling things
      • You can open up other ports to the internet if you know what you’re doing. My SSH is open to the internet, but only with key based auto, and in case i need pw auth as a backup, only with 2FA enabled
      • @foonex@feddit.de
        link
        fedilink
        English
        111 months ago

        So, putting a process in its own network, file-system, user etc. namespace does not increase security in your opinion?

        • @ttk@feddit.de
          link
          fedilink
          English
          111 months ago

          Indeed. Sure, they have these features, but only if used correctly while introducing vast more complexity (especially when being executed in a k8s environment,but also executed in plain docker). But, you know what also has security when used correctly? Plain linux.

          What about 90% of all images on docker hub executing their main payload as root? What about many images bundling unnecessary software like an init system? What about the fact that even if you rm something in a dockerfile, it is still present, if you execute the rm in a different RUN command? What about every user in the docker group being implicit root on the host since they simply can mount the host’s / inside their container? What about the reusing of layers between images like it is even intended?

          Doesnt sound like a security tool, does it? Sure, it feels a bit like one, but it was never intended to be one, but a dependency and environment bundling tool which happens to use certain linux APIs which can be used for security. But it wraps lots of abstraction around it.

          If you want to use these features for security, access them manually. But, OP said they are kind of a noob. Telling them to just use containers is dangerous and leads to false assumptions.

          Source: i work as a cloud/container/devops/k8s expert for over 5 years.

          • @foonex@feddit.de
            link
            fedilink
            English
            111 months ago

            If you want to use these features for security, access them manually. But, OP said they are kind of a noob. Telling them to just use containers is dangerous and leads to false assumptions.

            You are absolutely correct. I should have stated explicitly that I didn’t mean docker and/or using pre-built container images. I was talking about something like systemd-nspawn. And you are right that I should not have brought this up in this context. I will edit my original comment.

            • @foonex@feddit.de
              link
              fedilink
              English
              1
              edit-2
              11 months ago

              Great, I accidentally deleted my original comment because the Lemmy web interface doesn’t ask for confirmation when you click the delete button. And the buttons are so small on mobile that it‘s really easy to click the wrong button.