I've been running home servers in one form or another for about a decade. For me, the server has shifted from a convenience--a place to store files that I want to access anywhere and an easy way to stream music to the office for free--to a necessity. Today, my home server is a place to back up my family’s computers and the home for all of my media--a few hundred ripped DVDs and Blu-rays plus my family’s music collection and all of the photos and home videos we’ve shot. Like any other server, it also serves as a good place to store the files I need access to all the time, as well as host any services that work better when they’re always running—stuff like dynamic DNS, streaming servers, and game servers.
Use Mac mini as a server The most popular server features—File Server, Time Machine Server, and Caching Server—are a part of macOS, so it’s easy to use your Mac mini as a server. Click the System Preferences icon in the Dock, then click Sharing to access one or more of the options below. Trade in your eligible computer for credit toward a new Mac Pro. Personal setup available. Select a model or customize your own.
My first home server was simply an old gaming PC that I repurposed by installing Linux and setting up a few shared folders and an FTP server so I had access to files at home when I was at the office or travelling. For the last five or six years, I’ve been running a lightweight Windows Home Server v1 machine packed with hard drives. The WHS box had some real advantages—it’s novel filesystem made it so simple to add storage that I eventually ended up with about 8TB of available space. Unfortunately, its ancient Celeron processor was woefully underpowered to stream 1080p video, and the OS has been effectively abandoned by Microsoft.
Photo credit: Flickr user kwl via Creative Commons.
Free version available. Recommended for: encryption and document editing features.
When I decided to build a new server late last year, the first thing I did was figure out what I wanted to use it for. Easy backups for a handful of Macs (and one PC) across the network was a must. I also wanted a machine that would be able to stream all of my media--using Plex Media Server to stream ripped movies and TV shows and Subsonic to stream my music collection. I needed a safe and secure place to store my personal media--photos and home videos I've shot. Finally, I wanted to offload the heavy lifting of DVD and Blu-ray transcoding from my main desktop PC, and the ability to add new stuff to the machine that I haven’t even thought of yet.
When I was deciding what operating system to use for my next home server, I investigated a handful of Linux options, briefly considered Windows Home Server 2011, and finally settled on FreeNAS, which is a customized version of FreeBSD. FreeNAS makes it relatively simple to set up a multi-purpose machine that can run headless—that is, without a video card or monitor connected. After taking FreeNAS for a test drive in a virtual machine, I was sold. As an added benefit, FreeNAS’s native filesystem, ZFS, makes it easy to add multiple hard drives to a single volume, and even supports using a SSD as a smart cache for the volume. And yes, if you want, you can even add redundancy to the system (I don’t recommend it, but we’ll get into that later).
Figuring out the hardware for the FreeNAS machine was tricky. While you can buy dedicated network-attached storage devices that come pre-configured with FreeNAS, none of the options in my price range had the kind of high-powered CPU I was hoping for. After spending the last two years wishing my server was faster, my goal is to make this motherboard and CPU last at least five years, maybe more. Knowing that, the option I was left with was to build a machine and install FreeNAS on it myself.
First, I had to figure out the hardware part.
The main rule with FreeNAS is to load up your machine with as much memory as you can afford.
The good news is that storage, which should be the main expense in a home server, has never been cheaper. For about what I paid for my old Windows Home Server (and a few parts that I’ve upgraded on other machines) I was able to put together a beast of a machine with about 10TB of storage, a hexacore CPU, and a ton of memory. In short, it’s enough to do anything I’ll want to do for at least the next five years, and hopefully more. If you’re interested in building your own server, you can build as big or as modest a machine as you’d like. And yes, my original trick, of turning my old gaming PC into a server still works—although a newer rig will likely be more power efficient than your old gaming machine.
Here’s the hardware I chose. The main rule with FreeNAS is to load up your machine with as much memory as you can afford. The recommended configuration is 1GB of RAM for each terabyte of storage in your ZFS volume; however, that seems less important once you cross 8GB of RAM. Two parts of this rig are probably overkill for most people—I splurged on a 6-core CPU so that I could use this machine as a dedicated DVD and Blu-ray ripping server and I chose a pricey Platinum rated power supply to minimize the amount of energy that’s wasted as heat.
- CPU - Intel i7-5820K Haswell-E Hexacore - $400
- Motherboard - Asus X99-A - $250
Memory - 16GB Crucial DDR4 - $180(Editor's note, after having some conversations with readers, I'd recommend buying ECC SDRAM. This may change the rest of the machine. More to come ASAP)- Hard drives - HGST 4TB NAS Drives - $165 each
- Power Supply - Corsair HS760 - $150
You can choose any case you happen to have, and you'll need at least one USB thumbdrive, possibly two. I didn't use one of these for my build, but I wish I'd bought a smaller thumbdrive than the one I ended up using. FreeNAS recommends running ECC memory because of the way the OS is installed, but I’m regularly backing up the machine, so I didn’t want to spring for much more expensive ECC DDR4 memory.
The only real problem I have with my server is that it's a power hog, especially compared to some of the lower-power CPUs available today. If you want to build something that's more power efficient, I'd get a quad-core Pentium CPU on a motherboard for about $150, run 8GB of RAM, and minimize the number of hard drives. The Pentium uses a fraction of the power that the Haswell-E I chose uses, but it won't be as capable when it comes to live transcoding video in Plex, and it only supports four hard drives.
A Note on Hard Drives
Until recently, there hasn't been good data on reliability of hard drives. Recently, online-backup provider BackBlaze started posting failure rates for the drives the company uses in its storage cloud. After looking at the available choices, I decided to get a specific model of HGST 4TB drive designed for use in servers and NAS boxes. While there are larger drives available now, this model of 4TB drive has been around for long enough to develop reliable data. Equally important, the price per gigabyte for these drives hit the sweet spot for me.
Installing FreeNAS
FreeNAS stores the operating system on a USB thumbdrive and copies the OS from the thumbdrive to RAM at boot time.
Installing FreeNAS is a multi-step process. First, you need to burn the installation ISO onto a USB thumbdrive or a DVD-ROM. Then, you to make sure both the installation medium and the thumbdrive you’re going to install the OS on are plugged into the machine, and that the BIOS is set to boot the machine from the installation media. After the machine boots, you’ll need to answer a couple of prompts, including selecting the proper drive for installation. It’s OK to do the install with your hard drives disconnected if you’re worried about accidentally installing FreeNAS on one of them instead of your thumbdrive.
Wait, what? You’re supposed to install the OS on a USB thumbdrive? Indeed you are. FreeNAS stores the operating system on a USB thumbdrive and copies the OS from the thumbdrive to RAM at boot time. Once it’s booted, it connects to the filesystem on your hard drives. The beautiful thing about this approach is that your FreeNAS install isn’t tied to the hardware in any particular machine. To move your FreeNAS install to another machine, you just need to move the hard drives and thumbdrive, set the BIOS to boot from the thumbdrive, and your server will be back up and running in no time.
Once you’ve been through the initial install, FreeNAS will prompt you to reboot the computer. When it reboots, you’ll be presented by FreeNAS’s console menu. At this point, you can point your web browser to the IP address FreeNAS lists at the bottom of the screen. If everything is working properly, you’ll see a login prompt for the FreeNAS web interface. (If it doesn’t, you may need to use the console to configure your DNS server and default gateway.)
After you change the default password, FreeNAS presents you with the initial configuration wizard. While you can skip this process, I recommend walking through it, as it will help you set up a ZFS pool with decent default settings and create your first few network shares.
There are a few things you should know before you jump in. The first is that ZFS, while incredibly powerful, is unlike the filesystems you find on desktop OSes. To get the most out of ZFS, you really need to span the filesystem across multiple disks. Each group of disks is called a pool, and while FreeNAS will let you have multiple pools in your system, you probably only need a single pool for a home server. ZFS lets you configure the redundancy level for a set of drives at the pool level. While I generally recommend using a using a striped pool and backing up your data regularly instead of a mirrored setup, if you have the hard drive space, mirroring will help you recover from a dead hard drive faster than backups.
Inside each pool you can add datasets. Datasets in ZFS are roughly analogous to folders in more traditional filesystems; however, each dataset can have unique settings for quotas, permissions, and other features. I generally recommend creating one dataset for each type of media. That means you’ll want one dataset for videos, one dataset for music, one for photos, one for Windows backups, one for Mac backups, one for BSD jails, and a catch-all place for files that don’t fit one of the other categories.
Once you’ve created the datasets, the FreeNAS wizard will help you create the appropriate file shares. By default, most people should choose the CIFS option when it’s time to select the share type. CIFS shares are supported by all the major desktop operating systems, but you will need to enable an AFP share if you plan on backing up your Macs to the server using Time Capsule.
At this point, you should have a working FreeNAS box. Now you need to create a group for all of your users—I called mine “Users”, add users, and add that group to the permissions for each dataset and share.
What’s Next?
Now that your machine is up and running, The first thing you should do is enable snapshots. Snapshots are on-disk backups that save the state of every file on the ZFS pool. FreeNAS makes it easy to set snapshots to run automatically according to a schedule. WARNING: Snapshots don’t really protect against data loss from hard drive failure—mirroring or a good backup scheme will take care of that—but they will help you recover if you accidentally delete the wrong file. Even better, snapshots are essentially free. Each snapshot simply stores the differences between any files that have changed since the last snapshot, so they’re very small. I set snapshots to run on my ZFS pool every couple of hours, and each one is retained for several weeks.
Next, you can install some plugins to extend your server’s capabilities. You'll want to check the FreeNAS plugin documentation for plugin-specific installation instructions for anything that you want to try. FreeNAS plugins run in FreeBSD jails, a kind of virtualized environment that's connected to, but still isolated from the main machine. If you're just getting started, it's worth installing Plex (video streaming in and out of your home), BTSync (an easy way to keep files synchronized between devices), and Subsonic (music streaming in and out of your home). These three plugins were relatively simple installs, however some of them require jumping through substantial hoops.
Plex is an incredible tool if you have a server and a large media collection. With ubiquitous support for phones, tablets, and set top boxes, it lets you play your videos almost anywhere.
Build A Home Server For Macbook Pro
Before you fill your machine with data, you should devise a backup solution. You can simply copy the data on your ZFS pool to a drive in another machine using BTSync or rsync, or take advantage of FreeNAS's integrated backup tools rsync or Crashplan. Backing up a large server is a pain, but at least FreeNAS gives you plenty of options.
![Why build a home server Why build a home server](/uploads/1/1/9/5/119590624/765906722.png)
We've just explored a fraction of what's possible using FreeNAS. Using virtual machines, you can run game servers for yourself or a Minecraft server for your kids. You can even use your FreeNAS machine as the anchor of your independent personal cloud service. Or, you can simply use it as a place to back up your local machines and store a few video files. It's up to you!
I’ve written about the Mac server I keep in my house so many times that I sometimes forget that people don’t keep a catalog of everything I’ve written in a database somewhere, tagged by topic.1 So when I wrote about using a hacked Intel NUC as a replacement for my Mac mini server last week, I got a bunch of questions about what I was using my server to do.
Fair enough. I’ll explain, but first let me tell you a little about the history: I’ve been running a Mac server since before there was a Mac mini, back when I first got a dedicated Internet connection for the first time. (It was DSL, and for the decade I had it, it went from being miraculously fast to horrendously slow.) My first server was a beige Power Mac G3 I picked up from an employee sale at Macworld, and it was replaced by my Power Mac G4 when I migrated to a G5. The G4 was replaced by the first Mac Mini, then an Intel Mac Mini, and finally by a Core 2 Duo model.
In the mid-90s I co-wrote a book about using Mac OS as a server, so the moment I could have a server in a closet in my house, I did it. In the early days I used it as a web server (for InterText, my fiction magazine. I used FileMaker to build a few web databases, including a home-built app that let me run a fantasy football draft before there were web-based tools that let you do that.
I also ran my own email server for a while, using MailShare (later Eudora Internet Mail Server), a remarkably robust Mac email server. In the end I gave up and switched to Gmail for all of my mail, not because MailShare let me down, but because the sheer volume of spam connections to my mail server were swamping my slow DSL connection. (Plug for an occasional podcast sponsor: If I had been using MailRoute to pre-screen my inbound mail, I could’ve kept running it.)
Over the years all of those uses fell away, but new ones replaced them. For years it’s been really convenient to have an always-on computer somewhere on my local network, attached to a large hard drive (or multiple hard drives), containing my media library. In the early days, that meant thousands of MP3s. iTunes and the Slim Devices media server meant that I could play anything from my music collection on a laptop or my stereo. These days my music streams over the Internet, but I’ve still got a sizeable collection of video files that are served up to my various devices via the Plex server. I also store a lot of large archival data sets—old podcast projects, mostly—on my server.
How To Build A Server For Your Home
In 2004 I set up a weather station in my backyard; to get that data on the Internet, I needed to attach a radio receiver to my Mac via a PC serial-to-USB adapter. It worked, but it was janky and required the computer to be close enough to the weather station to receive its signals. At some point, the manufacturer of my weather station offered a new add-on module that gave the station’s indoor display console an Ethernet port and automatically uploaded data to the cloud.
WeatherCat, the Mac weather-station software I use, can talk to that module directly, so my computer no longer needs to be within radio range of the weather station itself. While I could just rely on cloud services like Weather Underground to display my weather data, I’ve built up a large database of historical data—all generated by WeatherCat and served by my server using its built-in web server. So I keep using WeatherCat, and keep promising myself to update the web templates I created 15 years ago.
Late last year I started running HomeBridge on my server, which allows non-HomeKit devices in my house to be visible to Apple’s Home app. It has worked quite well, and it’s awfully nice to have a single unified interface for all the smart devices in my life.
As for the many large hard drives I used to have attached to the server, a few years ago I replaced them all with a Drobo 5D (disclaimer: it’s another former podcast sponsor), which is an even larger hard drive, with some added redundancy in case of a drive failure. (A few drives have failed; so far, all I’ve had to do is pop the dead drive out and pop in a fresh one. I keep a spare drive or two around just in case of failure, and yes, I do back up all the important data to the cloud, because RAID is not a backup.)
So, long story short, today my server is acting as a file server, weather station, HomeKit bridge, and web server for a few miscellaneous files. Could I do the same thing with a NAS box, or if I just installed Windows 10 or Linux on that Intel NUC instead of hacking it to run High Sierra? Sure, but I am vastly more comfortable with macOS. And as someone who tends to travel without a Mac, sometimes I find my self in desperate need of one. Most often, someone hands me a file—usually a QuickTime movie recorded by Call Recorder—that I just can’t process on iOS. I can use an app like Screens VNC to connect securely to my home server, drag the file from my Dropbox folder and drop it onto a conversion utility, and then disconnect. The converted files go right back into Dropbox, and I return to my iOS workflow. I know, it’s cheating—but it’s awfully useful to have a Mac on call if you run into a brick wall in iOS.
- If you do, please don’t tell me, and also stop hacking into my home network. ↩
Build A Server Online
If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.