this post was submitted on 01 Feb 2024
52 points (94.8% liked)

Selfhosted

40329 readers
369 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
 

I would like to set up a NAS/Home Server Combination. I am not particularly experienced with networking and this general area, although I can handle Linux well enough at the very least, so I have a few questions, particularly about security, but also other things.


So, here's what I want, to provide a general idea of my plans:

I'd like

  • Storage for my local network
  • Nextcloud
  • "Sync sources" for myself like a self-hosted RSS Reader and I guess Nextcloud counts for this too, with Calendars, Contacts, etc. (These should be available primarily to me, but indirectly through other apps)
  • Collaborative tools also accessible to others (OnlyOffice, Etherpad, etc.)
  • Plex/Jellyfin/Similar
  • Factorio/Minecraft/Tf2 server for a handful of players (not all at once)

This isn't a comprehensive list, but should provide a rough idea


So, my questions:

  1. Is it reasonable to combine a NAS and Home Server?
  2. How do I keep it secure, especially with potentially sensitive data on Nextcloud or in general storage, if I also want others to be able to access parts of it?
  3. What price range am I reasonably looking at if I want, let's say, 8TB (is that normal?) of storage and enough performance to run all the above plus some extra things?
  4. What are some general best practices for hardware upkeep / preventing data loss?
  5. What are some best practices for security overall?
  6. Is there anything you'd like me to know, as a total novice in this field?

I am grateful for any tips, even if they're not entirely related to my direct questions, so please feel free to dump all kinds of knowledge and tips on me, if it's not too much of a bother for you!

top 21 comments
sorted by: hot top controversial new old
[–] abominable_panda@lemmy.world 16 points 9 months ago* (last edited 9 months ago) (3 children)

Theres so much to unpack...! But ill try and throw something in the mix.

I dont know if freenas/ truenas supports a lot of addons or whatever they call it but the moment you mentioned media and games my thought went to proxmox, though i suppose you might also be able to get away with a bunch of docker containers.

Soo.. proxmox (or any hypervisor) will allow you to run multiple segregated VMs and containers.

On one vm you can install freenas/ truenas (whichever the good one is atm, im a little out of touch) and allocate the bulk storage drives to it.

Another vm for Plex/jellyfin

Another for minecraft, factorio, tf2

Another for nextcloud/ webserver

Nextcloud provides webdav/ caldav for calendar and contact syncing so sorted there. It also has a collabora app i think for collaborative document working.

In terms of security, you want to follow nextclouds secure configuration guide as a start.

The best way is to use a vpn to access your home network. Maybe give the others access if you trust them but you may then need to do some vlanning and segregation to protect the rest of your home network from them.

If you must expose to the net (which you may do with the games servers) then again, the config guide has you covered, use crowdsec, use https, use random ports, use strong passwords and mfa.

Do regular backups. 3 copies, 2 separate storage mediums, 1 offsite (3-2-1 rule).

Idk about the 8tb drive.

The above isnt the be all end all. Let it be the start of a discussion and your research journey

[–] pineapplelover@lemm.ee 9 points 9 months ago (1 children)

I mean or docker containers for jellyfin would do fine. I think nextcloud has a docker container as well.

[–] balancedchaos@lemmy.world 6 points 9 months ago

This is how I run all my services. I have a nice docker compose file, I always set my server computers up the same way so no editing will be necessary...

I was using podman, but like all Red Hat products, I found it to be unnecessarily complicated. Yes of course it has better security, but... Docker just works.

[–] CatLikeLemming@lemmy.blahaj.zone 5 points 9 months ago (1 children)

I was considering the VPN option, but as you mentioned for game servers that's not reasonable, and for some of the collaborative tools I'd prefer being able to give people I don't trust that much access, for instance people at work/university, to work together with them on whatever would be needed.

If I just decided to make the home server a home-only server, that would ease a lot of my worries. I guess I could get a personal one, with sensitive info but only home network access, and just rent a second one? It's not like they're that expensive if you're just doing small-scale things and find a decent provider

[–] AlphaAutist@lemmy.world 1 points 9 months ago

You can always do both and expose some services outside your network and keep the others local only while still being able to access them yourself with a vpn.

[–] Grunt4019@lemm.ee 1 points 9 months ago (1 children)

If you must expose to the net (which you may do with the games servers) then again, the config guide has you covered, use crowdsec, use https, use random ports, use strong passwords and mfa.

When you say the config guide has you covered. Where is this config guide?

