Running your own home server

Just wanted to share my experience of running my own server at home. Before anyone conjures up a thought of large server rack with cooling equipment and thousands of dollars of investment. Let me show you what it looks like.

image0

Its called the cubieboard, palm sized and sits at the corner of a table, connected to my router. Cost wise, I got it for about 60SGD from indiegogo. There are many alternatives out there such as the raspberry pi which retails for something like 35USD. This particular model is more powerful than the pi. It has a 1 Ghz ARM processor and 1GB RAM, which in my opinion is decent and enough for a personal server running a couple of services. Power consumption is also very low compared to a traditional desktop pc, roughly 3-5 watts depending on load. Running it 24/7 would cost probably a few dollars monthly.

So, these boards are actually more suited for hardware hacks but who cares.I must warn you though that the learning curve is pretty steep. Initially, I assumed installation was as simple as booting from a USB and installing into NAND flash. This is untrue because firstly, there is no BIOS, the system is programmed to read a specific file and execute the boot instructions. Secondly, its designed to be headless. Without an OS, you have no network access and you cant install over SSH. Since, i received mine in the 2nd batch of production, few people had the device and the community was very small. It took me over a week of cross compilation, trial and error,forum surfing to figure it out. Anyway, its much easier today, look for IMG files which contain a fully working image and write it to your SD card, plug it in and watch it boot up.

The next step was getting it onto the internet. So basically, I wanted to be able to access it from anywhere. Since most if not all ISPs in Singapore issue dynamic IPs to residential subscribers, I needed to set up a service which would continually update my IP address when it is reissued. I ended up writing a simple shell script to check for my public IP and update it whenever it changes. I then set it up to run at 15 min intervals via cron. Oh, and dont forget the port forwarding on your router as well since you will be receiving unsolicited inbound packets.

With setup done, you can now install whatever services you which to run and play with it. Keep in mind though that this is an ARM processor, so it only runs on a few linux distros which support arm, arch arm, Ubuntu and others. You cant install packages meant for x86 systems, these distros do provide a list of packages but there are definitely fewer than x86. If a package does not exist, you will have to make, configure, install from source.

I will share more on what services I am running and what I am using it for in a future post.