Turn An Old Computer Into A Do-Anything Home Server With FreeNAS 8

Turn An Old Computer Into A Do-Anything Home Server With FreeNAS 8

You’ve heard the word “server” thrown around a lot, but it’s usually in the context of websites or big companies that have a lot of data to store. In reality, a server can be just as useful in your home. In this guide, we’ll walk through how to create your own home server out of an old or cheap computer that can do all your downloading, streaming and backup tasks 24/7.

Note: If this post looks familiar, it’s because we’ve covered FreeNAS before. Our old guide used the excellent FreeNAS 7, but the new FreeNAS 8 makes installing plugins for BitTorrent, media streaming, Usenet and other tasks much easier. If you want to check out FreeNAS 7 — now called NAS4Free — you can still view our old guide here. Alternatively, if you don’t want to use FreeNAS, you can put together a similar setup using Ubuntu.

What Does a NAS or Home Server Do?

Network Attached Storage — or NAS for short — is basically a set of hard drives connected to your network, so any computer in your house can access them. This is great for bigger households or people with multiple computers (like a home theatre PC) that all need to access the same data. They’re also usually quite low power and low cost, and they don’t require a monitor, mouse or keyboard — once you’ve installed the software, you can configure every aspect of your NAS from a web browser on your other computers.

The term “home server” usually has a different connotation than NAS, but they’re similar. The main difference is that home servers can perform more tasks than just storage — they can also do things like download files for you, stream media to your other devices and so on. These days, NAS devices come with more and more functionality out of the box, so the terms NAS and home server are often used interchangeably. Don’t sweat the details — the device we make in this guide can be as basic or as extreme as you want, no matter what you call it.

You can buy a lot of great NAS devices out there, and they will come with their own good software. However, we’re going to use free, open-source software called FreeNAS to repurpose an old computer instead. That way, you can just fill your old PC up with drives, stick it in the closet and forget about it, without having to spend a lot of money. Alternatively, you can build your own quiet and low-powered home server cheaply (that’s what I did) and configure it a bit more to your needs. Whatever kind of PC you use, setting up the software is pretty similar across the board. Here’s how to do it.

What You’ll Need

You can install FreeNAS on a lot of different systems, using a number of different methods, but here are the things you’ll need for our method:

  • A PC with a minimum of 2GB of RAM. FreeNAS recommends that you have at least 4GB for its ZFS filesystem, but if your old computer isn’t loaded up with RAM, the older-but-more-stable UFS filesystem will work fine for most people’s needs.
  • The FreeNAS Installer Image, available here (more info on this below).
  • A 4GB or larger flash drive.
  • A network with DHCP reservations or static IP addresses. This isn’t required, but it’s definitely preferred. If you don’t have this, managing your NAS can get pretty annoying, since its IP address will change whenever you reboot it (as will your other computers’ IP addresses).

FreeNAS is actually designed to run on a flash drive or compact flash card rather then one of the drives in your computer. If your computer doesn’t have the ability to boot from USB, you’ll have to follow some slightly tweaked instructions here (and you won’t be able to use one of your drives for storage). For this guide, we’ll be booting from a 4GB USB drive.

Install FreeNAS

To install FreeNAS, you’ll need to grab a 4GB flash drive and the FreeNAS installer image. You’ll want to grab the USB image, not the live CD. If the computer on which you’re installing FreeNAS is 64-bit capable, grab the 64-bit image; otherwise, you’ll want to grab the 32-bit image from the 32-bit tab along the top.

Step 1: Burn Your USB Drive

The first step is different depending on your operating system.

Turn An Old Computer Into A Do-Anything Home Server With FreeNAS 8

Windows users: to install FreeNAS on your flash drive, you’ll first need to download Win32DiskImager and 7-Zip (if you don’t have them already). Here’s what you need to do:

  1. Download the FreeNAS image archive and open it up with 7-Zip. Copy the FreeNAS IMG file to your desktop and exit 7-Zip.
  2. Insert your flash drive. Start Win32DiskImager and click the blue folder icon. Browse to your FreeNAS IMG file you just extracted.
  3. Choose your flash drive from the dropdown on the right, then click the “Write” button to write the image to your drive.