[–] lntl@lemmy.ml 9 points 9 months ago* (last edited 9 months ago) (2 children)

I have a server exposed to the wan. some ideas:

  • disable password auth for pubkey when you can
  • don't use default ports
  • open as few ports as possible
  • be conservative with your firewall allows: this is your server and not a public service

have fun!

[–] slazer2au@lemmy.world 3 points 9 months ago (1 children)

On that second point use actual random port numbers. Don't be like oh this webapp defaults to port 443, I'll use 4443. You have 65000 ports to pick from. Maybe good to avoid any number that ends in a well known port too. 23,22,25,80,443,8080,8081

[–] lntl@lemmy.ml 3 points 9 months ago

you can find me on Port 70

[–] vsis@feddit.cl 3 points 9 months ago* (last edited 9 months ago) (1 children)

Random ports are easy to discover and there are tools to discover what service is behind a port.

It's annoying for the legitimate user and easy to bypass by an actual attacker.

Also, if you use a random port above 1024 it could be a security issue since any user could star listening if the legitimate process crashes.

See this

[–] lntl@lemmy.ml 1 points 9 months ago

You're advocating for running private services on the default ports?

[–] vsis@feddit.cl 5 points 9 months ago* (last edited 9 months ago)

Some security tips:

Firewall should block everything by default, and you start allowing incoming and outgoing connections when you need them or if something fails.

Disable passwords and root access in ssh daemon.

Use fail2ban or something similar to block bots failing to log-in.

Use random long passwords for everything (eg: like databases). And put then in a password manager. If you can remember the database password, it's not strong enough. If you can remember the admin password for a public web service, it's weak.

Don't repeat the passwords. Everything should have its own random long password.

.env files and files with secrets should be readable only by its service user. Chmod them to 400.

Monitor logs from time to time to see if something funny is happening.

[–] anamethatisnt@lemmy.world 4 points 9 months ago (2 children)
  1. Yes.
  2. Separate VMs in separate VLANs for private and shared storage. Makes things a bit less convenient for you, but worth it imo.
  3. Somewhere between $1000-$2000 I imagine.
  4. RAID is great for minimizing downtime but is never a replacement for a backup. The 3-2-1 rule mentioned below is a good thing to follow.
  5. Never grant higher permissions than necessary, never open more ports than necessary. If your gaming server VMs have no need to communicate with your Nextcloud servers then setup deny rules in your router firewall to stop that traffic from being possible and so on.
  6. Get a proper physical firewall device that allows you full control. I usually use opnsense or pfsense as the software OS.
[–] SaintWacko@midwest.social 4 points 9 months ago* (last edited 9 months ago) (1 children)

Well now I'm concerned. I have plans to do something similar, but I'm only spending a few hundred on my setup. By the time it's done it'll be:

  • Supermicro X9SAE Mobo
  • Xeon E3-1225 v3
  • 32gb ram
  • 2x 240gb ssds in RAID1 for the OS
  • 4x 4TB Ironwolf HDDs for media storage

Is that not going to be enough for pretty much the same use case?

[–] Thorry84@feddit.nl 4 points 9 months ago

Isn't that motherboard alone a few hundred? 4 4TB Ironwolfs is also a few hundred.

[–] magicsaifa@feddit.de 2 points 9 months ago (1 children)

I think entirely separate VMs in different VLANs might be a bit much for a beginner to setup correctly. The Isolation that Docker and it's networking Provides might be enough to start, no?

[–] anamethatisnt@lemmy.world 1 points 9 months ago

I guess it depends on the person. I find starting with "real" VMs and VLANs makes it easier to get an understanding for what's going on underneath the hood, even when you start using Docker containers and the like.

[–] Decronym@lemmy.decronym.xyz 3 points 9 months ago* (last edited 9 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
Plex Brand of media server package
RAID Redundant Array of Independent Disks for mass storage
VPN Virtual Private Network

3 acronyms in this thread; the most compressed thread commented on today has 7 acronyms.

[Thread #472 for this sub, first seen 1st Feb 2024, 20:05] [FAQ] [Full list] [Contact] [Source code]

[–] nutbutter@discuss.tchncs.de 2 points 9 months ago (1 children)
  1. If you are self hosting for privacy, I recommend staying away from Cloudflare, that is, not to use their proxying service or Cloudflare tunnel.

More information here - https://blog.aiquiral.me/bypass-cgnat

[–] tills13@lemmy.world -2 points 9 months ago

For a newbie, cloudflare is fine. Relax.