For those wondering if they could get rid of all the external hard drives and cables lying around, or find a way to use that ancient CPU or laptop gathering dust in a cupboard, a Linux server could be the answer. Servers are incredibly useful even at home. This article demonstrates how to set up a home server for media streaming and back-ups
What are servers, and why do I need one? A server is often just a computer that stores your data and serves it to other computers on the network. In a household scenario, it can be hidden away in a corner of your room—a target for all your device backups, and source for all your media to your devices. Specifically, such a set-up is called network-attached storage (NAS).
There are a lot of out-of-the-box solutions to create a NAS, but most of them are very expensive or don’t even come close to the kind of customisability that Ubuntu Linux can provide. Ubuntu is one of the best and the easiest to install and use flavours of Linux, and that is why we are using it for our NAS box.
So what do you need to get started? There are different versions of Ubuntu available, and most should work fine for our purposes, but in this article we will follow the easiest method of installation. This is what you will need:
1. A PC/laptop with a minimum of 512 MB of RAM and a 1GHz processor, and a minimum of 5GB free space for your server. It is recommended that you set up your server close to your router, so you can use a wired (Ethernet) connection instead of Wi-Fi—that is much faster.
2. An Ubuntu live CD, downloaded from the Ubuntu website. We will be using the Desktop version rather than the Server version, since it’s easier to configure and set up. You could alternately burn the image to a USB flash drive as well, if your soon-to-be server machine does not have a CD drive. Links to help you do this are given at the end of the article.
3. Hard drives to store your media/back-ups. You don’t need to get new hard disks for this; we will be sharing the content on your existing disks. You could always plug in more storage if you plan on buying new hard disks.
Setting up Ubuntu
Before beginning the installation, make sure you back up any existing data on your soon-to-be server, and that you have at least 5 GB of free space. To begin, insert the CD/USB flash drive into your server machine and boot it up. If your machine is not set to boot from a CD/USB, you may need to press F12 to enter a one-time boot menu and select CD/USB, or you could change the boot device priority in the BIOS settings (but make sure you change it back if you are going to use external disks for storage—which is the likely scenario if you are using an old laptop for your server, like I am). Your system’s start-up screen will tell you how to enter the BIOS set-up screen.
After booting into Ubuntu, select the Install Ubuntu option and follow the onscreen instructions to set up a dual-boot or single-boot system, based on your preferences. Also, make sure you select log in automatically when you are creating a user account, so that you have a single-button power-up sequence, which doesn’t need any action from you during start-up.
The server set-up
At this point, I assume you have Ubuntu set up successfully and are booted into it. Now for the server set-up, plug in your external drives if you haven’t already, and click Ubuntu Dash (the button with Ubuntu logo) and search for Terminal. Ubuntu has built-in support for NTFS, so your drives should ideally work out-of-the-box. If you are configuring new drives, you can format them as ext4 for better Linux compatibility. Ubuntu supports HFS-formatted disks (the native format on Macintosh computers) as well, as long as journaling is disabled on them; but for the purposes of this article, let us assume your disks are formatted as NTFS or ext4.
Step 1. Mount-points: In the terminal, run the following commands as explained below:
[stextbox id=”grey”]sudo mkdir /path/to/mountpoint
sudo chown userName /path/to/mount
Replace /path/to/mountpoint with a folder in which you would like to mount your hard disk. For example:
sudo mkdir /media/BackupDisk
sudo chown sumit /media/BackupDisk
sudo mkdir /media/MovieDisk
sudo chown sumit /media/MovieDisk