hello friends! new(ish)!

Home server: Difference between revisions

From InstallGentoo Wiki v2
Jump to navigation Jump to search
>DataHoarderAnon
mNo edit summary
>4ab41
m (Modified headings and added security)
Line 6: Line 6:
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 or Big Tech censorship.
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 or Big Tech censorship.


==Hardware==
=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.
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===
==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.
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|SBC]] and NUC====
===[[Single board computers|SBC]] and NUC===
[[File:Odroid-cluster.png|350px|thumb|right|A cluster of Odroid HC2]]
[[File:Odroid-cluster.png|350px|thumb|right|A cluster of Odroid HC2]]
For simple home server 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 for your home server. 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 much options for expansion and little to no options for upgrading either. 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 (like a [[GPU]] for example) SBCs are likely not a good option.
For simple home server 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 for your home server. 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 much options for expansion and little to no options for upgrading either. 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 (like a [[GPU]] for example) SBCs are likely not a good option.
Line 30: Line 30:
** Search your NUC [https://ark.intel.com/content/www/us/en/ark.html#@Intel%C2%AENUC here] for more information on it
** Search your NUC [https://ark.intel.com/content/www/us/en/ark.html#@Intel%C2%AENUC here] for more information on it


====Repurpose Old Hardware====
===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).
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.  
Performance and capability will vary wildly from machine to machine. When in doubt post specs in /hsg/ and ask.  
Line 37: Line 37:
Preferably use one with USB3 or better, older laptops might only have USB2 ports which will bottleneck any attached HDDs.
Preferably use one with USB3 or better, older laptops might only have USB2 ports which will bottleneck any attached HDDs.


====Build Your Own====
===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.]]
[[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.]]


Line 58: Line 58:
* ECC RAM Support
* ECC RAM Support


