FreeNAS is a free, open source BSD-based operating system that can turn any PC into a rock-solid file server. Today I’m going to walk you through a basic installation, setting up a simple file share, and setting things up so you can access your files from anywhere over the Internet using the encrypted secure FTP over SSH option.
Requirements & Alternatives
To set this up today, you either need a working FreeNAS installation already set up and running, or:
- The latest install ISO from the FreeNAS download page.
- A spare computer or VM.
- A USB stick 4GB or larger.
As well as to set up remote access, you’ll also need:
- The ability to configure your router to either forward ports or setup dyndns addresses.
- An ISP that doesn’t block every port.
If FreeNAS isn’t your thing, here’s a few alternatives:
- Microsoft Windows Home Server is my current choice of home file and backup server, and is an absolute steal at just $49 for an OEM license.
- Amahi Home Server is a free, Linux-based solution that comes complete with an app store for adding functionality with one click installations. It’s well-developed, but some features such as disk pooling are still a bit sketchy for the average user and it does sometime require a little command line hacking to get things just right.
- A router with DD-WRT hacked onto it and a USB hard disk attached could also perform the same function, but again there’s a lot of hacking involved to get it to work right.
First up, FreeNAS isn’t something you’ll be dual-booting, and it doesn’t even come with a nice graphical partitioning utility. If you install to your nice 1TB drive then the space will be wasted. You need to install FreeNAS to either a USB drive, or an SD card if your PC supports them.
If you’re unsure, try on a virtual machine first (our guide to VirtualBox should help you there). To write this guide, I used Parallels on the Mac, but it has issues booting from USB devices so you’ll need to create a separate 4GB internal drive for it to install too.
Upon booting, choose the default option at the top and be sure to choose the correct installation location. Remove the CD or detach the image when done, and reboot.
Once installed, there should be a web GUI URL listed, so you can switch back over to your main PC and continue to configure things over the LAN.
Click on Users -> Change password to harden the system – by default there’s no admin password set. Next, click Users -> Add User and go ahead creating your own regular user account. We’ll use this to authenticate later.
Configure A Share
Configuring a share involves first adding a ‘volume’ – that is, a hard disk – then creating a share. If you have more than one drive, you can configure them as a software RAID too for increased data integrity, but I won’t be going into details on that today.
Click on the storage button on the top menu.
Click create volume. The name you assign doesn’t really matter, but you’ll need to ensure you check off the drives you want to be in the volume. For our purposes, I have one drive I’ll be adding to it.
You should now see that you have 1 ‘active’ volume listed. Click change permissions and make the owner of the group the user you created before, as well as turning on the checkbox for the Group ->Write permission. In a real world scenario, you would create a group for all users and assign ownership to that rather that to an individual user, but for the purposes of testing, this is fine.
Next, click on the sharing tab. Here you can choose between Apple, Unix or Windows shares. I’ll switch over to a Windows share for now and click Add Windows Share. The only difficult part about what comes up next is choosing the folder – I just made mine the root of the /mnt/drive1 volume that I added.
You’ll also need to enable the CIFS service, which starts the Windows share ‘listener’. Click on Services ->Control Services from the sidebar and toggle on CIFS. Toggle on SSH while you’re on this screen too, which we’ll use later to do secure FTP (don’t enable the regular FTP service though).
At this point, you should be able to access the share from a Windows machine – if it doesn’t show on the network yet , just type \\freenas directly into the address bar to force it. If you type //freenas, you’ll access the web GUI instead – good to know.
Now that you’ve confirmed the Windows share is working, let’s move onto remote accessing your data.
In order to use a simple URL to access our files, we’re going to be assigning a free dynamic DNS address to our home IP. Head over to DynDNS to set up a free account.
You’ll need to confirm the email address too. When that’s done, you’ll be presented with a service plan page. In small writing at the bottom is the link to set up your free account for up to 2 hostnames. Click that.
Enter your desired hostname (you can select various domains from the drop-down), then click on the blue text that lists your IP. This will automatically fill in your IP address.
This is a different configuration for every router, so it’s really hard to show you how it’s to be done on your exact model. For mine, I accessed the router configuration at 192.168.0.1, and clicked on Port Forwarding.
You need to forward the SSH service port – 22 – to your FreeNAS internal IP. This is .11 in my case.
First, let’s see if regular SSH works. From a linux or OsX terminal, type:
The username you set up earlier, and the domain is the address you chose at DynDNS . You may get an error about verifying the authenticity of the host, but don’t worry, type YES to connect anyway.
If you see a bunch of text, you know it’s working.
Now open up your favourite FTP program and enter in the same details – username, the DynDNS domain, the password – but make sure the protocol is set to SFTP – this is crucial.
If all went well, you should be presented with a straight overview of the whole filesystem, so you can now drill down into the precise folder or share you want access to. Congratulations, you now have complete access to your shares from anywhere in the world!
We have really only just scratched the surface of how powerful FreeNAS is – I hope to highlight some of its other features in the future, so stay tuned. I hope you also tried copying a file across to see how blazingly fast it is too. Problems and comments are welcome as always but if your problem is really technical, you might get a better response by crowdsourcing it to our tech answers site.
More articles about: