this post was submitted on 10 Oct 2024
31 points (97.0% liked)

Selfhosted

40313 readers
152 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
 

So, here's what I set up:

Docker with some containers behind Gluetun

Gluetun gives access to the local network so I can access the containers on my home network through http.

The only port I exposed to the internet is the 32400 for Plex.

I reach my home network remotely only through Wireguard, my fritzbox router has a guided setupt that gives me a wg configuration so I just scanned the QR code with my phone. I learned this opens the default wg port.

Now, you can never be 100% safe, but is my simple setup safe/solid enough?

9 times out of 10 I thinker with it when I am at home

It's still a work in progress and I am open to any kind of suggestions

top 14 comments
sorted by: hot top controversial new old
[–] snekerpimp@lemmy.world 21 points 1 month ago (2 children)

If you use WireGuard for local access, I don’t think you need to open any port on your firewall, unless you are sharing your plex with other people that do not have access via WireGuard. But I know just enough to get me in trouble, so I’m sure I’ll be corrected on this.

[–] myersguy@lemmy.simpl.website 6 points 1 month ago* (last edited 1 month ago) (1 children)

90% sure wireguard (the VPN server) is going to need an open port if you want to connect from the outside.

[–] mearce@programming.dev 3 points 1 month ago

This is correct. But the port wont reply to anything but a valid client, so it should not be too apparent to a would-be attacker that you have a port open at all.

[–] Tywele@lemmy.dbzer0.com 6 points 1 month ago

No, you are correct. If you are the only person accessing the service you don't need to open any ports since you access your network via Wireguard anyway.

[–] Unmapped@lemmy.ml 4 points 1 month ago

Not really directly answering your question here so feel free to ignore me. But if I'm understanding right your setup sounds like a more complicated way of doing what I am.

I put tailscale on all my devices. And in every docker compose for the ports I do. TailscaleIP:hostport:containerport

So nothing can be access on local network at all. Only through tailscale. Which I can access from any of my devices locally or remotely without opening a port. All E2E encrypted I'm pretty sure. The only con is having to trust tailscale.

I do keep Plex port open for friends though.

[–] MystikIncarnate@lemmy.ca 3 points 1 month ago

One thing that was recommended to me by someone a while ago, is that, unless you need it for something specific, mount your media in Plex as read only.

Plex has functions where you can delete content from the library from their UI. If you need that for some reason, obviously don't make it read only. If you're hoarding the data, and therefore never delete it, or use an external system for deleting files, then RO all the way.

The only caveat to this is if you're using a local disk on the Plex system, which then shares out the drive/folder for adding new content, in which case, you're screwed. It has to be rw so the OS can add/remove data.

In my case, as I think may be common (or at least, not rare), my back end data for Plex Media is on a NAS, so it's easy to simply have the system running Plex, mount that network share as RO, and you're done. The data on the NAS can be accessed and managed by other systems RW, direct to the NAS.

Since Plex is exposed to the internet, if anyone with sufficient rights is compromised, in theory, an attacker could delete the entire contents of your media folder with it. If you limit RW access to internal systems only, then that risk can be effectively mitigated.

[–] possiblylinux127@lemmy.zip 3 points 1 month ago

Don't expose Plex to the internet. Use a mesh VPN service like Tailscale or Netbird

[–] sugar_in_your_tea@sh.itjust.works 3 points 1 month ago (1 children)

I'm doing basically what you're doing, with the main difference being that I have a VPS that tunnels external traffic through a handful of exposed services. I do this so I can get TLS working properly (they all use LetsEncrypt certs, and auto renew).

Yours is simpler, and if it works, great! I would echo what others said here, don't expose Plex unless you actually want to access Plex remotely. Once something is exposed, it's going to get hit with all kinds of automated spam.

[–] Polite_Crocodile@lemmy.dbzer0.com 1 points 1 month ago (1 children)

Plex is shared with family so the door is open. But if I'm getting this right, since it runs in docker and I've enabled 2fa and a strong password it's fine.

Yeah, probably. Just check logs periodically to see if there's anything more than just rogue scripts knocking.

[–] Player2@lemm.ee 1 points 1 month ago

I personally have absolutely no services with an open port to the internet, everything accessed remotely goes through Tailscale. I just don't trust that I could do it myself safely

[–] just_another_person@lemmy.world 1 points 1 month ago (1 children)

Honestly, you're just making more limitations and overhead by running everything over tunnels locally. There are better ways to secure your local network. If this works for you, and you don't want to bother with extra steps, just go for it though.

The downsides are performance, and a lot of extra hurdles trying to get other things to interface with any of the other services.

You'll also be at a disadvantage coming to forums and asking for help, because the preface will be explaining your setup before anyone can really help you with issues.

[–] Polite_Crocodile@lemmy.dbzer0.com 1 points 1 month ago (1 children)

Maybe I asked the wrong question. I meant to ask: this is what I came up with. It works. Some containers in docker and the only open ports are the Wireguard one and Plex. Is it safe to have everything on http inside my home network or should I look into hardening it?

[–] just_another_person@lemmy.world 2 points 1 month ago* (last edited 1 month ago)

Well the service doesn't matter. The authentication and authorization to the service does. If whatever you're running has a solid barrier to entry, then no problems. If it's open without any challenges, AND it can perform actions that harm your network, then that's bad news.

If you're worried about someone getting into your network and hacking something, the tunnels won't do much to prevent that. What you're describing is Security Through Obscurity in a way. You're putting up extra unnecessary barriers that aren't preventing access to something that isn't secure in the first place.