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!!!

  • foonex@feddit.de
    link
    fedilink
    English
    arrow-up
    39
    ·
    1 year ago
    • Update frequently.
    • Use HTTPS. Redirect all HTTP traffic to HTTPS. If you use Caddy as a reverse proxy, this is pretty easy to set up. You‘ll want to get a domain name though.
    • If you use systemd, then systemd-analyze security (with man systemd.directives) is your friend. Be as restrictive as possible without breaking functionality.
    • Consider putting services like Jellyfin or Nextcloud in their own containers/VMs.

    You don‘t need Cloudflare. I don‘t know why half the commenters in this thread recommend it. Cargo cult? You don‘t need DDOS protection. Nobody does DDOS attacks on random home servers. You don‘t need to hide your IP address either. Just make sure that you only expose port 80 and 443 to the internet and nothing else, and don‘t expose the admin interface of your router to the internet.

    Alternatively as others have suggested, if you‘re not sure about your ability to secure everything, only expose your services over a Wireguard VPN. You don‘t really need Tailscale if you only want to manage a handful of devices, and you also don‘t need Tailscale‘s mesh networking for your use case.

    • RxBrad@lemm.ee
      link
      fedilink
      English
      arrow-up
      8
      arrow-down
      2
      ·
      1 year 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
        arrow-up
        9
        ·
        1 year 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
          arrow-up
          1
          ·
          1 year 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
          arrow-up
          2
          ·
          1 year 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.

    • ttk@feddit.de
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      1 year 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