Mac users: To install FreeNAS on your flash drive, you’ll need an app called Keka, as well as a little command line work:

  1. Download the FreeNAS image archive and right-click on it. Choose “Open With Keka” from the menu. It should automatically extract the FreeNAS IMG file to the same folder as the XZ archive.
  2. Insert your flash drive. Open Disk Utility (from /Applications/Utilities) and select your flash drive in the sidebar. Click the Erase tab and format it, ensuring it only has one partition. It doesn’t matter what you format it as, because we’re going to overwrite it in a minute.
  3. Open a Terminal window (from /Applications/Utilities) and run the following command:
    diskutil list.
  4. Note the path of your USB drive in the list. This will be something like /dev/disk1.
  5. Run the following command:
    dd if=~/Desktop/FreeNAS-8.3.1-RELEASE-p2-x86.img of=/dev/disk1 bs=64k. Be SURE to replace the “if” path and the “of” path with the correct ones for your system (the first being the location of your FreeNAS image, the second being the path to your flash drive). If you do this incorrectly, you can cause severe data loss!
  6. Give it time to finish the copying process. When it’s done, you’ll get a message saying it completed successfully.

Step 2: Boot and Configure FreeNAS


Now that you have your FreeNAS flash drive ready to go, it’s time to get FreeNAS started. Here are the things we recommend doing to get it set up:

  1. Plug the flash drive into your computer and turn it on. Make sure to boot from the flash drive. You may need to tweak a few BIOS settings in order to do so.
  2. It will take a few minutes to start up. When it’s done, it will give you an IP address at the bottom of the screen. Head back to your main computer and type that IP address in your browser’s navigation bar. You should be greeted with the FreeNAS web interface.
  3. Before you do anything else, you’ll want to change your username and password for this web UI, since it doesn’t have a password right now — which is very insecure. In the left-hand sidebar, head to Account > Admin Account > Change Admin User. Give yourself a new username, and click the “Change Admin User” button. Next, along the top of that pane, click the “Change Password” tab and give yourself a new password.
  4. This username and password only applies to the FreeNAS web interface, so you’ll want to create a user for yourself as well. To do this, head to Account > Users > Add User in the left-hand sidebar. Give your user a username, a primary group (as the admin, I made my primary group “wheel”) and a password. (Note: If you’re adding drives from an old FreeNAS 7 installation, you may need to change your User ID to 1000 instead of 1001 in order to access those drives).
  5. Optional: If you have other people in your household that are going to access data on your home server, you may also want to create a group for them at this menu. For more information on this, see our guide to file permissions.
  6. Lastly, go to System > Settings and change your protocol to HTTPS (for enhanced security) and your timezone to your location. If you plan on using your NAS to access the internet, you’ll also need to head to Network > Global Configuration and set your IPv4 Default Gateway to your router’s IP address. I also like to change my NAS’ hostname to something other than “freenas” (so I can easily spot it on the network), but this is optional.

Take some time to poke around FreeNAS’ configuration settings and tweak anything you see that you might want to change. The above steps should get most people going, but if you have specific needs (like if you’re using static IP addresses instead of DHCP reservations) you may have to tweak more.

Step 3: Add Your Disks


Now that your FreeNAS system is up and running, it’s time to add your hard disks to its pool. Here’s how:

  1. Head to Storage > Volumes > Volume Manager in the left-hand sidebar to add a new, blank hard drive.
  2. Give your new hard drive a name, choose it from the list of connected drives, and choose a filesystem. If you have a more powerful machine, ZFS is FreeNAS’ recommended choice, but UFS is great for lower-powered systems (I’m using UFS on my machine).
  3. Click the “Add Volume” button. This will wipe the drive, so make sure you’ve backed up anything you need from it first.
  4. Once your volume shows up in the left-hand sidebar, click on it and choose “Change Permissions”. This part is up to you, but I like to change the owner to my username. You can also change the group if you desire — I’ve created a group called “family” as the owner of these drives, so other members of my household can access them. Once again, see our guide to file permissions for more details on what all this means.

Repeat this process for all your attached hard drives. If you’re using drives from an old FreeNAS system, you’ll want to choose “Import Volume” instead of “Volume Manager” in step 1. Then just select what filesystem it’s already using, and you’ll be able to use your existing data.

Step 4: Share Your Disks


When your hard drives are all set up, it’s time to share them over the network. We’re going to use CIFS, since its preferable for households with Windows machines or with multiple operating systems. If you have an all-Mac household, look into AFP as an alternative.

  1. Head to Sharing > Windows (CIFS) Shares > Add Windows (CIFS) Share in the left-hand sidebar.
  2. Give your share a name, and click the Browse button next to Path. Navigate to the drive you want to share.
  3. Click OK. It will ask you if you want to enable the CIFS service. Don’t do so just yet. Click No, then head to Services > CIFS in the left-hand sidebar. Change your NetBIOS name to whatever you want and tweak any other settings you want. The defaults should be fine for most people.
  4. Repeat Steps 1-3 for the other drives you want to share.
  5. When you’re done, head to Services > Control Services and flip the CIFS switch to “On”.

