Raspberry Pi Home Server

Turn a Raspberry Pi computer into a fully-featured home server. Run your home for a penny a day.
Course info
Rating
(207)
Level
Beginner
Updated
Aug 3, 2015
Duration
4h 47m
Table of contents
Introduction
Getting Started
Going Headless
Adding External Storage
Sharing File with Samba
Sharing Media with DLNA
Sharing Media with DLNA
Virtual Private Networking with OpenVPN
BitTorrent Sync: Your Own Private Cloud
Power Failures and Uninterruptible Power Supplies
WordPress
Booting from the Hard Drive
Description
Course info
Rating
(207)
Level
Beginner
Updated
Aug 3, 2015
Duration
4h 47m
Description

In this course, you'll learn how to turn a Raspberry Pi computer into a complete home server, capable of sharing files and media, backing up your other computers, and providing secure access to your home network when you're away. All of this is possible with a $35, single-board computer, a USB hard drive, free software packages, and a free afternoon.

About the author
About the author

Mel Grubb is a professional software developer and hobbyist from Columbus, Ohio. He spends his days as a consultant in the .Net space, and his nights tinkering with machines around his house.

Section Introduction Transcripts
Section Introduction Transcripts

Introduction
Hi, I'm Mel Grubb, and in this course we're going to turn a Raspberry Pi computer into a complete home server capable of sharing files and media with other devices in your house, including backups of those devices. and even providing secure access to your home network when you're away. You may be wondering what a hobbyist course like this is doing on Pluralsight. It's here because we are the target audience. We spend all day out or IT jobs solving other peoples' problems, and at night we tinker around with computers even more because that's just what we're in to. I'm not making any assumptions about your experience level with Linux or Raspberry Pis or hardware projects in general, but just because you're here, I can guess that this is the sort of thing you'll enjoy. In case you're not already familiar with the Raspberry Pi, here's a quick rundown on what it is exactly. It's a small Linux computer all on a single circuit board that's about the size of a deck of cards, and only costs $35. It was originally created by the Raspberry Pi Foundation as an affordable, but capable computer for students to learn to program on, but because of its size and cost, it quickly gained a following in the hobbyist and maker communities. What will this server be able to do for you? When it's completed, it'll act as a file server, letting you centralize files, pictures, music, and videos all in one place, a media server to serve those items up to media devices around your house using the DLNA standard, a back-up destination to be used by your other computers, a virtual private networking server which will secure access to your home network when you're away, your own private cloud, synchronizing files across multiple different devices, and even a blog engine that you can use to host a small private site or a small public blog.

Getting Started
In this module, we'll start putting the system together by choosing and downloading an operating system, writing it to an SD card, and hooking everything up. We'll take a quick tour of the Raspberry Pi and update the preinstalled software.

Going Headless
In this module, we'll get connected to the Raspberry Pi home server over the network. We'll look at two different methods of assigning the Pi a static network address so that you can find it easily, then we'll look at three different ways of connecting to the Pi remotely, through SSH, over the web, and finally through a remote desktop session. After this module, there will be no need to keep the Pi connected to your monitor, keyboard or mouse, this will allow you to place the server up on a shelf safely out of the way. I keep mine next to the network router in my basement.

Adding External Storage
In this module, we'll add an external hard drive to make room for the Raspberry Pi home server to store files. We'll look a little deeper into the Linux filesystem, partition, format, and final mount the hard drive.

Sharing File with Samba
In this module, we'll set up file sharing and finally be able to call this project a functioning server. We'll start by installing Samba and then we'll look at two different ways to set up shares using a plug-in to the web end front end, and also by editing configuration files directly from the command line. Along the way, we'll learn about Linux permissions as well. When this module is complete, you'll have a working file server with a public share accessible by the other computers on your home network.

Sharing Media with DLNA
At this point in the course, the Raspberry Pi home server can share files over the network and you can use this to play music and video files on devices that understand SMB file shares, such as other computers, some smart TVs, and dedicated media center devices. It's just a shared directory though with no frills and may not provide the best user experience. In this module, we'll set up the Pi to act as a proper media server sharing media files using the DLNA standard.

Sharing Media with DLNA
One of the most important jobs a home server can perform is backing up the other computers on the network. You could simply back up to an external hard drive, or use a commercial service that stores your backup data on someone else's off-site servers. Since you're building a home server though, this is just one more useful thing it can be doing for you. In the previous version of this course, I showed how to install and use CrashPlan for this purpose, but they have since decided to exit the home user market, and the Pi was never officially supported anyway, so it's time to look at other options.

WordPress
In this module, we'll install and configure the WordPress blogging engine. You can use this local instance for practice, for testing plugins you may be working on, or to run a small blog of your own. I wouldn't try running a popular public blog off of a Raspberry Pi, but you could definitely use it to host smaller blogs, newsletters, or a blog internal to your own house as a kind of journal. There are many plugins available for WordPress, so it can be tailored to satisfy many different uses. WordPress runs on top of what is commonly referred to as the LAMP stack. LAMP stands for Linux, the operating system, Apache, the web server, MySQL, the database engine, and PHP, the web programming platform. The Linux part is already done, that's the Raspbian OS you've been using this whole time, so we can check that off the list already. Let's install the Apache web server.

Booting from the Hard Drive
In this module, I'll show you how to boot the Raspberry Pi from the external hard drive. This can increase performance slightly, and reduce the wear and tear on your SD card. Before you commit to booting from the hard drive, you should examine whether this is even the right choice for you. On the one hand, booting from the SD card is very convenient, requiring no attachments to anything external, making the whole system more portable. It also simplifies the backup process, you can just take an image of the SD card as I've been advocating at the end of every module. There is one significant drawback to using the SD card though, and that is that SD cards have a limited number of write cycles they can perform before they're used up. That number is ridiculously high, but it's there. On the other hand, booting from the hard drive is faster than from the SD card, and the system runs a little better once booted. Not a lot, but a little. Hard drives have a longer lifespan than SD cards as well. And now for the downside. If you configured the system to boot from the hard drive, then that drive must remain attached to the server at all times, and your backup files will be larger and less convenient to take. You can't just pop the SD card out and stick it in a reader anymore. You'll need to detach the hard drive, move that to your other computer, and take the image from that. If your main computer runs on Mac OS or Linux, then the process remains largely the same, but Windows users will find it less convenient to take these backups.