We are still actively working on the spam issue.

Difference between revisions of "Home server"

From InstallGentoo Wiki
Jump to: navigation, search
(Redirected page to Home server Original)
(Tag: New redirect)
(Restoring old content over the redirect)
(Tag: Removed redirect)
 
Line 1: Line 1:
#REDIRECT [[Home server Original]]
+
[[File:clark_griswold_builds_a_server.png|500px|thumb|right|This could be you]]
 +
Home servers are about learning and expanding your horizons. De-botnet your life. Learn something new. Serving applications to yourself, your family, and your frens feels good. Put your /g/ skills to good use for yourself and those close to you. Store their data with proper availability redundancy and backups and serve it back to them with a /comfy/ easy to use interface.
 +
 
 +
Most people get started with NAS. It’s nice to have a /comfy/ home for all your data. Streaming your movies/shows around the house and to friends. Know all about NAS? Learn virtualization. Spin up some VMs. Learn networking by setting up a pfSense box and configuring some VLANs. There's always more to learn and chances to grow. Think you’re god tier already? Setup openstack and report back to [https://boards.4channel.org/g/catalog#s=hsg /hsg/].
 +
 
 +
Things that are online today might not be online forever. It's good to have a copy of something because you never know when it might get taken down due to copyright strikes.
 +
 
 +
 
 +
==Hardware==
 +
What hardware you get depends mostly on your use case. A simple file server can be run on an SBC with a couple hard drives attached. If you want to do more fancy things like virtualization, streaming 4K movies, etc you are going to want better hardware. If you plan on using ZFS or Btrfs, server grade hardware and ECC RAM are recommended but not required.
 +
 
 +
===Server options===
 +
There are many roads to the Home Server. Each one has upsides and downsides. It's up to you to decide what works best for your requirements.
 +
 
 +
====[[Single board computers|Single Board Computers]]====
 +
[[File:Odroid-cluster.png|350px|thumb|right|A cluster of Odroid HC2]]
 +
For simple home use, such as a file server or single user direct play PLEX server, these options might be an appealing and inexpensive and energy efficient option. Expect performance issues if you try to scale though, and don't expect to be able to run multiple virtual machines or do heavy transcoding, you don't have many options for expansion and little to no options for upgrading either. Forget a hardware RAID card or having any SATA ports at all. You likely won't be able to add much more ram, and definitely won't be able to increase processing power unless you go the clustering route and purchase multiple units. If your use case is compute intensive or would require expansion cards such as a [[GPU]], SBCs are likely not a good option.
 +
 
 +
If you decide to go with an ARM-based board be aware that some software will be unavailable.
 +
This tends to be because the software is [[proprietary]] and the developer is uninterested in supporting ARM.
 +
Among ARM-based SBCs the [[Raspberry Pi]] has by far the best software support as it has the largest userbase.
 +
 
 +
Connecting hard drives via USB docks may have some performance impact. It is not recommended to use USB HDD docks with multiple disks for a server.
 +
 
 +
* Pros
 +
** Extremely energy efficient, thanks to ARM's architecture.
 +
** Lowest cost new hardware you will find.
 +
* Cons
 +
** Extremely limited expansion.
 +
** Extremely limited upgrade path.
 +
** Potentially poor software support.
 +
 
 +
* [[Raspberry Pi]]
 +