Now, head to your main computer. If it’s a Windows machine, open Windows Explorer and click on the “Network” shortcut in the left-hand sidebar. You should see your FreeNAS machine pop up and you can navigate to any of your shared drives from there. If you’re on a Mac, just open the Finder and head to Go > Connect to Server, and type smb://freenas (or whatever your CIFS share’s netBIOS name is) and click Connect.

When prompted, enter your username and password (the one we created from the FreeNAS “Users” settings earlier) and you should be able to create and edit files right from your PC.

Congratulations, you have a fully operational file server! Now you can use these disks for whatever you want. You can store data on them, use them for backup or even access them directly from your home theatre PC (though if you require streaming to DLNA devices, you’ll want to check out the streaming section below).

Other Uses for Your Home Server

If you want to do more than just share files, FreeNAS has a fantastic plugin system to take advantage of. Here, we’ll show you how to install three popular plugins for some pretty cool tasks.


Set Up a Jail for Your Plugins

In order to install plugins, you’ll need to set up what’s called a “jail”. Basically, a jail is a small virtual FreeBSD environment working inside FreeNAS that can run other programs. If you’re using ZFS, FreeNAS recommends you use its slightly more complicated method, but we’re just going to set them up using a few folders on one of our hard drives:

  1. Choose one of your drives to hold your jail. I’m putting it on my drive called “Media”.Make sure this drive has the necessary permissions to install a jail and plugins. That means the drive should have Read and Execute permissions for “Other” in Storage > Volumes > (Drive Name) > Permissions.
  2. Create two new folders on this drive: one for the jail, and one for the software we’ll install on it. I just called these folders “Jail” and “Software”.
  3. Head to the the FreeNAS SourceForge page and navigate to the folder of the FreeNAS version you’re using (for me, that’s FreeNAS-8.3.1/RELEASE-p2/x86). Go to the “plugins” section and download the Plugins_Jail PBI for the version of FreeNAS that you’re using.
  4. In the FreeNAS web interface, go to Services > Plugins > Management > Settings. Choose the volume on which you created the two folders in step 1 when prompted.
  5. Set the Plugins Jail Path to the path of your “jail” folder created in step 1, and the Plugins Archive Path to the path of your “software” folder. Give your jail a name (I called mine “software”) and an IP address and netmask. This should be a different IP address than your FreeNAS box uses for itself.
  6. Click Upload Jail PBI and navigate to the PBI file you downloaded earlier.
  7. Head to Services > Control Services and flip the Plugins switch to On.

Now you’re ready to start installing your plugins! Here are a few you might want to try out.


Download Torrents with the Transmission Plugin

The Transmission plugin will allow you to download and manage torrents from your server, which is great for seeding those torrents 24/7.

First, download and install the plugin:

  1. Download the Transmission plugin from the same page you downloaded the Plugins PBI on FreeNAS’ SourceForge page.
  2. In the FreeNAS web interface, click Services in the sidebar and click the “Plugins” tab along the top. Click the “Install Plugin” button.
  3. Browse to the Transmission PBI you downloaded and click Upload. You should see Transmission show up in the sidebar under Services > Plugins when you’re done.

Now that you’ve got Transmission installed, we need a place for it to store downloaded files. Since it resides in a jail, it can’t access our normal drives, so we need to create a “mount point” within the jail that points Transmission to our drive outside the jail. Here’s how that works:

  1. In the FreeNAS web interface, click “Shell” in the left-hand sidebar to bring up a terminal window for your server. Run the following command to see your current jails:
    jls
  2. Note the JID of the jail you want to use (in this case, you probably only have one). Then Run:
    jexec 1 tcsh
    where “1” is the JID of the jail you want to use.
  3. Next, run:
    mkdir /usr/TransmissionDownloads
  4. Exit the terminal window and go to Services > Plugins > Management > Mount Points in the sidebar and click Add Mount Point. For the Source, navigate to the folder you want to use for Transmission’s downloads on your hard drive (in my case, it’s /mnt/Media/Downloads). For the Destination, navigate to the /usr/TransmissionDownloads folder we just created. This will link the two folders together. Click OK.
  5. Open the Terminal back up by clicking “Shell” in the sidebar. Repeat steps 1 and 2 to get back into your jail’s shell. Then run the following command to change the owner of your downloads folder:
    chown 1001:transmission /usr/TransmissionDownloads
    Replacing 1001 with the UID of your user, if different than 1001.
  6. Next, run the following command to change the permissions on that same folder:
    chmod 775 /usr/TransmissionDownloads

Now you can just set up Transmission and get to downloading. Select the Transmission option in the sidebar to change its settings. You’ll definitely want to change the Downloads directory to /usr/TransmissionDownloads, as well as check the “RPC Auth. Required” box and create a username and password (which ensures that only you can access the Transmission web interface). Tweak any other BitTorrent-related settings you want here, then click OK.

