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

40 points
Deleted by creator
permalink
report
reply
6 points

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

permalink
report
parent
reply
9 points

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.

permalink
report
parent
reply
1 point

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

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

permalink
report
parent
reply
3 points

You can use tailscale for that too, but not raw wireguard.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
5 points
*
Deleted by creator
permalink
report
parent
reply
2 points
*

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
permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
1 point

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.

permalink
report
parent
reply
35 points

I am using Tailscale.

permalink
report
reply
24 points
*

In the spirit of selfhosting, you can also host headscale. Its an open source implementation of the proprietary tailscale control plane.

It allows you to get over the 5 device limit (different depending on tiers), as well as keep your traffic on your devices. And, imo, it is pretty stable.

The only issue is that the control plane (by nature) has to be publically accessible. But imo it’s way less of a security target than a massive app like nextcloud.

Edit: device limits were wrong

permalink
report
parent
reply
3 points

It allows you to get over the 5 device limit, as well as keep your traffic on your devices. And, imo, it is pretty stable.

I believe tailscale raised the device limit relatively recently but I agree with you in that I prefer to self-host this type of thing.

permalink
report
parent
reply
6 points

AFAIK it’s now 100, so basically unlimited for personal use.

permalink
report
parent
reply
1 point

Thanks for the correction, edited the post.

permalink
report
parent
reply
17 points

Another vote for Tailscale. Relatively easy to set up and can has some pretty cool features I’m still learning about. I also share my Jellyfin server with family and friends and it meets expectations.

permalink
report
parent
reply
3 points
Deleted by creator
permalink
report
parent
reply
1 point

Yea basically so I send an invite link for my Jellyfin server. They sign up and install the app then use the Tailscale IP to connect to the Jellyfin server. Usually pretty easy but if they don’t really understand I can do it for them once and then it’s good to go.

permalink
report
parent
reply
26 points

I went for wireguard VPN instead of exposing services. Its much more safe afaik, but you have to configure each device you want to give access (aka scanning QR code). You also dont need to buy a domain for that. Exposed services would be easier to use, especially if you want to use it on many devices

permalink
report
reply
19 points
*

Duckdns.org for dynamic dns. You can get a domain name like example.duckdns.org for free.

Caddyserver.com to reverse proxy to your running docker services. You’ll be able to set up jellyfin.example.duckdns.org

Crowdsec.net to secure the network

Tailscale for access to running docker services that you don’t need to share with friends.

permalink
report
reply
5 points

Could you please be more specific what exactly Crowdsec brings to the table? In which way does it “secure the network”?

permalink
report
parent
reply
5 points

Crowdsec will analyse the logs from your reverse proxy and identify malicious actors, bots and whatever else you configure it to. It then tells a “bouncer” (part of your reverse proxy) to reject the request, block the IP or redirect them to a captcha.

The downside is that it’s kinda a pain to get set up, at least in my experience. It also stopped working without informing me and I’ve never been able to get it working again since. If you don’t use docker the experience might be a bit easier.

permalink
report
parent
reply
2 points

There’s even a Traefik Plugins for crowdsec. I guess it’s time to play with my Traefik Config again

permalink
report
parent
reply
2 points

DuckDNS is great, but you only need it if you have a dynamic IP. It’s worth checking if you have a static public IP before adding another layer of complexity.

permalink
report
parent
reply
19 points

As soon as you put something up online, you will de facto become a target with nowhere to hide except offline. Your IP will be known and constantly hammered by more or less serious threats.

If you don’t know the basics of Linux system administration and typical security measures, I would propose 2 approaches: you can go “the NAS way” and purchase something turnkey like a Synology (or anything on which you can easily spin up containers to host your services). You can expect a large part of the administration to be taken care of with sound default settings.

Another approach is to use a beginner friendly distro like https://yunohost.org/ , perhaps more involving, more risky, bit more rewarding.

Also, don’t put anything up there like personal or valuable information (except if encrypted with local-only keys), expect to be hacked, expect to be wiped, and think early on about (off-site) backups.

permalink
report
reply
1 point

Yup, if you have SSH service open on port 22, you’re automatically spammed by bots trying to brute force their way onto the system.

permalink
report
parent
reply
1 point

They’ll brute force ssh against any port, tbf, changing 22 to something else will not buy you much :)

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

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!

Community stats

  • 3.5K

    Monthly active users

  • 3.3K

    Posts

  • 71K

    Comments