====Buy Used ====
===Buy Used===
{{Tip|Rule of thumb: don't buy anything over ~8-10 years old for general use, and not over ~5-6 years for ZFS/btrfs which both are recommended to have "new" hardware, and Always research the hardware '''BEFORE''' making an offer!}}
{{Tip|Rule of thumb: don't buy anything over ~8-10 years old for general use, and not over ~5-6 years for ZFS/btrfs which both are recommended to have "new" hardware, 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 listings even come with drives preinstalled.
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 listings even come with drives preinstalled.
Line 78: Line 78:
* [https://youtu.be/0UjyL6ZiMkI Quiet SC846 with Noctua mod]
* [https://youtu.be/0UjyL6ZiMkI Quiet SC846 with Noctua mod]


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


Line 85: Line 85:




===[[Storage devices|Storage]]===
==[[Storage devices|Storage]]==
====Shucking====
===Shucking===
It's massively cheaper 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 your drive fails you are most likely fucked. When you buy regular NAS drives you are basically paying more for the warranty.
It's massively cheaper 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 your drive fails you are most likely fucked. When you buy regular NAS drives you are basically paying more for the warranty.
    
    
Line 97: Line 97:
* [https://shucks.top/ Price Tracker for external drives]
* [https://shucks.top/ Price Tracker for external drives]


=====3.3v pin issue=====
====3.3v pin issue====
[[File:Ext-drive-pins.jpg|250px|thumb|left|These pins]]
[[File:Ext-drive-pins.jpg|250px|thumb|left|These pins]]
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.
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.
Line 105: Line 105:
* Molex to SATA adapters DO work but be careful, as some of the poorly made ones can catch fire. I wouldn’t risk it.
* Molex to SATA adapters DO work but be careful, as some of the poorly made ones can catch fire. I wouldn’t risk it.


====SMR v CMR====
===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.
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].
* [https://www.ixsystems.com/community/resources/list-of-known-smr-drives.141/ List of SMR drives].


====SSD====
===SSD===
SSDs are recommended for the OS and programs only, or for use in cache, or ARC cache in ZFS in place of expensive ram.
SSDs are recommended for the OS and programs only, or for use in cache, or ARC cache in ZFS in place of expensive ram.


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


====Expanding Your Storage====
===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.
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.


Line 131: Line 131:




===Racks and Cases===
==Racks and Cases==
[[File:Anons_comfy_rack.png|350px|thumb|right|Peak /comfy/]]
[[File:Anons_comfy_rack.png|350px|thumb|right|Peak /comfy/]]
* [[Home server/Case guide|Home server case guide]]
* [[Home server/Case guide|Home server case guide]]
Line 137: Line 137:




== Operating systems ==
=Operating systems=
There are many options for which OS to use for your server, Ultimately it depends on your needs and budget. Some options like Proxmox require specific hardware which will increase overall cost of your server.
There are many options for which OS to use for your server, Ultimately it depends on your needs and budget. Some options like Proxmox require specific hardware which will increase overall cost of your server.


Line 145: Line 145:




===Linux===
==Linux==
[[Debian]], [[Ubuntu]] or [[CentOS]] are recommended if you want [[GNU/Linux]].
[[Debian]], [[Ubuntu]] or [[CentOS]] are recommended if you want [[GNU/Linux]].


Line 158: Line 158:
Use mdadm, ZFS on Linux (ZoL) or Snapraid for data redundancy.
Use mdadm, ZFS on Linux (ZoL) or Snapraid for data redundancy.


===[https://www.truenas.com/download-truenas-core/ TrueNAS CORE]===
==[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.
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.  
Has simple, easy to use GUIs to set up your services such as samba shares, etc.  
Line 167: Line 167:
* [https://www.ixsystems.com/community/ TrueNAS Forums].
* [https://www.ixsystems.com/community/ TrueNAS Forums].


===[https://www.openmediavault.org/ Open Media Vault]===
==[https://www.openmediavault.org/ Open Media Vault]==
Good for storing infrequently changed files like media files.
Good for storing infrequently changed files like media files.


Line 178: Line 178:
* [https://forum.openmediavault.org/index.php?thread/23005-installation-and-setup-videos-beginning-intermediate-and-advanced/ Installation guide].
* [https://forum.openmediavault.org/index.php?thread/23005-installation-and-setup-videos-beginning-intermediate-and-advanced/ Installation guide].


===[https://www.proxmox.com/en Proxmox]===
==[https://www.proxmox.com/en Proxmox]==
A Linux based Virtualization Environment that has built in ZFS support, Linux container support, and more.
A Linux based Virtualization Environment that has built in ZFS support, Linux container support, and more.


Line 188: Line 188:
* [https://forum.proxmox.com/ Proxmox Forums]
* [https://forum.proxmox.com/ Proxmox Forums]


===[https://xpenology.org/ Xpenology]===
==[https://xpenology.org/ Xpenology]==
A free version of the OS Synology uses for their NAS products. Obviously you won't get any support from Synology if you use this.
A free version of the OS Synology uses for their NAS products. Obviously you won't get any support from Synology if you use this.


Line 195: Line 195:
* [https://xpenology.com/forum/ Xpenology Forums]
* [https://xpenology.com/forum/ Xpenology Forums]


===[https://unraid.net/ unRAID]===
==[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.
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.


Line 203: Line 203:




==File Systems and RAID==
=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}}
{{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}}


Line 211: Line 211:




===Software RAID vs Hardware RAID===
==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]].  
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]].  


Line 220: Line 220:
Snapraid + merger FS is a viable (free) alternative to UnRAID if you don't feel like spending money on your OS.
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]===
==[https://zfsonlinux.org/ ZFS]==
A long standing, reliable file system and software RAID solution that works on BSD and Linux.
A long standing, reliable file system and software RAID solution that works on BSD and Linux.


Line 231: Line 231:
Server hardware and at least 8GB ECC RAM recommended. Using old hardware or consumer hardware is not recommended.
Server hardware and at least 8GB ECC RAM recommended. Using old hardware or consumer hardware is not recommended.


===[[Wikipedia:Mdadm|mdadm]]===
==[[Wikipedia:Mdadm|mdadm]]==
A tool for creating and managing Linux software RAID arrays.
A tool for creating and managing Linux software RAID arrays.


Line 243: Line 243:
* [https://www.digitalocean.com/community/tutorial_series/how-to-configure-raid-arrays-on-ubuntu-16-04 Guide for configuring RAID arrays with mdadm].
* [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]===
==[https://wiki.archlinux.org/index.php/LVM LVM]==
Required learning for management of drives on Proxmox.   
Required learning for management of drives on Proxmox.   


Line 251: Line 251:
* [https://wiki.archlinux.org/index.php/LVM_on_software_RAID LVM on mdadm]
* [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]===
==[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.
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]===
==[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.
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]===
==[https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs]==
It's "B-Tree", not "Butter".
It's "B-Tree", not "Butter".


Line 268: Line 268:
* [https://wiki.archlinux.org/index.php/btrfs How to Btrfs]
* [https://wiki.archlinux.org/index.php/btrfs How to Btrfs]


===[https://github.com/trapexit/mergerfs mergerFS]===
==[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.  
A Union file system that pools multiple file systems together under one mount point, allowing them to appear as one.  


Line 280: Line 280:
*[https://www.teknophiles.com/2018/02/19/disk-pooling-in-linux-with-mergerfs/ How to Guide]
*[https://www.teknophiles.com/2018/02/19/disk-pooling-in-linux-with-mergerfs/ How to Guide]


===[https://www.snapraid.it/ Snapraid]===
==[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.
Has an impressive list of features including up to 6 disk redundancy and the ability to add hard drives to expand as needed.


Line 296: Line 296:




==Containers==
=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).
''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).


Line 311: Line 311:




===[https://linuxcontainers.org/lxc/introduction/ LXC] and [https://linuxcontainers.org/lxd/introduction/ LXD]===
==[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.
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 separate instances of Linux, you can't run Windows programs in them without using WINE.
Since Linux containers are essentially just separate instances of Linux, you can't run Windows programs in them without using WINE.
Line 317: Line 317:
LXD is a newer, more user friendly version of LXC. Has better management options for containers.  
LXD is a newer, more user friendly version of LXC. Has better management options for containers.  


===[https://www.docker.com/ Docker]===
==[https://www.docker.com/ Docker]==
Instead of running as though it was an entire OS like LXC, Docker only virtualizes a single application.
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 apps on Linux.
Can run on Windows as well as Linux. You will still need WINE to run Windows apps on Linux.
Freemium software. Base software is free for individuals (you).
Freemium software. Base software is free for individuals (you).


===[https://podman.io/ Podman]===
==[https://podman.io/ Podman]==
An alternative to Docker. Those using Docker can easily switch without issues.
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.
Unlike Docker, it does not use a single large server daemon. Uses "pods" which can contain more than one container.


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


Line 334: Line 334:




==Server software==
=Server software=
For a greater range of self hosting solutions and services see [https://github.com/awesome-selfhosted/awesome-selfhosted awesome self hosted software].  
For a greater range of self hosting solutions and services see [https://github.com/awesome-selfhosted/awesome-selfhosted awesome self hosted software].  




==System administration software==
=System administration software=
For a greater range of sysadmin solutions and services see [https://github.com/n1trux/awesome-sysadmin awesome sysadmin software].
For a greater range of sysadmin solutions and services see [https://github.com/n1trux/awesome-sysadmin awesome sysadmin software].  




==External Links==
=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.
 
 
 
=External Links=
* [https://haydenjames.io/home-lab-beginners-guide-hardware/ Home server hardware] - Hayden James' home lab setup
* [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
* [https://forums.servethehome.com/index.php STH Forums] - Good general resource for server questions
Line 355: Line 360:
** [https://youtu.be/pV1iPJ6vmhE Upgrade Ram]
** [https://youtu.be/pV1iPJ6vmhE Upgrade Ram]


==See also==
=See also=
* [[Setting up a Server]]
* [[Setting up a Server]]
* [[Backups]]
* [[Backups]]

Revision as of 06:41, 23 December 2020

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 or Big Tech censorship.

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.

SBC and NUC

A cluster of Odroid HC2

For simple home server 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 for your home server. 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 much options for expansion and little to no options for upgrading either. 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 (like a GPU for example) SBCs are likely not a good option.

Connecting hard drives via USB docks may have some performance impact. Use USB 3 where possible and don't attach too many drives to a single port.

  • Intel NUC
    • Search your NUC here for more information on it

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. Preferably use one with USB3 or better, older laptops might only have USB2 ports which will bottleneck any attached HDDs.

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.

If you are looking to build a ZFS/FreeNas server be sure to get a motherboard and CPU that support ECC RAM. Server motherboards are recommended as they have many features such as IPMI, Intel NICs, NIC teaming support, and more.

Supermicro/Asrock Rack are good options. "Prosumer" boards are usually incredibly expensive and not worth the money.

Modern AMD Ryzen CPUs all "unofficially" support ECC RAM, just make sure your motherboard supports it. Pretty much all AMD CPUs also support virtualization.

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 transcoding.
  • VT-x and VT-d are must haves if you plan on using virtualization of any kind.
  • ECC RAM Support

Buy Used

Tip: Rule of thumb: don't buy anything over ~8-10 years old for general use, and not over ~5-6 years for ZFS/btrfs which both are recommended to have "new" hardware, 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 listings even come with drives preinstalled. Be aware though, rack mount hardware is usually pretty loud and older Xeons can be extremely energy inefficient.

Things to look out for when buying used:

  • 32bit systems have a hard limit on Ram. Avoid at all costs.
  • Some older legacy systems do not support UEFI and thus cannot boot UEFI OS's.
  • 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 QSV, 1GB/10GB Ethernet, m.2, etc.
  • Some disk shelf/server backplanes are SAS only and won't accept standard Sata drives.


  • Good places to find old server hardware:
  1. Website which gathers eBay listings for server hardware
  2. Decent place for UK

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

Shucking

It's massively cheaper 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 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

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.

  • 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.

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 ARC cache in ZFS in place of expensive ram.

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.

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.


Racks and Cases

Peak /comfy/


Operating systems

There are many options for which OS to use for your server, Ultimately it depends on your needs and budget. Some options like Proxmox require specific hardware which will increase overall cost of your server.

OMV is good enough if all you are storing is rarely accessed media. Standard Linux like Ubuntu supports software RAID and file systems like OpenZFS, and runs on pretty much anything. TrueNAS CORE (formerly FreeNAS) is BSD based and fairly simple to install and use but server grade hardware and ECC RAM are recommended.


Linux

Debian, Ubuntu or CentOS are recommended if you want GNU/Linux.

  • Debian based distros like Ubuntu are easy to work with and have plenty of documentation.
  • Ubuntu usually does retarded things with their packages and versions (lib*-ubuntu1.l2), and pulls unstable software from Debian Sid.
  • CentOS is a free alternative to RedHat and is also fairly popular.

Rolling release distros (Arch, Fedora) are not recommended for a server. Servers need to continuously work, and shouldn't break/change their behavior when updated.

Gentoo is usually too much trouble to be worth it, but it's ok.

Use mdadm, ZFS on Linux (ZoL) or Snapraid for data redundancy.

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.

Open Media Vault

Good for storing infrequently changed files like media files.

Website doesn't have much to show for. Check the forums for guides.

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

Proxmox

A Linux based Virtualization Environment that has built in ZFS support, Linux container support, and more.

Your CPU must support Virtualization in order to run Proxmox. (VT-x on Intel, AMD-V for AMD).

ECC RAM is recommended as per usual with ZFS.

Xpenology

A free version of the OS Synology uses for their NAS products. Obviously you won't get any support from Synology if you use this.

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

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.


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.


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) and has checksums and self healing to prevent data corruption.

Has some limitations, one major one being expansion is cumbersome.

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.

Server hardware and at least 8GB ECC RAM recommended. Using old hardware or consumer hardware is not recommended.

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 kernels.

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.


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 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 apps on Linux. Freemium software. Base software is free for individuals (you).

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.


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.


External Links

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

See also