When you’re done, go back to Services in the sidebar and click the Plugins tab. Flip the Transmission switch to “On” to enable the service. If all goes well, you should be able to access the web interface by typing this into your browser’s address bar:

192.168.0.20:9091

where 192.168.0.20 is your jail’s IP address that you picked earlier, and 9091 is the port for Transmission’s web UI, available in the Transmission settings. Try downloading a torrent, and you should see it show up in your Downloads folder!

Stream Music with the Firefly Media Server Plugin

Firefly Media Server is a great way to stream music from your home server to other computers and devices in your house. It’s designed to work with the Roku Soundbridge and iTunes through the DAAP. Here’s how to get it up and running:

  1. Download the Firefly Media Server PBI plugin from FreeNAS’ SourceForge page, once again navigating to the version that matches your version of FreeNAS.
  2. In thee FreeNAS web interface, click Services in the sidebar and click the “Plugins” tab along the top. Click the “Install Plugin” button.
  3. Browse to the Firefly PBI you downloaded and click Upload. You should see Firefly show up in the sidebar under Services > Plugins when you’re done.
  4. Open up a Shell, just like you did for Transmission, and run the following command:
    jexec 1 tcsh
    mkdir /usr/Music

    Once again, replace “1” with your jail’s number. You can name the directory whatever you want.

  5. Go back to Services > Plugins > Management > Mount Points and add a new mount point. Like we did with Transmission, set the Source to your drive’s music folder (in my case, that’s /mnt/Media/Music” and set the Destination to the folder in /usr you just created (in my case, /usr/Music).
  6. In the sidebar, head to Services > Plugins > Firefly to change Firefly’s settings. Set the MP3 Dir to /usr/Music and click OK.
  7. Go back to Services > Control Services and click the Plugins tab along the top. Flip the Firefly switch to On to enable it.

Open up iTunes or your Roku Soundbridge, and you should see your new music server pop up, ready for streaming. You can also visit Firefly’s web interface by typing this into your browser’s address bar:

192.168.0.20:3689

where 192.168.0.20 is your jail’s IP address that you picked earlier, and 3689 is Firefly’s port, available in Firefly’s settings. You won’t be able to stream music from the web interface, but you’ll be able to see its status.

Stream Videos with the MiniDLNA Plugin

Firefly will take care of streaming music. Many home theatre PCs will already be able to stream video just by accessing your shared drive directly over the network, but if you need something that shares over DLNA — say, for an Playstation 3 or Xbox 360 — that’s a job for MiniDLNA. Setting it is very simple:

  1. Download the MiniDLNA PBI plugin from FreeNAS’ SourceForge page, once again navigating to the version that matches your version of FreeNAS.
  2. In thee FreeNAS web interface, click Services in the sidebar and click the “Plugins” tab along the top. Click the “Install Plugin” button.
  3. Browse to the MiniDLNA PBI you downloaded and click Upload. You should see Firefly show up in the sidebar under Services > Plugins when you’re done.
  4. Open up a Shell, just like you did for Transmission, and run the following command:
    jexec 1 tcsh
    mkdir /usr/Videos

    Once again, replace “1” with your jail’s number. You can name the directory whatever you want.

  5. Go back to Services > Plugins > Management > Mount Points and add a new mount point. Like we did with Transmission and Firefly, set the Source to your drive’s music folder (in my case, that’s /mnt/Media/Videos and set the Destination to the folder in /usr you just created (in my case, /usr/Videos).
  6. In the sidebar, head to Services > Plugins > MiniDLNA to change MiniDLNA’s settings. Set the Friendly Name to whatever you want, the Media Directory to /usr/Videos and check the “Rescan on Restart” box. ClickOK when finished.
  7. Go back to Services > Control Services and click the Plugins tab along the top. Flip the Firefly switch to On to enable it.

Now, if you head to your Xbox, Playstation or other DLNA-compatible device, you should see your device pop up under DLNA or UPnP servers. Flip through your videos folder, pick a movie and get to watching!

These are far from the only plugins you can install. There are plugins available for Usenet, Subsonic and others. Check out this forum post for more of the plugins available, and note that some of them will require you to set up mount points like you did for Transmission. (Note also that some of the plugins out there are 64-bit only, but you can find experimental 32-bit versions of the Usenet plugins in this thread). And, if the software you want isn’t available as a PBI, you can still install it from the command line.

You’re on your own now, but if you’ve followed this guide to this point, you should have all the skills you need to do just about anything with your new home server. Be sure to check out the FreeNAS documentation and the forums if you ever need help. Good luck!


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


3 responses to “Turn An Old Computer Into A Do-Anything Home Server With FreeNAS 8”