** [https://www.raspberrypi.org/products/raspberry-pi-5/ Raspberry Pi 5] - much more powerful than the 4b, but also more expensive. Has PCIe (2.0 x1). 4GB model $70, 8GB $95. Add $25 for power supply and case.
 +
** [https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ Raspberry Pi 4b] - superceded by above, worth it only if you can pick one up cheap. 4GB model $65, 8GB $90. Add $20 for power supply and case.
 +
 
 +
* [[Odroid]] / NanoPi / OrangePi (needs updating)
 +
 
 +
====Repurpose Old Hardware====
 +
If you have an old gaming PC, workstation, laptop, or spare parts lying around, you might be able to get away with using them as your server (provided they are not ''too'' old).
 +
Performance and capability will vary wildly from machine to machine. When in doubt post specs in /hsg/ and ask.
 +
 
 +
Laptops are not really designed for 24/7 use, but their battery does act as a built in UPS to a certain extent.
 +
 
 +
If you already own the hardware, this option is free, which can be very appealing and a great way to get started or test your setup before buying more ideal hardware.
 +
Keep in mind that a lot of old PCs are very power hungry (for example with Intel Core 2 CPUs). In some places this means that your power bill for this machine could be more expensive than the cost of some new cheap SBCs and their power bills combined. You may well be better off selling and putting the money towards newer used hardware. Its strongly suggested you don't even bother with anything older than sandybridge and even that is pushing it. Consider that in many parts of the world you can pick up 6th or 7th gen intel systems for less than $100.
 +
 
 +
====Build Your Own====
 +
[[File:ExampleNASpartlist.png|450px|thumb|right|Example NAS/server part list. i3 9100 is a reasonable budget choice, can handle a few VMs and light transcoding, supports ECC ram and virtualization. Node 804 is a popular case option.]]
 +
 
 +
{{Tip|1=If you have never built a PC before, read the [[Build a PC]] page. If you have questions try asking in [https://boards.4channel.org/g/catalog#s=pcbg /pcbg/]}}
 +
 
 +
If you have the money, buying new hardware is a viable (but expensive) option. Knowing exactly what you are getting and peace of mind that you can RMA any DOA items, as well as reasonable shipping prices are good reasons to buy new.
 +
A combination of new hardware and repurposed older hardware is also an option if you are on a bit of a budget.
 +
 
 +
Things to look out for when choosing a motherboard are features such as IPMI, Intel NICs (for SR-IOV) and support for ECC RAM.
 +
Supermicro/Asrock Rack and Gigabyte have good options for server/workstation boards. "Prosumer" boards are usually incredibly expensive and not worth the money.
 +
 
 +
If using Intel CPUs check [https://ark.intel.com/content/www/us/en/ark.html#@Processors ark.intel.com] for information on your CPU.
 +
Some features to look for:
 +
* [https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video Intel Quick Sync Video] allows for hardware accelerated video encoding. Only on CPUs with integrated graphics.
 +
* VT-x and VT-d are must haves if you plan on using virtualization of any kind.
 +
* ECC RAM Support
 +
 
 +
For AMD, pretty much all CPUs support virtualization extensions. AM5 CPUs all support ECC. For AM4, you may need a "PRO" cpu for ECC support. ECC support is also motherboard dependent. AMD has multiple confusing equivalents to Intel Quicksync depending on CPU, though they lag behind Intel in both speed and quality.
 +
 
 +
====Buy Used Consumer Gear====
 +
Ex lease office PCs can be had very cheaply and, depending on your use-case, offer a good low-cost option. Don't go this route if you want to connect more than 2 3.5" hard drives as most systems aren't designed to take any more than that.
 +
Don't buy anything pre Skylake for Intel, for AMD don't go any older than Zen 2 (Ryzen 3000).
 +
*The cheapest options are usually SFF. Expect a base idle power consumption of 10-20w. Should have all the expansion you would expect on an mATX motherboard. Tend to have a single 3.5" hdd bay, a 2.5" bay and slimline optical drive if fitted at all.
 +
USFF tend to be slightly more expensive, the "TinyMiniMicro" tax. Powered from external DC brick, just like a laptop. Some -but not all- have PCIe. ServeTheHome have a wealth of information on these.
 +
Mini-towers, about the size of a small desktop, offer little benefit over SFF besides additional space in the case, 2 or 3 3.5" bays but perhaps space for more if you're creative. They often use the same motherboard as their SFF counterparts.
 +
Workstations are much more expensive but commonly offer ECC, more powerful CPUs and more RAM slots. They still tend to be limited on the 3.5" bays if you need a lot of storage but, again, theres often space inside for more if you're creative. Usually come with discrete workstation GPUs that you can resell. Significantly higher power consumption than other options in this list, largely down to the higher wattage power supplies.
 +
Additionally, there are a few thin clients that are actually powerful/cheap enough to be tempting options. [https://www.parkytowers.me.uk/thin/ This site] has some good info on many of the cheaply available models.
 +
 
 +
Alternatively, you can buy used DIY parts. For that you want the newest you can afford.
 +
* If you're concerned about power consumption, don't get an AMD cpu with the IO die, as it alone consumes 10+w even at idle. No AM4 CPUs with integrated graphics have the IO die.
 +
* AMD PRO (am4) cpus support ECC, but DDR4 UDIMMs are hard to find at a good price.
 +
* You're unlikely to find anything intel with ECC support at a good price, though its not impossible.
 +
 
 +
====Buy Used Enterprise Gear====
 +
{{Tip|Rule of thumb: don't buy anything over ~7-8 years old for general use and always research the hardware '''BEFORE''' making an offer!}}
 +
Buying Used enterprise hardware can be a cheap, but somewhat unreliable option. Waiting for a good deal might not be for everyone but the rewards are great. Tremendous amounts of storage potential at a relatively cheap price. Some rackmount servers will even come with drives preinstalled.
 +
 
 +
Be aware though, rackmount servers are usually pretty loud, and many older Xeons can be extremely energy inefficient. Avoid opterons at any cost unless you want a space heater.
 +
 
 +
* Some older legacy systems do not support UEFI and thus cannot boot a UEFI OS.
 +
* Older hardware specs may become performance bottlenecks (Earlier SATA/PCIe/SAS/USB revisions).
 +
* Some Very old (8-10 years) high end CPUs actually perform worse than modern low-to-mid end CPUs.
 +
* Lack of support for potentially desired features such as Intel QuickSync, 1Gb/10Gb Ethernet, m.2, etc.
 +
* Some disk shelf/server backplanes are SAS only and won't accept SATA drives.
 +
 
 +
Good places to find old server hardware:
 +
*[https://www.labgopher.com/ Website which gathers eBay listings for server hardware]
 +
 
 +
====Prebuilt NAS====
 +
Only buy a prebuilt NAS if you want to spend more and get less.
 +
 
 +
They are typically woefully underpowered for the price and you’re better served with a $65 Odroid than a $300 QNAP/Synology with a shitty Celeron and 1gb of ram.
 +
That said, they are the most noob friendly option with a GUI interface for setup.
 +
 
 +
===[[Storage devices|Storage]]===
 +
[[File:Got_Cucked.png|420px|thumb|right|Anon got cucked by the shucking gods]]
 +
====Shucking====
 +
It's massively cheaper(sometimes) to buy WD Easystores or WD Elements (when they go on sale) than it is to buy an equivalent size NAS hard drive like WD Red/Iron wolf. Just remember: YOU VOID YOUR WARRANTY(if you live in freedom land, yuropoors retain their warranty as long as you still have the shell and can put it back together). If your drive fails you are most likely fucked. When you buy regular NAS drives you are basically paying more for the warranty.
 +
 
 +
Some other things to consider if you decide to shuck:
 +
* Shucked drives under 8TB might be SMR drives.
 +
* Shucked drives lack the middle mounting hole that most other drives have. You may need an adaptor for your HDD trays if your case doesn’t support them. Some cases might not have adaptors at all, research before buying your case!
 +
*Some 8 and 10TB drives are air-filled rather than filled with helium. These air-filled drives can run significantly hotter than the helium ones. Check the model number with Crystal Disk Info before shucking, if it has an H it is most likely a helium drive. If you have airflow constraints in your case, it might be better to try and get Helium drives, otherwise it shouldn't be much of an issue.
 +
 
 +
=====3.3v pin issue=====
 +
[[File:Ext-drive-pins.jpg|250px|thumb|left|These pins]]
 +
Some shucked drives '''WILL NOT BOOT''' with most consumer [[Power supply|power supplies]]. This is because of a feature on enterprise drives that lets administrators reboot hard drives by powering the 3.3 volt pin which isn’t used on consumer hard drives. Consumer PSUs, of course, always power this pin, so the hard drive will be stuck in an infinite boot loop and never power on. This can be solved by covering the first three pins on the hard drive with insulating Kapton tape or using a power cable with the 3.3v pins disconnected.
 +
 
 +
* '''DO NOT use liquid electrical tape. This can damage the drive.'''
 +
* '''DO NOT cut the SATA power cable this can damage the drive and your PSU.'''
 +
* Molex to SATA adapters DO work but be careful, as some of the poorly made ones can catch fire. I wouldn’t risk it. [https://www.youtube.com/watch?v=TataDaUNEFc See this video].
 +
 
 +
* [https://www.ifixit.com/Guide/How+to+Shuck+a+WD+Elements+External+Hard+Drive/137646 Shucking Guide]
 +
* [https://shucks.top/ Price Tracker for external drives]
 +
 
 +
====SMR v CMR====
 +
SMR stands for "shingled magnetic recording" It's an alternative method to conventional magnetic recording (CMR) that traditional hard drives use. While SMR technology allows for greater data density, they are also slow compared to CMR. These drives are bad for NAS use cases and especially bad for ZFS due to compatibility issues. Just avoid them all together. All Seagate NAS drives are CMR. Easystores/Elements 8tb and above should be safe.
 +
 
 +
* [https://www.ixsystems.com/community/resources/list-of-known-smr-drives.141/ List of SMR drives].
 +
 
 +
====SSD====
 +
SSDs are recommended for the OS and programs only, or for use in cache, or L2ARC cache/SLOG in ZFS.
 +
 
 +
Don't buy SSDs for main storage unless you want to spend tens of thousands. Check out the [https://ssd.borecraft.com/SSD_Buying_Guide_List.pdf SSD buying guide] for more on SSDs.  If you do have a large SSD array, post the details in /hsg/ so we can all drool.
 +
 
 +
====Expanding Your Storage====
 +
If you find you have run out of SATA ports on your motherboard but require more storage, there are a number of options for increasing the number of drives your server can support. The best and recommended approach is to use a SAS HBA with SAS to Sata breakout cables. Each SAS port can support up to 4 Sata drives (or even more if you use an expander). You can find used LSI SAS HBAs on eBay for relatively cheap which have ~2 internal ports, or 8 total SATA drives. Avoid SAS1 cards as they are far too old by now and have some limitations. If your case can no longer support more drives, you may want to look into buying an External SAS HBA, which will allow you to connect drives in an external enclosure directly to your server.
 +
 
 +
* Some videos on SAS controllers and cables which I found very helpful. If you are new to using SAS you should watch these:
 +
** [https://youtu.be/hTbKzQZk21w Overview of common used LSI SAS controllers on the market]
 +
** [https://youtu.be/OW419HwU7sg Overview of SAS cables]
 +
** [https://youtu.be/qccpopxc_Uo Using a SAS expander to connect 24 HDDs using only one controller]
 +
 +
Sata HBAs and port multipliers/Expanders are not recommended. They are garbage and not worth buying. SATA port multipliers specifically can cause issues when you try to us any kind of RAID with them.
 +
 +
There are some counterfeit LSI cards on the market, avoid Chinese sellers, sellers with no return policy, etc.
 +
 
 +
* [https://forums.servethehome.com/index.php?threads/how-to-buy-non-counterfeit-lsi-9207-8i.26304/ How to buy non counterfeit LSI].
 +
* [https://www.youtube.com/watch?v=QQUWwhDU_KQ Good video on how to spot counterfeits].
 +
 
 +
====Drive Recommendations====
 +
Generally speaking, it's always best to buy the cheapest possible TB/$ drives you can buy while aiming to build redundancy and backups into your storage plan. This may be used drives(if you're willing to roll the dice on having no warranty), this may be shucked drives(If you're okay with shucking and taping pins), this maybe be new general purpose drive(Remember and stay away from SMR drive), and very rarely you might get a good deal on an "enterprise" or "NAS" rated drive for cheap. Enterprise disks have more powerful motors (so they last longer when run 24/7) and typically come with better warranties.
 +
 
 +
To sum it up, It's much better to have a 5% AFR(Annual Failure Rate)disks in a raid6/raidz2 array than it is to have a 0.1% AFR drive raid5/raidz1 array. If you can get the former cheaper, do it. Just remember, 3-2-1 backups and you'll never lose your data.
 +
 
 +
Check out these links for cheap drives - https://shucks.top/ & https://diskprices.com
 +
Also check out [https://www.backblaze.com/b2/hard-drive-test-data.html/ Backblazes drive failure data] so you can compare some similar prices disks, spending a few $ more on a low AFR disk doesn't hurt, but don't go overboard. Careful how you interpret their results.
 +
 
 +
===Racks and Cases===
 +
[[File:Anons_comfy_rack.png|350px|thumb|right|Peak /comfy/]]
 +
* [[Home server/Case guide|Home server case guide]]
 +
* [https://wiki.eth0.nl/index.php/LackRack Lack rack] - Meme-y but practical and cheap solution for rack-mount equipment. Be wary of putting too much weight on them though
 +
 
 +
==Networking==
 +
Please share your networking setups and provide advice for other anons.
 +
 
 +
DNS: [[Setting_up_a_Server/DNS]]
 +
 
 +
Routing guide (WIP): [[Home_server/Routing_for_retards]]
 +
 
 +
===Routers===
 +
For routers you have a few options
 +
====ISP Provided====
 +
lol, get fucked (depending on how locked down it is)
 +
====Consumer====
 +
e.g. Netgear, ZyTel, linksys, Asus)
 +
 
 +
Can get you quite far with OpenWRT.
 +
====Prosumer====
 +
e.g. Ubiquity, EnGenius, MikroTik
 +
 
 +
Unless you're running a home data centre, these should handle whatever you throw at them.
 +
====Enterprise====
 +
e.g. Cisco/Cisco Meraki, Aruba, Dell, HP
 +
====Custom====
 +
Custom hardware of your choosing with PfSense[https://www.pfsense.org/], OpenSense[https://opnsense.org], open-WRT[https://openwrt.org/], DD-WRT[https://dd-wrt.com/], VyOs[https://vyos.io/], Tomato[https://freshtomato.org/], Linux[https://wiki.archlinux.org/title/router], BSD[https://www.openbsd.org/faq/pf/example1.html] of your choice, etc, as the OS.
 +
 
 +
Go wild, not recommended unless you know your way around networking or are willing to learn it hard way.
 +
 
 +
===Switches===
 +
====Hardware====
 +
{| class="wikitable sortable"
 +
! Name !!  MSRP (USD)  !! 1 gbit Ports (RJ45) !! 1 gbit Ports (SFP) !! 10 gbit Ports (RJ45) !! 10 gbit Ports (SFP+) !! 25 gbit Ports (SFP28) !! 40 gbit Ports (QSFP+) !! 100 gbit Ports (QSFP28) !! Rackmountable !! PoE Out !! Max Power (Watts) !! Notes
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade FCX] ||  $30  || 48 ||  ||  ||  ||  ||  ||
 +
| style="background:lime;" | Yes || Optional || 40 || Approximate eBay price
 +
|-
 +
| [https://mikrotik.com/product/css610_8g_2s_in Mikrotik CSS610-8G-2S+IN] ||  $119  || 8 ||  ||  || 2 ||  ||  ||  || No || No || 11 ||
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade ICX7150-C12P] ||  $120  || 12 ||  ||  || 2 ||  ||  ||  || No || No || 12 || Approximate eBay price
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade ICX6450] ||  $120  || 48 ||  ||  || 4 ||  ||  ||
 +
| style="background:lime;" | Yes || Optional || 50 || Approximate eBay price
 +
|-
 +
| [https://mikrotik.com/product/crs305_1g_4s_in Mikrotik CRS305-1G-4S+IN] ||  $149  || 1 ||  ||  || 4 ||  ||  ||  || No || No || 18 ||
 +
|-
 +
| [https://mikrotik.com/product/CRS112-8G-4S-IN Mikrotik CRS112-8G-4S-IN] ||  $153  || 8 || 4 ||  ||  ||  ||  ||  || No || No || 10 ||
 +
|-
 +
| [https://mikrotik.com/product/CSS326-24G-2SplusRM Mikrotik CSS326-24G-2S+RM] ||  $159  || 24 ||  ||  || 2 ||  ||  || 
 +
| style="background:lime;" | Yes || No || 19 ||
 +
|-
 +
| [https://mikrotik.com/product/crs310_1g_5s_4s_in Mikrotik CRS310-1G-5S-4S+IN] ||  $199  || 1 || 5 ||  || 4 ||  ||  ||  || No || No || 20 ||
 +
|-
 +
| [https://mikrotik.com/product/crs326_24g_2s_in Mikrotik CRS326-24G-2S+IN] ||  $199  || 24 ||  ||  || 2 ||  ||  ||  || No || No || 21 || Same as CSS326-24G-2S+RM, but not rackmountable
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade ICX6610] ||  $200  || 24 ||  ||  || 16 ||  || 2 ||
 +
| style="background:lime;" | Yes || Optional || 80 || Approximate eBay price
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade ICX6610] ||  $200  || 48 ||  ||  || 16 ||  || 2 ||
 +
| style="background:lime;" | Yes || Optional || 110 || Approximate eBay price
 +
|-
 +
| [https://mikrotik.com/product/CRS326-24G-2SplusRM Mikrotik CRS326-24G-2S+RM]  ||  $209  || 24 ||  ||  || 2 ||  ||  || 
 +
| style="background:lime;" | Yes || No || 24 ||
 +
|-
 +
| [https://mikrotik.com/product/crs112_8p_4s_in Mikrotik CRS112-8P-4S-IN] || $209 || 8 || 4 || || || || || || No
 +
| style="background:lime;" | Yes || 10 (160)
 +
|-
 +
| [https://mikrotik.com/product/crs309_1g_8s_in Mikrotik CRS309-1G-8S+IN] ||  $269  || 1 ||  ||  || 8 ||  ||  ||  || No  || No || 23 ||
 +
|-
 +
| [https://store.ui.com/us/en/collections/unifi-switching-utility-10-gbps-ethernet/products/unifi-flex-xg Ubiquiti Flex 10 GbE] ||  $299  ||  ||  || 5 ||  ||  ||  ||  || No || No || 25 ||
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade ICX7250] ||  $300  || 48 ||  ||  || 8 ||  ||  ||
 +
| style="background:lime;" | Yes || No || 65 || Approximate eBay price
 +
|-
 +
| [https://mikrotik.com/product/crs328_4c_20s_4s_rm Mikrotik CRS328-4C-20S-4S+RM] || $449 || || 20 || || 4 || || ||
 +
| style="background:lime;" | Yes || No || 43 || Has 4 combo SFP/RJ45 ports
 +
|-
 +
| [https://mikrotik.com/product/crs328_24p_4s_rm Mikrotik CRS328-24P-4S+RM] ||  $489  || 24 ||  ||  || 4 ||  ||  || 
 +
| style="background:lime;" | Yes
 +
| style="background:lime;" | Yes || 44 (494) ||
 +
|-
 +
| [https://mikrotik.com/product/crs317_1g_16s_rm Mikrotik CRS317-1G-16S+RM] || $499 || || || || 16 || || ||
 +
| style="background:lime;" | Yes || No || 44 ||
 +
|-
 +
| [https://mikrotik.com/product/crs354_48g_4splus2qplusrm Mikrotik CRS354-48G-4S+2Q+RM] ||  $599  || 48 ||  ||  || 4 ||  || 2 ||
 +
| style="background:lime;" | Yes || No || 60 ||
 +
|-
 +
| [https://mikrotik.com/product/crs326_24s_2q_rm Mikrotik CRS326-24S+2Q+RM]  ||  $599  ||  ||  ||  || 24 ||  || 2 || 
 +
| style="background:lime;" | Yes || No || 69 ||
 +
|-
 +
| [https://forums.servethehome.com/index.php?threads/brocade-icx-series-cheap-powerful-10gbe-40gbe-switching.21107/ Brocade ICX6650] ||  $600  ||    ||  ||  || 64 ||  || 40 ||
 +
| style="background:lime;" | Yes || No || 120 || Approximate eBay price
 +
|-
 +
| [https://mikrotik.com/product/crs504_4xq_in Mikrotik CRS504-4XQ-IN] || $799 || ||  ||  || ||  ||  || 4 || No || No || 41 ||
 +
|-
 +
| [https://mikrotik.com/product/crs354_48p_4s_2q_rm Mikrotik CRS354-48P-4S+2Q+RM] ||  $999  || 48 ||  ||  || 4 ||  || 2 ||
 +
| style="background:lime;" | Yes
 +
| style="background:lime;" | Yes || 85 (800) ||
 +
|-
 +
| [https://mikrotik.com/product/crs510_8xs_2xq_in Mikrotik CRS510-8XS-2XQ-IN] || $999 || || || || || 8 || || 2 || No || No || 45 ||
 +
|-
 +
| [https://store.ui.com/us/en/collections/unifi-switching-enterprise-10-gbps-ethernet/products/usw-enterprisexg-24 Ubiquiti Enterprise XG 24] ||  $1,299  ||  ||  || 24 ||  || 2 ||  ||
 +
| style="background:lime;" | Yes || No || 100 ||
 +
|-
 +
| [https://mikrotik.com/product/crs518_16xs_2xq Mikrotik CRS518-16XS-2XQ-RM] || $1,595 || || || || || 16 || || 2
 +
| style="background:lime;" | Yes || No || 95 ||
 +
|}
 +
 
 +
====Software====
 +
 
 +
OpenSource Software: Cumulous, Stratum, ONL
 +
 
 +
===Access Points===
 +
{{stub}}
 +
 
 +
===NICS===
 +
{{stub}}
 +
 
 +
==Software==
 +
 
 +
===Operating systems===
 +
There are many options for which OS to use for your server, Ultimately it depends on your needs and budget.
 +
 
 +
* Debian GNU/Linux supports software RAID and file systems like OpenZFS, and runs on pretty much anything.
 +
* OMV is good enough if all you are storing is rarely accessed media and is GUI based if you prefer that over a command line.
 +
* TrueNAS CORE (formerly FreeNAS) is BSD based and fairly simple to install and use but server grade hardware and ECC RAM is recommended.
 +
* Proxmox and VMware ESXi if you want your server to be primarily about virtualization.  If this is your only server, this may increase the difficulty in creating ZFS or raid pools.  Not impossible, just more tricky.
 +
 
 +
See [[Home server/Choosing an Operating System]] for more information.
 +
 
 +
====Linux====
 +
These are all server-specific or at least minimal operating systems without a desktop environment or other bloat preinstalled.
 +
 
 +
* [[Debian]] Stable is one of the best operating systems to use for a server. It is not too hard to manage, but at the same time customizable enough for your server's purposes. Has plenty of documentation.
 +
* [[Ubuntu]] Server is based on Debian Testing. Slighty less stable than Debian, but has far less outdated software in its repos. Recent LTS releases have focused on providing heavy integration with Openstack. Does retarded things with packages and versions (lib*-ubuntu1.l2). Arguably the best option for users new and old.
 +
* {{strike|[[CentOS]] is basically a free community supported version of RHEL. Very stable, and very popular thanks to its links to Red Hat.}} CentOS is kil. RIP
 +
* Alpine Linux is an extremely lightweight hardened distro using musl and busybox instead of glibc and coreutils. Uses OpenRC instead of systemd. Commonly used as base for docker images thanks to its small size, but works well on bare metal too. Recommended, especially for more experienced users.
 +
* [[Gentoo]] is usually too much trouble to be worth it, but it works and sees occasional server usage.
 +
* [[Arch]] and other rolling release distros are not good choices as they are generally unstable and often break/change behavior on updates.
 +
 
 +
====[https://yunohost.org/ YunoHost]====
 +
Debian-based. Pre-configured with a web interface (accessible through its local gateway) and an app catalog for server software. A great choice for beginners.
 +
 
 +
If you're lost, just go with YunoHost or Ubuntu. Use mdadm, ZFS on Linux (ZoL) or Snapraid for data redundancy.
 +
 
 +
====[https://www.openmediavault.org/ Open Media Vault]====
 +
Good for storing infrequently changed files like media files.
 +
 
 +
Like FreeNAS/TrueNAS, OMV is primarily a GUI tool, but it is Debian based and a command line is always a ssh away.  All configuring of typical NAS thing is available to you in a GUI (samba/NFS/shares/user management/etc). OMV does not force ZFS on you however, like TrueNAS does.  OMV is ideal if you want a GUI on a SBC or less powerful hardware.
 +
 
 +
Supports Snapraid as a plugin. Can be used with mergerFS to pool drives together.
 +
 
 +
* [https://forum.openmediavault.org/ OMV Forums]
 +
* [https://omv-extras.org/ OMV Extras] - Needed for mergerFS
 +
* [https://forum.openmediavault.org/index.php?thread/23005-installation-and-setup-videos-beginning-intermediate-and-advanced/ Installation guide]
 +
 
 +
====[https://unraid.net/ unRAID]====
 +
Comes with it's own RAID solution that technically isn't real RAID because all parity is stored on one or two disks. Not free, you need to fork over some money to buy it.
 +
 
 +
Supports differently sized physical disks and adding hard drives to expand as needed.
 +
 
 +
* [https://wiki.unraid.net/Official_Documentation unRAID Documentation]
 +
 
 +
Unraid 6.8.3-6.9.2
 +
 
 +
SHA256: 18F75CA34A39632DC07270510E453243753CFF302F3D5ADD4FA8813D4ADB304D
 +
 
 +
magnet:?xt=urn:btih:180782e4ff3e00b7efc8a0529239b896e0557f72&dn=unraid692.7z
 +
 
 +
====[[BSD]]====
 +
* [[FreeBSD]] is the most popular
 +
* [[OpenBSD]] has a bigger focus on security
 +
* NetBSD is another option
 +
 
 +
All are highly regarded by their users.
 +
 
 +
=====[https://www.truenas.com/download-truenas-core/ TrueNAS CORE]=====
 +
TrueNAS CORE is the [[Free|free]] version of the premium TrueNAS and successor/replacement for FreeNAS. TNC is a FreeBSD based OS that utilizes ZFS for storage and has many available plugins for things like PLEX, bitorrent, and more.
 +
Has simple, easy to use GUIs to set up your services such as samba shares, etc.
 +
 
 +
Keep in mind it will install to the ENTIRE DRIVE and you won't be able to use the install drive for anything else. A small, cheap, M.2 SSD is a good option for the OS drive. Server grade hardware and ECC RAM is recommended.
 +
 
 +
* [https://www.truenas.com/docs/hub/ TrueNAS Documentation]
 +
* [https://www.ixsystems.com/community/ TrueNAS Forums]
 +
 
 +
====Hypervisor====
 +
{{Note|Your CPU must support Virtualization in order to run hypervisors. (VT-x on Intel, AMD-V for AMD). Directed I/O support is also required if you wish to pass devices to VMs (VT-d on Intel, AMD-Vi for AMD)}}
 +
 
 +
You may want to consider using an OS designed for virtualization/containerization. Virtualization allows you to run multiple independent operating systems on the same hardware simultaneously. You can use this for home lab, or game servers, or even virtualize your desktop instead of using a big tower.
 +
 
 +
Containers add the ability to isolate processes to make a more stable server, and also allow you to migrate services from one server to another on the fly.
 +
 
 +
=====[https://xcp-ng.org/ XCP-ng]=====
 +
A Linux Foundation Project dating back to 2003. User-friendly, high-performance virtualization solution, developed collaboratively for unrestricted features and open-source accessibility. Make sure to compile Xen Orchestra.
 +
 
 +
=====[https://www.proxmox.com/en Proxmox]=====
 +
A GNU/Linux based Virtualization Environment that has built in ZFS support. Utilizes KVM, QEMU for virtual machines and LXC for containers.
 +
 
 +
Also Supports Ceph and GlusterFS for distributed storage and clustering.
 +
 
 +
Good alternative to VMware, but is lacking in some areas. Good enough for most people's needs.
 +
 
 +
ECC RAM is recommended as per usual with ZFS.
 +
 
 +
* [[Proxmox-Exposed-Host]]
 +
* [https://pve.proxmox.com/wiki/Main_Page Official Wiki]
 +
* [https://forum.proxmox.com/ Proxmox Forums]
 +
 
 +
=====[https://www.vmware.com/uk/products/esxi-and-esx.html VMware ESXi]=====
 +
If you've ever worked in a datacenter on managed IT for big business you will be familiar with VMware ESXi, it's the most popular, feature rich hypervisor available. Unfortunately, it is not free, and only has a limited free tier with 8 core per VM limit. No vSphere, or most vStorage options like vMotion and distributed switching. For most people this is okay, but if you are a home-server enthusiast you might want to play around with all the features they have available. It's an excellent option unless you don't like to use proprietary software or don't want to go through the trouble cracking to get all of the features on the latest version.
 +
 
 +
If you use version 6.5 or 6.7 you can use this key to unlock all these features.
 +
 
 +
*'''vCenter: 0A0FF-403EN-RZ848-ZH3QH-2A73P '''
 +
 
 +
*'''vSphere: JV425-4h100-vzhh8-q23np-3a9pp '''
 +
 
 +
VMware 7.0 has dropped support form westmere-EP/gulftown (x5xxx) CPU's. If your system has these old CPU's you should consider upgrading to something later than Sandybridge if you want to use the latest version of ESXi.
 +
 
 +
=====[https://wiki.smartos.org/ SmartOS]=====
 +
SmartOS is not Linux, nor is it Solaris (but it is Illumos underneath). It's a type 1 hypervisor platform that is/was the core of Joyent's public cloud platform (has since been sold off to MNX who are claiming continued support for opensource involvement).
 +
 
 +
Similar to TrueNAS, ZFS is not an opt in feature, and unlike most operating systems it does not require a installation disk, the system is entirely ephemeral running from a USB stick which can be pulled out at anytime. All of your VMs and other persistent data is kept on whatever zpool you name "zones", you are free to add and remove other pools and have all of the ZFS features available in the gz ("global zone") which is the base environment you are given to manage the system. What you can't do in the gz is install most packages, setup additional users, make any persistent changes to config files or run services.
 +
 
 +
Instead everything you do happens under zones, these are very similar the BSD jails or docker containers, the main difference is they are a first class kernel feature and have exceptional security and efficiency properties. As they are running bare metal with sandboxed zfs datasets it's possible to host samba and NFS shares of the same filesystem the VMs are stored on, in fact there's no reason you couldn't run multiple samba zones with access to separate areas of storage, this means even with a rootkit installed on one of your samba servers the other would remain completely isolated.
 +
 
 +
If you don't care for zones you can also setup full on HVM instances using either KVM or Bhyve, the later being far more performant and able to run the most recent Windows versions. VNC video consoles and serial ports are automatically setup whenever you boot a VM for remote management.
 +
 
 +
The gz comes with 3 cli tools for doing day to day tasks: vmadm, imgadm and zlogin. Running man followed by one of these commands will get you some very decent documentation, so l3rn to read.
 +
 
 +
Suggested reading:
 +
* [https://www.youtube.com/watch?v=coFIEH3vXPw Bryan Cantrill sperging out about containers]
 +
* [https://docs.oracle.com/cd/E36784_01/html/E37628/z.admin.task-12.html How to delegate datasets for use as a file server] and [https://blog.daveeddy.com/2015/05/05/sonos-and-smartos-samba-server/ Creating said file server zone]
 +
* [https://wiki.smartos.org/mailing-lists-and-irc/ Contact information] everyone on IRC is very helpful so don't be a cunt
 +
 
 +
====SBC Operating Systems====
 +
 
 +
If you are using an SBC or NUC for your server, these are potential options to use over standard (GNU/)Linux distros.
 +
 
 +
=====[https://dietpi.com/ DietPi]=====
 +
Extremely lightweight, extremely optimized version of Debian, and best of all, extremely easy. Can be installed on any SBC. Comes with a [https://dietpi.com/docs/software/ software centre] with automatic configuration and optimization for your hardware, maximizing performance. CLI-based, but very retard-friendly and includes some nice menu systems.
 +
 
 +
=====[https://www.freedombox.org/download/ FreedomBox]=====
 +
Runs on virtually any SBC.
 +
 
 +
Setup is incredibly simple. Installing new software and services can be done with the click of a button.
 +
 
 +
Lets you easily share files, host websites, sync files, and more. The number of available applications are a bit limited however.
 +
 
 +
=====[https://yunohost.org/ YunoHost]=====
 +
Debian-based. Like FreedomBox, incredibly simple.
 +
 
 +
===Containers===
 +
''Containers'' are a method of isolating running software from both the host OS and other software. You may also hear them called Jails  or Chroot Jails if you are running some variant of BSD (such as TrueNAS CORE/FreeNAS).
 +
 
 +
There are a number of reasons why you would want this:
 +
* Less overhead than standard virtual machines because you aren't virtualizing the kernel.
 +
* Isolated software cannot interfere with each other or the host. If a container crashes it won't effect anything else.
 +
* Like VMs, containers are portable. You can create a container, configure it however you want, and deploy it anywhere.
 +
* Like VMs, removing containers and starting from scratch or a backup in the event of a fatal crash is easy.
 +
* Docker and Podman containers are incredibly easy to deploy and you can find pre-configured container images online.
 +
 +
Best practice is to keep the base OS as clean as possible and install each individual application (such as PLEX, Samba, etc) in their own container. This makes your server much more stable since there is virtually no chance of a containerized application crashing your server, or an installation gone wrong from ruining your host OS.
 +
 
 +
* [https://docs.linuxserver.io/ Pre-configured container images].
 +
 
 +
====[https://linuxcontainers.org/lxc/introduction/ LXC] and [https://linuxcontainers.org/lxd/introduction/ LXD]====
 +
LXC is the standard Linux containers. Available on most distros. You will likely be using these if you are running a Proxmox server.
 +
Since Linux containers are essentially just semi-separate instances of Linux, you can't run Windows programs in them without using WINE.
 +
 
 +
LXD is a newer, more user friendly version of LXC. Has better management options for containers.
 +
 
 +
====[https://www.docker.com/ Docker]====
 +
Instead of running as though it was an entire OS like LXC, Docker only virtualizes a single application.
 +
Can run on Windows as well as Linux. You will still need WINE to run Windows program on Linux.
 +
Docker is free software.
 +
Docker 'desktop' is proprietary software, which is available free of charge for "personal" usage, but requires licensing for many features and commercial usage.
 +
 
 +
====[https://podman.io/ Podman]====
 +
An alternative to Docker. Those using Docker can easily switch without issues.
 +
Unlike Docker, it does not use a single large server daemon. Uses "pods" which can contain more than one container.
 +
 
 +
====Jails====
 +
Jails are BSD's version of containers. Since TrueNAS CORE/FreeNAS is FreeBSD based you will be using these instead of LXC/LXD.
 +
 
 +
* [https://www.truenas.com/docs/hub/tasks/advanced/jails/ TrueNas Jail documentation]
 +
* [https://www.ixsystems.com/documentation/freenas/11.3-U5/jails.html#additional-storage Give Jails access to host storage] - Jail version of Bind mounting
 +
* [https://www.freebsd.org/doc/handbook/jails-build.html FreeBSD Jail documentation]
 +
 
 +
===Server software===
 +
For a greater range of self hosting solutions and services see [https://github.com/awesome-selfhosted/awesome-selfhosted awesome self hosted software].
 +
 
 +
* [[Home server/Remote access|Remote access]]
 +
 
 +
===System administration software===
 +
For a greater range of sysadmin solutions and services see [https://github.com/n1trux/awesome-sysadmin awesome sysadmin software].
 +
 
 +
===Media Streamers===
 +
The most common applications in the Media Server landscape is Plex, Jellyfin, Kodi and Emby.
 +
 
 +
If you want a feature comparison between these to find out which is right for you, check out [https://github.com/Protektor-Desura/Archon/wiki/Compare-Media-Servers THIS] handy table
 +
 
 +
Want to transcode multiple streams simultaneously? Check out [https://www.elpamsoft.com/?p=Plex-Hardware-Transcoding these hardware requirements]
 +
 
 +
Have an Intel iGPU and want to offload transcoding? Check out [https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Hardware_decoding_and_encoding this resource]
 +
 
 +
==File Systems and RAID==
 +
{{Warning| RAID is '''NOT''' a backup. Not even RAID 1. RAID doesn't protect against accidental file deletion or total failure of an array. See the [[Backups]] Page for more on backups}}
 +
 
 +
You may want to consider a [[Wikipedia:RAID|RAID]] array for long-term file storage. A proper RAID array can protect you against sudden drive failures, and some software RAID have more features to combat data degradation.
 +
 
 +
When deciding on what RAID level to use, try to aim for at least two disk redundancy for arrays larger than 4 disks. Rebuilding a RAID array is an intensive process and it's not uncommon for a second disk to fail during the process. RAID 5 and equivalents only offer 1 disk redundancy, so if another disk fails during your rebuild you're fucked and any data not backed up is lost.
 +
 
 +
For more information and guides on how to setup your storage see [[Home Server/Setting up your Storage]]
 +
 
 +
===Software RAID vs Hardware RAID===
 +
Software RAID typically has a number of features that are more beneficial than just standard RAID. Best in class at this moment is ZFS, which has automatic file self healing and file system level checksums to combat [[Wikipedia:Data degradation|bitrot]].
 +
 
 +
Btrfs is also good if you want an alternative to ZFS, but is still in development so be careful.
 +
 
 +
UnRAID is more noob friendly (but you pay for it).
 +
 
 +
Snapraid + merger FS is a viable (free) alternative to UnRAID if you don't feel like spending money on your OS.
 +
 
 +
===[https://zfsonlinux.org/ ZFS]===
 +
A long standing, reliable file system and software RAID solution that works on *BSD and Linux.
 +
 
 +
Supports up to 3 disk redundancy (RAIDZ3) along with your regular equivalent traditional RAID levels of 0,1,5,6,10 albeit with [https://archive.fo/Bfbvh different names], and has checksums and scheduled scrubbing to prevent data corruption. Remember and configure this if not enabled already.
 +
 +
Has some limitations, one major one being expansion is cumbersome so consider planning out your pool well in advance, if you are slowly adding 1 drive with various capacities over the years, go with BTRFS.
 +
 
 +
If you plan on using RAIDZ make sure you know what your array is going to be beforehand, you won't be able to add to it later.(for now, raid expansion is in the works)
 +
 
 +
ZFS Recommends 8GB of memory as a minimum(can be as low as 2GB but you should consider BTRFS if you have this amount of ram), however, if you want better performance you should add as much as you can. Your memory serves as a cache > the bigger the cache > the more cached data you can store > the better the performance. 1GB per formatted TB is a good middle-ground before you start to see diminishing returns. Also to note, ECC memory is recommended for obvious reasons, and normally isn't much of a premium over regular RAM. it's not mandatory but use it at your own risk. [https://archive.ph/jGbAd see this paper for more information about why you should run ECC]
 +
 
 +
===[[Wikipedia:Mdadm|mdadm]]===
 +
A tool for creating and managing Linux software RAID arrays.
 +
 
 +
You can create file systems directly on the RAID arrays, and then use mergerFS to pool the file systems together.
 +
 
 +
''Technically'' supports disks of different sizes, but it requires multiple partitions on the drives and is not recommended.
 +
 
 +
No built in checksums, Can use dm-integrity to detect errors, but has no way of dealing with them.
 +
 
 +
* [https://raid.wiki.kernel.org/index.php/RAID_setup mdadm Documentation]
 +
* [https://www.digitalocean.com/community/tutorial_series/how-to-configure-raid-arrays-on-ubuntu-16-04 Guide for configuring RAID arrays with mdadm].
 +
 
 +
===[https://wiki.archlinux.org/index.php/LVM LVM]===
 +
Required learning for management of drives on Proxmox. 
 +
 
 +
A bit more confusing than partitioning drives normally but is very flexible. Allows for thin provisioning of storage, and pooling of multiple drives or mdadm arrays into logical volumes
 +
 
 +
* [https://wiki.gentoo.org/wiki/LVM#Thin_provisioning More on thin provisioning]
 +
* [https://wiki.archlinux.org/index.php/LVM_on_software_RAID LVM on mdadm]
 +
 
 +
===[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-xfs XFS]===
 +
Another reliable file system. Unlike ZFS it doesn't have built in software RAID features.
 +
 
 +
===[https://ext4.wiki.kernel.org/index.php/Ext4_Howto ext4]===
 +
Default file system for most Linux distros. Does everything a good file system should do and more.
 +
 
 +
===[https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs]===
 +
It's "B-Tree", not "Butter".
 +
 
 +
Has many of the same features as ZFS, including checksums and self healing.
 +
 
 +
STILL UNDER DEVELOPMENT USE AT OWN RISK. Potential for data loss.
 +
 
 +
RAID 1 features are stable on the most recent Linux versions.
 +
 
 +
* [https://wiki.archlinux.org/index.php/btrfs How to Btrfs]
 +
 
 +
===[https://github.com/trapexit/mergerfs mergerFS]===
 +
A Union file system that pools multiple file systems together under one mount point, allowing them to appear as one.
 +
 
 +
Has some advantages over LVM, you can use multiple disks with data already on them instead of having to create LVM volumes/groups. If a disk fails, since the data is not striped across multiple disks (like with LVM), data loss can be less drastic.
 +
 
 +
Works with multiple different file systems at the same time, including Windows's NTFS. Use with Snapraid or mdadm for disk redundancy.
 +
 
 +
Available as a plugin for OMV.
 +
 
 +
*[https://github.com/trapexit/mergerfs Official Github]
 +
*[https://www.teknophiles.com/2018/02/19/disk-pooling-in-linux-with-mergerfs/ How to Guide]
 +
 
 +
===[https://www.snapraid.it/ Snapraid]===
 +
Has an impressive list of features including up to 6 disk redundancy and the ability to add hard drives to expand as needed.
 +
 
 +
Supports differently sized disks, allowing for more flexibility with expansion (your data disks must be equal to or smaller than your parity disks! If you try to add a new data disk that is larger than your parity drives you will run into issues).
 +
 
 +
Technically not "real" RAID and has some limitations. Read the manual.
 +
 
 +
Can be used with mergerFS to pool drives together while retaining a level of redundancy.
 +
 
 +
Available as a plugin for OMV.
 +
 
 +
*[https://selfhostedhome.com/combining-different-sized-drives-with-mergerfs-and-snapraid/ Pool drives with mergerfs]
 +
*[https://sourceforge.net/p/snapraid/discussion/1677233/ Snapraid Forums]
 +
*[https://www.snapraid.it/manual Documentation]
 +
 
 +
==[[Security]]==
 +
Unlike a desktop, a server is always working, accepts connections from the internet (your desktop is normally firewalled and doesn't have any ports open) and is easy to discover (especially if you send mail from it). It's under a bit more risk, and its worth thinking about what intrusions you will try to prevent and how. Refer to [[Security#Threat_analysis]] to understand how and what threats you can mitigate.
 +
 
 +
Basic measures include:
 +
* [https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file Privilege separation]
 +
* If you are behind a router, only forward ports you need
 +
* Your firewall should reject all traffic which isn't either in response to an existing connection, or destined for a forwarded port
 +
* Make sure to keep your [[Routers|router]] firmware updated, as vulnerabilities are often patched in newer versions (at least, from the companies which bother even releasing them). If your device doesn't receive support in the form of firmware updates and security fixes, consider running community-maintained firmware such as OpenWRT
 +
* Regularly update software and kernels when they become available for your distro (it is far better to fix what updates break then get owned)
 +
 
 +
==Miscellaneous==
 +
===/hsg/ OP Pasta===
 +
Find below the standard pasta feel free to edit this with alternatives and new links as time goes on
 +
<div class="mw-collapsible">
 +
'''/hsg/ - Home Server General
 +
<pre>
 +
previous: >>
 +
 
 +
READ THE WIKI! & help by contributing:
 +
https://wiki.installgentoo.com/wiki/Home_server
 +
 
 +
>NAS Case Guide. Feel free to add to it:
 +
https://wiki.installgentoo.com/wiki/Home_server/Case_guide
 +
 
 +
/hsg/ is about learning and expanding your horizons. Know all about NAS? Learn virtualisation. Spun up some VMs? Learn about networking by standing up a OPNsense/PFsense box and configuring some VLANs. There's always more to learn and chances to grow. Think you’re god-tier already? Setup OpenStack and report back.
 +
 
 +
>What software should I run?
 +
Install Gentoo. Or whatever flavour of *nix is best for the job or most comfy for you. Jellyfin/Plex to replace Netflix, Nextcloud to replace Googlel, Ampache/Navidrome to replace Spotify, the list goes on. Look at the awesome self-hosted list and ask.
 +
 
 +
>Why should I have a home server?
 +
/hsg/ is about learning and expanding your horizons. De-botnet your life. Learn something new. Serving applications to yourself, your family, and your frens feels good. Put your tech skills to good use for yourself and those close to you. Store their data with proper availability redundancy and backups and serve it back to them with a /comfy/ easy to use interface.
 +
 
 +
>Links & resources
 +
RouterOS's: https://wiki.installgentoo.com/wiki/Home_server#Custom
 +
https://gitlab.com/awesome-selfhosted/awesome-selfhosted
 +
https://reddit.com/r/datahoarder
 +
https://www.labgopher.com
 +
https://www.reddit.com/r/homelab/wiki/index
 +
https://wiki.debian.org/FreedomBox/Features
 +
List of ARM-based SBCs: https://docs.google.com/spreadsheets/d/1PGaVu0sPBEy5GgLM8N-CvHB2FESdlfBOdQKqLziJLhQ
 +
Low-power x86 systems: https://docs.google.com/spreadsheets/d/1LHvT2fRp7I6Hf18LcSzsNnjp10VI-odvwZpQZKv_NCI
 +
Cheap disks: https://shucks.top/ & https://diskprices.com/
 +
 
 +
Remember:
 +
RAID protects you from DOWNTIME
 +
BACKUPS protect you from DATA LOSS
 +
</pre>
 +
</div>
 +
 
 +
==External Links==
 +
* [https://haydenjames.io/home-lab-beginners-guide-hardware/ Home server hardware] - Hayden James' home lab setup
 +
* [https://forums.servethehome.com/index.php STH Forums] - Good general resource for server questions
 +
* Learn Command line
 +
:# http://mywiki.wooledge.org/BashGuide
 +
:# http://wiki.bash-hackers.org/
 +
:# http://www.grymoire.com/Unix
 +
:# https://perfectmediaserver.com
 +
:# http://overthewire.org/wargames/bandit
 +
* [https://www.servethehome.com/hp-t620-plus-thin-client-and-firewall-vpn-appliance/ HP T620 plus] - Decent cheap computer. You can use it as a VPN, pfSense firewall, and more:
 +
** [https://youtu.be/VCiIsDHIoU8 Overview]
 +
** [https://youtu.be/cRSZ_pDO1SY Buyers guide]
 +
** [https://youtu.be/pV1iPJ6vmhE Upgrade Ram]
 +
*[https://smallstep.com/blog/build-a-tiny-ca-with-raspberry-pi-yubikey/ Tiny Certificate Authority For Your Homelab]
 +
 
 +
==See also==
 +
* [[Backups]]
 +
* [[Build a PC]]
 +
* [[GNU/Linux]]
 +
* [[Security]]
 +
* [[Setting up a Server]]
 +
 
 +
[[Category:GNU/Linux]]
 +
[[Category:Hardware]]
 +
[[Category:Recommendations]]
 +
[[Category:Software]]
 +
[[Category:Tutorials]]

Latest revision as of 19:52, 20 August 2024

This could be you

Home servers are about learning and expanding your horizons. De-botnet your life. Learn something new. Serving applications to yourself, your family, and your frens feels good. Put your /g/ skills to good use for yourself and those close to you. Store their data with proper availability redundancy and backups and serve it back to them with a /comfy/ easy to use interface.

Most people get started with NAS. It’s nice to have a /comfy/ home for all your data. Streaming your movies/shows around the house and to friends. Know all about NAS? Learn virtualization. Spin up some VMs. Learn networking by setting up a pfSense box and configuring some VLANs. There's always more to learn and chances to grow. Think you’re god tier already? Setup openstack and report back to /hsg/.

Things that are online today might not be online forever. It's good to have a copy of something because you never know when it might get taken down due to copyright strikes.


Hardware

What hardware you get depends mostly on your use case. A simple file server can be run on an SBC with a couple hard drives attached. If you want to do more fancy things like virtualization, streaming 4K movies, etc you are going to want better hardware. If you plan on using ZFS or Btrfs, server grade hardware and ECC RAM are recommended but not required.

Server options

There are many roads to the Home Server. Each one has upsides and downsides. It's up to you to decide what works best for your requirements.

Single Board Computers

A cluster of Odroid HC2

For simple home use, such as a file server or single user direct play PLEX server, these options might be an appealing and inexpensive and energy efficient option. Expect performance issues if you try to scale though, and don't expect to be able to run multiple virtual machines or do heavy transcoding, you don't have many options for expansion and little to no options for upgrading either. Forget a hardware RAID card or having any SATA ports at all. You likely won't be able to add much more ram, and definitely won't be able to increase processing power unless you go the clustering route and purchase multiple units. If your use case is compute intensive or would require expansion cards such as a GPU, SBCs are likely not a good option.

If you decide to go with an ARM-based board be aware that some software will be unavailable. This tends to be because the software is proprietary and the developer is uninterested in supporting ARM. Among ARM-based SBCs the Raspberry Pi has by far the best software support as it has the largest userbase.

Connecting hard drives via USB docks may have some performance impact. It is not recommended to use USB HDD docks with multiple disks for a server.

  • Pros
    • Extremely energy efficient, thanks to ARM's architecture.
    • Lowest cost new hardware you will find.
  • Cons
    • Extremely limited expansion.
    • Extremely limited upgrade path.
    • Potentially poor software support.
  • Raspberry Pi
    • Raspberry Pi 5 - much more powerful than the 4b, but also more expensive. Has PCIe (2.0 x1). 4GB model $70, 8GB $95. Add $25 for power supply and case.
    • Raspberry Pi 4b - superceded by above, worth it only if you can pick one up cheap. 4GB model $65, 8GB $90. Add $20 for power supply and case.
  • Odroid / NanoPi / OrangePi (needs updating)

Repurpose Old Hardware

If you have an old gaming PC, workstation, laptop, or spare parts lying around, you might be able to get away with using them as your server (provided they are not too old). Performance and capability will vary wildly from machine to machine. When in doubt post specs in /hsg/ and ask.

Laptops are not really designed for 24/7 use, but their battery does act as a built in UPS to a certain extent.

If you already own the hardware, this option is free, which can be very appealing and a great way to get started or test your setup before buying more ideal hardware. Keep in mind that a lot of old PCs are very power hungry (for example with Intel Core 2 CPUs). In some places this means that your power bill for this machine could be more expensive than the cost of some new cheap SBCs and their power bills combined. You may well be better off selling and putting the money towards newer used hardware. Its strongly suggested you don't even bother with anything older than sandybridge and even that is pushing it. Consider that in many parts of the world you can pick up 6th or 7th gen intel systems for less than $100.

Build Your Own

Example NAS/server part list. i3 9100 is a reasonable budget choice, can handle a few VMs and light transcoding, supports ECC ram and virtualization. Node 804 is a popular case option.
Tip: If you have never built a PC before, read the Build a PC page. If you have questions try asking in /pcbg/

If you have the money, buying new hardware is a viable (but expensive) option. Knowing exactly what you are getting and peace of mind that you can RMA any DOA items, as well as reasonable shipping prices are good reasons to buy new. A combination of new hardware and repurposed older hardware is also an option if you are on a bit of a budget.

Things to look out for when choosing a motherboard are features such as IPMI, Intel NICs (for SR-IOV) and support for ECC RAM. Supermicro/Asrock Rack and Gigabyte have good options for server/workstation boards. "Prosumer" boards are usually incredibly expensive and not worth the money.

If using Intel CPUs check ark.intel.com for information on your CPU. Some features to look for:

  • Intel Quick Sync Video allows for hardware accelerated video encoding. Only on CPUs with integrated graphics.
  • VT-x and VT-d are must haves if you plan on using virtualization of any kind.
  • ECC RAM Support

For AMD, pretty much all CPUs support virtualization extensions. AM5 CPUs all support ECC. For AM4, you may need a "PRO" cpu for ECC support. ECC support is also motherboard dependent. AMD has multiple confusing equivalents to Intel Quicksync depending on CPU, though they lag behind Intel in both speed and quality.

Buy Used Consumer Gear

Ex lease office PCs can be had very cheaply and, depending on your use-case, offer a good low-cost option. Don't go this route if you want to connect more than 2 3.5" hard drives as most systems aren't designed to take any more than that. Don't buy anything pre Skylake for Intel, for AMD don't go any older than Zen 2 (Ryzen 3000).

  • The cheapest options are usually SFF. Expect a base idle power consumption of 10-20w. Should have all the expansion you would expect on an mATX motherboard. Tend to have a single 3.5" hdd bay, a 2.5" bay and slimline optical drive if fitted at all.

USFF tend to be slightly more expensive, the "TinyMiniMicro" tax. Powered from external DC brick, just like a laptop. Some -but not all- have PCIe. ServeTheHome have a wealth of information on these. Mini-towers, about the size of a small desktop, offer little benefit over SFF besides additional space in the case, 2 or 3 3.5" bays but perhaps space for more if you're creative. They often use the same motherboard as their SFF counterparts. Workstations are much more expensive but commonly offer ECC, more powerful CPUs and more RAM slots. They still tend to be limited on the 3.5" bays if you need a lot of storage but, again, theres often space inside for more if you're creative. Usually come with discrete workstation GPUs that you can resell. Significantly higher power consumption than other options in this list, largely down to the higher wattage power supplies. Additionally, there are a few thin clients that are actually powerful/cheap enough to be tempting options. This site has some good info on many of the cheaply available models.

Alternatively, you can buy used DIY parts. For that you want the newest you can afford.

  • If you're concerned about power consumption, don't get an AMD cpu with the IO die, as it alone consumes 10+w even at idle. No AM4 CPUs with integrated graphics have the IO die.
  • AMD PRO (am4) cpus support ECC, but DDR4 UDIMMs are hard to find at a good price.
  • You're unlikely to find anything intel with ECC support at a good price, though its not impossible.

Buy Used Enterprise Gear

Tip: Rule of thumb: don't buy anything over ~7-8 years old for general use and always research the hardware BEFORE making an offer!

Buying Used enterprise hardware can be a cheap, but somewhat unreliable option. Waiting for a good deal might not be for everyone but the rewards are great. Tremendous amounts of storage potential at a relatively cheap price. Some rackmount servers will even come with drives preinstalled.

Be aware though, rackmount servers are usually pretty loud, and many older Xeons can be extremely energy inefficient. Avoid opterons at any cost unless you want a space heater.

  • Some older legacy systems do not support UEFI and thus cannot boot a UEFI OS.
  • Older hardware specs may become performance bottlenecks (Earlier SATA/PCIe/SAS/USB revisions).
  • Some Very old (8-10 years) high end CPUs actually perform worse than modern low-to-mid end CPUs.
  • Lack of support for potentially desired features such as Intel QuickSync, 1Gb/10Gb Ethernet, m.2, etc.
  • Some disk shelf/server backplanes are SAS only and won't accept SATA drives.

Good places to find old server hardware:

Prebuilt NAS

Only buy a prebuilt NAS if you want to spend more and get less.

They are typically woefully underpowered for the price and you’re better served with a $65 Odroid than a $300 QNAP/Synology with a shitty Celeron and 1gb of ram. That said, they are the most noob friendly option with a GUI interface for setup.

Storage

Anon got cucked by the shucking gods

Shucking

It's massively cheaper(sometimes) to buy WD Easystores or WD Elements (when they go on sale) than it is to buy an equivalent size NAS hard drive like WD Red/Iron wolf. Just remember: YOU VOID YOUR WARRANTY(if you live in freedom land, yuropoors retain their warranty as long as you still have the shell and can put it back together). If your drive fails you are most likely fucked. When you buy regular NAS drives you are basically paying more for the warranty.

Some other things to consider if you decide to shuck:

  • Shucked drives under 8TB might be SMR drives.
  • Shucked drives lack the middle mounting hole that most other drives have. You may need an adaptor for your HDD trays if your case doesn’t support them. Some cases might not have adaptors at all, research before buying your case!
  • Some 8 and 10TB drives are air-filled rather than filled with helium. These air-filled drives can run significantly hotter than the helium ones. Check the model number with Crystal Disk Info before shucking, if it has an H it is most likely a helium drive. If you have airflow constraints in your case, it might be better to try and get Helium drives, otherwise it shouldn't be much of an issue.
3.3v pin issue
These pins

Some shucked drives WILL NOT BOOT with most consumer power supplies. This is because of a feature on enterprise drives that lets administrators reboot hard drives by powering the 3.3 volt pin which isn’t used on consumer hard drives. Consumer PSUs, of course, always power this pin, so the hard drive will be stuck in an infinite boot loop and never power on. This can be solved by covering the first three pins on the hard drive with insulating Kapton tape or using a power cable with the 3.3v pins disconnected.

  • DO NOT use liquid electrical tape. This can damage the drive.
  • DO NOT cut the SATA power cable this can damage the drive and your PSU.
  • Molex to SATA adapters DO work but be careful, as some of the poorly made ones can catch fire. I wouldn’t risk it. See this video.

SMR v CMR

SMR stands for "shingled magnetic recording" It's an alternative method to conventional magnetic recording (CMR) that traditional hard drives use. While SMR technology allows for greater data density, they are also slow compared to CMR. These drives are bad for NAS use cases and especially bad for ZFS due to compatibility issues. Just avoid them all together. All Seagate NAS drives are CMR. Easystores/Elements 8tb and above should be safe.

SSD

SSDs are recommended for the OS and programs only, or for use in cache, or L2ARC cache/SLOG in ZFS.

Don't buy SSDs for main storage unless you want to spend tens of thousands. Check out the SSD buying guide for more on SSDs. If you do have a large SSD array, post the details in /hsg/ so we can all drool.

Expanding Your Storage

If you find you have run out of SATA ports on your motherboard but require more storage, there are a number of options for increasing the number of drives your server can support. The best and recommended approach is to use a SAS HBA with SAS to Sata breakout cables. Each SAS port can support up to 4 Sata drives (or even more if you use an expander). You can find used LSI SAS HBAs on eBay for relatively cheap which have ~2 internal ports, or 8 total SATA drives. Avoid SAS1 cards as they are far too old by now and have some limitations. If your case can no longer support more drives, you may want to look into buying an External SAS HBA, which will allow you to connect drives in an external enclosure directly to your server.

Sata HBAs and port multipliers/Expanders are not recommended. They are garbage and not worth buying. SATA port multipliers specifically can cause issues when you try to us any kind of RAID with them.

There are some counterfeit LSI cards on the market, avoid Chinese sellers, sellers with no return policy, etc.

Drive Recommendations

Generally speaking, it's always best to buy the cheapest possible TB/$ drives you can buy while aiming to build redundancy and backups into your storage plan. This may be used drives(if you're willing to roll the dice on having no warranty), this may be shucked drives(If you're okay with shucking and taping pins), this maybe be new general purpose drive(Remember and stay away from SMR drive), and very rarely you might get a good deal on an "enterprise" or "NAS" rated drive for cheap. Enterprise disks have more powerful motors (so they last longer when run 24/7) and typically come with better warranties.

To sum it up, It's much better to have a 5% AFR(Annual Failure Rate)disks in a raid6/raidz2 array than it is to have a 0.1% AFR drive raid5/raidz1 array. If you can get the former cheaper, do it. Just remember, 3-2-1 backups and you'll never lose your data.

Check out these links for cheap drives - https://shucks.top/ & https://diskprices.com Also check out Backblazes drive failure data so you can compare some similar prices disks, spending a few $ more on a low AFR disk doesn't hurt, but don't go overboard. Careful how you interpret their results.

Racks and Cases

Peak /comfy/

Networking

Please share your networking setups and provide advice for other anons.

DNS: Setting_up_a_Server/DNS

Routing guide (WIP): Home_server/Routing_for_retards

Routers

For routers you have a few options

ISP Provided

lol, get fucked (depending on how locked down it is)

Consumer

e.g. Netgear, ZyTel, linksys, Asus)

Can get you quite far with OpenWRT.

Prosumer

e.g. Ubiquity, EnGenius, MikroTik

Unless you're running a home data centre, these should handle whatever you throw at them.

Enterprise

e.g. Cisco/Cisco Meraki, Aruba, Dell, HP

Custom

Custom hardware of your choosing with PfSense[1], OpenSense[2], open-WRT[3], DD-WRT[4], VyOs[5], Tomato[6], Linux[7], BSD[8] of your choice, etc, as the OS.

Go wild, not recommended unless you know your way around networking or are willing to learn it hard way.

Switches

Hardware

Name MSRP (USD) 1 gbit Ports (RJ45) 1 gbit Ports (SFP) 10 gbit Ports (RJ45) 10 gbit Ports (SFP+) 25 gbit Ports (SFP28) 40 gbit Ports (QSFP+) 100 gbit Ports (QSFP28) Rackmountable PoE Out Max Power (Watts) Notes
Brocade FCX $30 48 Yes Optional 40 Approximate eBay price
Mikrotik CSS610-8G-2S+IN $119 8 2 No No 11
Brocade ICX7150-C12P $120 12 2 No No 12 Approximate eBay price
Brocade ICX6450 $120 48 4 Yes Optional 50 Approximate eBay price
Mikrotik CRS305-1G-4S+IN $149 1 4 No No 18
Mikrotik CRS112-8G-4S-IN $153 8 4 No No 10
Mikrotik CSS326-24G-2S+RM $159 24 2 Yes No 19
Mikrotik CRS310-1G-5S-4S+IN $199 1 5 4 No No 20
Mikrotik CRS326-24G-2S+IN $199 24 2 No No 21 Same as CSS326-24G-2S+RM, but not rackmountable
Brocade ICX6610 $200 24 16 2 Yes Optional 80 Approximate eBay price
Brocade ICX6610 $200 48 16 2 Yes Optional 110 Approximate eBay price
Mikrotik CRS326-24G-2S+RM $209 24 2 Yes No 24
Mikrotik CRS112-8P-4S-IN $209 8 4 No Yes 10 (160)
Mikrotik CRS309-1G-8S+IN $269 1 8 No No 23
Ubiquiti Flex 10 GbE $299 5 No No 25
Brocade ICX7250 $300 48 8 Yes No 65 Approximate eBay price
Mikrotik CRS328-4C-20S-4S+RM $449 20 4 Yes No 43 Has 4 combo SFP/RJ45 ports
Mikrotik CRS328-24P-4S+RM $489 24 4 Yes Yes 44 (494)
Mikrotik CRS317-1G-16S+RM $499 16 Yes No 44
Mikrotik CRS354-48G-4S+2Q+RM $599 48 4 2 Yes No 60
Mikrotik CRS326-24S+2Q+RM $599 24 2 Yes No 69
Brocade ICX6650 $600 64 40 Yes No 120 Approximate eBay price
Mikrotik CRS504-4XQ-IN $799 4 No No 41
Mikrotik CRS354-48P-4S+2Q+RM $999 48 4 2 Yes Yes 85 (800)
Mikrotik CRS510-8XS-2XQ-IN $999 8 2 No No 45
Ubiquiti Enterprise XG 24 $1,299 24 2 Yes No 100
Mikrotik CRS518-16XS-2XQ-RM $1,595 16 2 Yes No 95

Software

OpenSource Software: Cumulous, Stratum, ONL

Access Points

NICS

Software

Operating systems

There are many options for which OS to use for your server, Ultimately it depends on your needs and budget.

  • Debian GNU/Linux supports software RAID and file systems like OpenZFS, and runs on pretty much anything.
  • OMV is good enough if all you are storing is rarely accessed media and is GUI based if you prefer that over a command line.
  • TrueNAS CORE (formerly FreeNAS) is BSD based and fairly simple to install and use but server grade hardware and ECC RAM is recommended.
  • Proxmox and VMware ESXi if you want your server to be primarily about virtualization. If this is your only server, this may increase the difficulty in creating ZFS or raid pools. Not impossible, just more tricky.

See Home server/Choosing an Operating System for more information.

Linux

These are all server-specific or at least minimal operating systems without a desktop environment or other bloat preinstalled.

  • Debian Stable is one of the best operating systems to use for a server. It is not too hard to manage, but at the same time customizable enough for your server's purposes. Has plenty of documentation.
  • Ubuntu Server is based on Debian Testing. Slighty less stable than Debian, but has far less outdated software in its repos. Recent LTS releases have focused on providing heavy integration with Openstack. Does retarded things with packages and versions (lib*-ubuntu1.l2). Arguably the best option for users new and old.
  • Template:Strike CentOS is kil. RIP
  • Alpine Linux is an extremely lightweight hardened distro using musl and busybox instead of glibc and coreutils. Uses OpenRC instead of systemd. Commonly used as base for docker images thanks to its small size, but works well on bare metal too. Recommended, especially for more experienced users.
  • Gentoo is usually too much trouble to be worth it, but it works and sees occasional server usage.
  • Arch and other rolling release distros are not good choices as they are generally unstable and often break/change behavior on updates.

YunoHost

Debian-based. Pre-configured with a web interface (accessible through its local gateway) and an app catalog for server software. A great choice for beginners.

If you're lost, just go with YunoHost or Ubuntu. Use mdadm, ZFS on Linux (ZoL) or Snapraid for data redundancy.

Open Media Vault

Good for storing infrequently changed files like media files.

Like FreeNAS/TrueNAS, OMV is primarily a GUI tool, but it is Debian based and a command line is always a ssh away. All configuring of typical NAS thing is available to you in a GUI (samba/NFS/shares/user management/etc). OMV does not force ZFS on you however, like TrueNAS does. OMV is ideal if you want a GUI on a SBC or less powerful hardware.

Supports Snapraid as a plugin. Can be used with mergerFS to pool drives together.

unRAID

Comes with it's own RAID solution that technically isn't real RAID because all parity is stored on one or two disks. Not free, you need to fork over some money to buy it.

Supports differently sized physical disks and adding hard drives to expand as needed.

Unraid 6.8.3-6.9.2

SHA256: 18F75CA34A39632DC07270510E453243753CFF302F3D5ADD4FA8813D4ADB304D

magnet:?xt=urn:btih:180782e4ff3e00b7efc8a0529239b896e0557f72&dn=unraid692.7z

BSD

  • FreeBSD is the most popular
  • OpenBSD has a bigger focus on security
  • NetBSD is another option

All are highly regarded by their users.

TrueNAS CORE

TrueNAS CORE is the free version of the premium TrueNAS and successor/replacement for FreeNAS. TNC is a FreeBSD based OS that utilizes ZFS for storage and has many available plugins for things like PLEX, bitorrent, and more. Has simple, easy to use GUIs to set up your services such as samba shares, etc.

Keep in mind it will install to the ENTIRE DRIVE and you won't be able to use the install drive for anything else. A small, cheap, M.2 SSD is a good option for the OS drive. Server grade hardware and ECC RAM is recommended.

Hypervisor

Note: Your CPU must support Virtualization in order to run hypervisors. (VT-x on Intel, AMD-V for AMD). Directed I/O support is also required if you wish to pass devices to VMs (VT-d on Intel, AMD-Vi for AMD)

You may want to consider using an OS designed for virtualization/containerization. Virtualization allows you to run multiple independent operating systems on the same hardware simultaneously. You can use this for home lab, or game servers, or even virtualize your desktop instead of using a big tower.

Containers add the ability to isolate processes to make a more stable server, and also allow you to migrate services from one server to another on the fly.

XCP-ng

A Linux Foundation Project dating back to 2003. User-friendly, high-performance virtualization solution, developed collaboratively for unrestricted features and open-source accessibility. Make sure to compile Xen Orchestra.

Proxmox

A GNU/Linux based Virtualization Environment that has built in ZFS support. Utilizes KVM, QEMU for virtual machines and LXC for containers.

Also Supports Ceph and GlusterFS for distributed storage and clustering.

Good alternative to VMware, but is lacking in some areas. Good enough for most people's needs.

ECC RAM is recommended as per usual with ZFS.

VMware ESXi

If you've ever worked in a datacenter on managed IT for big business you will be familiar with VMware ESXi, it's the most popular, feature rich hypervisor available. Unfortunately, it is not free, and only has a limited free tier with 8 core per VM limit. No vSphere, or most vStorage options like vMotion and distributed switching. For most people this is okay, but if you are a home-server enthusiast you might want to play around with all the features they have available. It's an excellent option unless you don't like to use proprietary software or don't want to go through the trouble cracking to get all of the features on the latest version.

If you use version 6.5 or 6.7 you can use this key to unlock all these features.

  • vCenter: 0A0FF-403EN-RZ848-ZH3QH-2A73P
  • vSphere: JV425-4h100-vzhh8-q23np-3a9pp

VMware 7.0 has dropped support form westmere-EP/gulftown (x5xxx) CPU's. If your system has these old CPU's you should consider upgrading to something later than Sandybridge if you want to use the latest version of ESXi.

SmartOS

SmartOS is not Linux, nor is it Solaris (but it is Illumos underneath). It's a type 1 hypervisor platform that is/was the core of Joyent's public cloud platform (has since been sold off to MNX who are claiming continued support for opensource involvement).

Similar to TrueNAS, ZFS is not an opt in feature, and unlike most operating systems it does not require a installation disk, the system is entirely ephemeral running from a USB stick which can be pulled out at anytime. All of your VMs and other persistent data is kept on whatever zpool you name "zones", you are free to add and remove other pools and have all of the ZFS features available in the gz ("global zone") which is the base environment you are given to manage the system. What you can't do in the gz is install most packages, setup additional users, make any persistent changes to config files or run services.

Instead everything you do happens under zones, these are very similar the BSD jails or docker containers, the main difference is they are a first class kernel feature and have exceptional security and efficiency properties. As they are running bare metal with sandboxed zfs datasets it's possible to host samba and NFS shares of the same filesystem the VMs are stored on, in fact there's no reason you couldn't run multiple samba zones with access to separate areas of storage, this means even with a rootkit installed on one of your samba servers the other would remain completely isolated.

If you don't care for zones you can also setup full on HVM instances using either KVM or Bhyve, the later being far more performant and able to run the most recent Windows versions. VNC video consoles and serial ports are automatically setup whenever you boot a VM for remote management.

The gz comes with 3 cli tools for doing day to day tasks: vmadm, imgadm and zlogin. Running man followed by one of these commands will get you some very decent documentation, so l3rn to read.

Suggested reading:

SBC Operating Systems

If you are using an SBC or NUC for your server, these are potential options to use over standard (GNU/)Linux distros.

DietPi

Extremely lightweight, extremely optimized version of Debian, and best of all, extremely easy. Can be installed on any SBC. Comes with a software centre with automatic configuration and optimization for your hardware, maximizing performance. CLI-based, but very retard-friendly and includes some nice menu systems.

FreedomBox

Runs on virtually any SBC.

Setup is incredibly simple. Installing new software and services can be done with the click of a button.

Lets you easily share files, host websites, sync files, and more. The number of available applications are a bit limited however.

YunoHost

Debian-based. Like FreedomBox, incredibly simple.

Containers

Containers are a method of isolating running software from both the host OS and other software. You may also hear them called Jails or Chroot Jails if you are running some variant of BSD (such as TrueNAS CORE/FreeNAS).

There are a number of reasons why you would want this:

  • Less overhead than standard virtual machines because you aren't virtualizing the kernel.
  • Isolated software cannot interfere with each other or the host. If a container crashes it won't effect anything else.
  • Like VMs, containers are portable. You can create a container, configure it however you want, and deploy it anywhere.
  • Like VMs, removing containers and starting from scratch or a backup in the event of a fatal crash is easy.
  • Docker and Podman containers are incredibly easy to deploy and you can find pre-configured container images online.

Best practice is to keep the base OS as clean as possible and install each individual application (such as PLEX, Samba, etc) in their own container. This makes your server much more stable since there is virtually no chance of a containerized application crashing your server, or an installation gone wrong from ruining your host OS.

LXC and LXD

LXC is the standard Linux containers. Available on most distros. You will likely be using these if you are running a Proxmox server. Since Linux containers are essentially just semi-separate instances of Linux, you can't run Windows programs in them without using WINE.

LXD is a newer, more user friendly version of LXC. Has better management options for containers.

Docker

Instead of running as though it was an entire OS like LXC, Docker only virtualizes a single application. Can run on Windows as well as Linux. You will still need WINE to run Windows program on Linux. Docker is free software. Docker 'desktop' is proprietary software, which is available free of charge for "personal" usage, but requires licensing for many features and commercial usage.

Podman

An alternative to Docker. Those using Docker can easily switch without issues. Unlike Docker, it does not use a single large server daemon. Uses "pods" which can contain more than one container.

Jails

Jails are BSD's version of containers. Since TrueNAS CORE/FreeNAS is FreeBSD based you will be using these instead of LXC/LXD.

Server software

For a greater range of self hosting solutions and services see awesome self hosted software.

System administration software

For a greater range of sysadmin solutions and services see awesome sysadmin software.

Media Streamers

The most common applications in the Media Server landscape is Plex, Jellyfin, Kodi and Emby.

If you want a feature comparison between these to find out which is right for you, check out THIS handy table

Want to transcode multiple streams simultaneously? Check out these hardware requirements

Have an Intel iGPU and want to offload transcoding? Check out this resource

File Systems and RAID

Warning: RAID is NOT a backup. Not even RAID 1. RAID doesn't protect against accidental file deletion or total failure of an array. See the Backups Page for more on backups

You may want to consider a RAID array for long-term file storage. A proper RAID array can protect you against sudden drive failures, and some software RAID have more features to combat data degradation.

When deciding on what RAID level to use, try to aim for at least two disk redundancy for arrays larger than 4 disks. Rebuilding a RAID array is an intensive process and it's not uncommon for a second disk to fail during the process. RAID 5 and equivalents only offer 1 disk redundancy, so if another disk fails during your rebuild you're fucked and any data not backed up is lost.

For more information and guides on how to setup your storage see Home Server/Setting up your Storage

Software RAID vs Hardware RAID

Software RAID typically has a number of features that are more beneficial than just standard RAID. Best in class at this moment is ZFS, which has automatic file self healing and file system level checksums to combat bitrot.

Btrfs is also good if you want an alternative to ZFS, but is still in development so be careful.

UnRAID is more noob friendly (but you pay for it).

Snapraid + merger FS is a viable (free) alternative to UnRAID if you don't feel like spending money on your OS.

ZFS

A long standing, reliable file system and software RAID solution that works on *BSD and Linux.

Supports up to 3 disk redundancy (RAIDZ3) along with your regular equivalent traditional RAID levels of 0,1,5,6,10 albeit with different names, and has checksums and scheduled scrubbing to prevent data corruption. Remember and configure this if not enabled already.

Has some limitations, one major one being expansion is cumbersome so consider planning out your pool well in advance, if you are slowly adding 1 drive with various capacities over the years, go with BTRFS.

If you plan on using RAIDZ make sure you know what your array is going to be beforehand, you won't be able to add to it later.(for now, raid expansion is in the works)

ZFS Recommends 8GB of memory as a minimum(can be as low as 2GB but you should consider BTRFS if you have this amount of ram), however, if you want better performance you should add as much as you can. Your memory serves as a cache > the bigger the cache > the more cached data you can store > the better the performance. 1GB per formatted TB is a good middle-ground before you start to see diminishing returns. Also to note, ECC memory is recommended for obvious reasons, and normally isn't much of a premium over regular RAM. it's not mandatory but use it at your own risk. see this paper for more information about why you should run ECC

mdadm

A tool for creating and managing Linux software RAID arrays.

You can create file systems directly on the RAID arrays, and then use mergerFS to pool the file systems together.

Technically supports disks of different sizes, but it requires multiple partitions on the drives and is not recommended.

No built in checksums, Can use dm-integrity to detect errors, but has no way of dealing with them.

LVM

Required learning for management of drives on Proxmox.

A bit more confusing than partitioning drives normally but is very flexible. Allows for thin provisioning of storage, and pooling of multiple drives or mdadm arrays into logical volumes

XFS

Another reliable file system. Unlike ZFS it doesn't have built in software RAID features.

ext4

Default file system for most Linux distros. Does everything a good file system should do and more.

Btrfs

It's "B-Tree", not "Butter".

Has many of the same features as ZFS, including checksums and self healing.

STILL UNDER DEVELOPMENT USE AT OWN RISK. Potential for data loss.

RAID 1 features are stable on the most recent Linux versions.

mergerFS

A Union file system that pools multiple file systems together under one mount point, allowing them to appear as one.

Has some advantages over LVM, you can use multiple disks with data already on them instead of having to create LVM volumes/groups. If a disk fails, since the data is not striped across multiple disks (like with LVM), data loss can be less drastic.

Works with multiple different file systems at the same time, including Windows's NTFS. Use with Snapraid or mdadm for disk redundancy.

Available as a plugin for OMV.

Snapraid

Has an impressive list of features including up to 6 disk redundancy and the ability to add hard drives to expand as needed.

Supports differently sized disks, allowing for more flexibility with expansion (your data disks must be equal to or smaller than your parity disks! If you try to add a new data disk that is larger than your parity drives you will run into issues).

Technically not "real" RAID and has some limitations. Read the manual.

Can be used with mergerFS to pool drives together while retaining a level of redundancy.

Available as a plugin for OMV.

Security

Unlike a desktop, a server is always working, accepts connections from the internet (your desktop is normally firewalled and doesn't have any ports open) and is easy to discover (especially if you send mail from it). It's under a bit more risk, and its worth thinking about what intrusions you will try to prevent and how. Refer to Security#Threat_analysis to understand how and what threats you can mitigate.

Basic measures include:

  • Privilege separation
  • If you are behind a router, only forward ports you need
  • Your firewall should reject all traffic which isn't either in response to an existing connection, or destined for a forwarded port
  • Make sure to keep your router firmware updated, as vulnerabilities are often patched in newer versions (at least, from the companies which bother even releasing them). If your device doesn't receive support in the form of firmware updates and security fixes, consider running community-maintained firmware such as OpenWRT
  • Regularly update software and kernels when they become available for your distro (it is far better to fix what updates break then get owned)

Miscellaneous

/hsg/ OP Pasta

Find below the standard pasta feel free to edit this with alternatives and new links as time goes on

/hsg/ - Home Server General

previous: >>

READ THE WIKI! & help by contributing:
https://wiki.installgentoo.com/wiki/Home_server

>NAS Case Guide. Feel free to add to it:
https://wiki.installgentoo.com/wiki/Home_server/Case_guide

/hsg/ is about learning and expanding your horizons. Know all about NAS? Learn virtualisation. Spun up some VMs? Learn about networking by standing up a OPNsense/PFsense box and configuring some VLANs. There's always more to learn and chances to grow. Think you’re god-tier already? Setup OpenStack and report back.

>What software should I run?
Install Gentoo. Or whatever flavour of *nix is best for the job or most comfy for you. Jellyfin/Plex to replace Netflix, Nextcloud to replace Googlel, Ampache/Navidrome to replace Spotify, the list goes on. Look at the awesome self-hosted list and ask.

>Why should I have a home server?
/hsg/ is about learning and expanding your horizons. De-botnet your life. Learn something new. Serving applications to yourself, your family, and your frens feels good. Put your tech skills to good use for yourself and those close to you. Store their data with proper availability redundancy and backups and serve it back to them with a /comfy/ easy to use interface.

>Links & resources
RouterOS's: https://wiki.installgentoo.com/wiki/Home_server#Custom
https://gitlab.com/awesome-selfhosted/awesome-selfhosted
https://reddit.com/r/datahoarder
https://www.labgopher.com
https://www.reddit.com/r/homelab/wiki/index
https://wiki.debian.org/FreedomBox/Features
List of ARM-based SBCs: https://docs.google.com/spreadsheets/d/1PGaVu0sPBEy5GgLM8N-CvHB2FESdlfBOdQKqLziJLhQ
Low-power x86 systems: https://docs.google.com/spreadsheets/d/1LHvT2fRp7I6Hf18LcSzsNnjp10VI-odvwZpQZKv_NCI
Cheap disks: https://shucks.top/ & https://diskprices.com/

Remember:
RAID protects you from DOWNTIME
BACKUPS protect you from DATA LOSS

External Links

  1. http://mywiki.wooledge.org/BashGuide
  2. http://wiki.bash-hackers.org/
  3. http://www.grymoire.com/Unix
  4. https://perfectmediaserver.com
  5. http://overthewire.org/wargames/bandit

See also