Raspberry Pi Home Server: Index

Article Obsolete

A new version of this series has been published. Please refer to the new index for updated articles and ordering. This article is kept for historical reference, but should be considered out of date.


Update: I’ve recorded this series as a screencast for Pluralsight:
(http://www.pluralsight.com/courses/raspberry-pi-home-server)
If you have a Pluralsight subscription, please consider watching it. Thanks!


This series of posts is about using a Raspberry Pi as a low-cost, always-on home server. These posts started off as my own notes about what worked and what didn’t, and the entire series has seen a few updates in the short time since I first published it.

Hopefully, readers will find this series to be well organized, and I hope it can help others who are trying to build a Raspberry Pi Home Server get past some of the hurdles that I ran into. Things like:

  • Dead SD cards
  • Bad permissions
  • 403: Permission Denied when trying to use Transmission
  • Broken database connections
  • Broken WordPress themes

Meet my home server

WP_20140731_21_05_41_Pro

It consists of the following

  • Raspberry Pi Model B
  • 5V, 1Amp power supply for the Raspberry Pi
  • 8GB, Class 10, MicroSD card with adapter
  • Cavalry CADA-SA2 USB Raid enclosure with a pair of 2TB drives in it
  • USB cable for the hard drive

That’s it. That’s the whole thing. That is my home server. It uses less electricity than a night light, less than a penny a day (not counting the external drives), and it does all of the following for me.

  • Home network file share
  • DLNA-compliant home media server
    Currently sharing every CD in the entire house
  • Transmission BitTorrent client
    Mostly used to get new Raspberry Pi images, actually
  • CrashPlan Backup Server
    Backs up all the household computers whether they are at home or not
  • OpenVPN Server
    I can VPN to my home network from anywhere with a connection
  • BitTorrent Sync
    Synchronizes files across all of my devices

There’s plenty more it can do. I’ve only just started.

Sound good? Want one? Well go buy yourself a Raspberry Pi, an external drive, and follow along with this series, and you’ll have a fully-functioning home server before you know it. You can build the entire thing in four to five hours from beginning to end. I’m not kidding.

Acknowledgements

Virtually everything in the series is available elsewhere on the internet, in bits and pieces on other blogs and in forum discussions, but I never found anything that really put it all together for me in a logical order, so I decided to write my own.

A lot of credit goes to the Instructables article that got me started: http://www.instructables.com/id/Ultimate-Pi-Based-Home-Server

It’s a good article, but it seems to be quite out of date. Also, I wanted to start from a standard Raspbian image rather than TurnKey, and I didn’t agree with some of the choices and ordering. For instance, I felt that basic file sharing should be tackled before building out a private cloud, and that the LAMP stack should be installed all at once before any other components that depend on it to prevent their installations from jumping the gun and installing bits of it on their own.

Articles

These are the steps to building a Raspberry Pi Home Server like the one I have at home.

  1. Installing the OS
  2. Configuring the OS
  3. Web Administration
  4. Remote Desktop
  5. Adding a Hard Drive
  6. Sharing Files With Samba
  7. Sharing Media With MiniDLNA
  8. Transmission BitTorrent Client
  9. CrashPlan Backup Server
  10. OpenVPN Server
  11. The LAMP Stack
  12. WordPress Blog Engine
  13. BitTorrent Sync
  14. Extra: SD Cards Gone Bad
  15. Power Failures

Thanks for reading, and good luck.

This entry was posted in Computers and Internet, Home Server, Raspberry Pi and tagged . Bookmark the permalink.

52 Responses to Raspberry Pi Home Server: Index

  1. Pingback: Raspberry Pi Home Server: Part 1, Meet the Raspberry Pi | MelGrubb.ToBlog()

  2. Pingback: Raspberry Pi Home Server: Part 2, Installing the OS | MelGrubb.ToBlog()

  3. Pingback: Raspberry Pi Home Server: Part 3, Configuring the OS | MelGrubb.ToBlog()

  4. Pingback: Raspberry Pi Home Server: Part 4, Web Administration | MelGrubb.ToBlog()

  5. Pingback: Raspberry Pi Home Server: Part 5, Remote Desktop | MelGrubb.ToBlog()

  6. Pingback: Raspberry Pi Home Server: Part 7, Sharing Files With Samba | MelGrubb.ToBlog()

  7. Pingback: Raspberry Pi Home Server: Part 6, Adding a hard drive | MelGrubb.ToBlog()

  8. Pingback: Raspberry Pi Home Server: Part 8, MiniDLNA Media Server | MelGrubb.ToBlog()

  9. Pingback: Raspberry Pi Home Server: Part 9, Transmission | MelGrubb.ToBlog()

  10. Pingback: Raspberry Pi Home Server: Part 10, CrashPlan | MelGrubb.ToBlog()

  11. Pingback: Raspberry Pi Home Server: Part 11, OpenVPN | MelGrubb.ToBlog()

  12. Pingback: Raspberry Pi Home Server: Part 12, The LAMP Stack | MelGrubb.ToBlog()

  13. Pingback: Raspberry Pi Home Server: Part 13, WordPress | MelGrubb.ToBlog()

  14. Pingback: Raspberry Pi Home Server: Extra, SD cards gone bad | MelGrubb.ToBlog()

  15. Sergio says:

    Nice setup.

    I use a very similar setup for my raspberry pi based server being the main difference that I went a little cheaper and used common USB mechanical disk drives for the storage of the backups.

    I use plain rsync based backups (no RAID setup) being the redundancy implemented by one of the disks (the level 2 backup) backing up all the data from the other disks (level 1 backup).

    The only problem I had was that in spite of the backups being done once a day the USB Drivers where always ON (heating and spinning…) which did not make sense to me… so I went for one of those switchable usb hubs from yepkit (https://www.yepkit.com/products/ykush ) that allowed me to switch ON/OFF a given usb device automatically from the backup script.

    It’s a cheap setup but more than enough to serve my requirements.

    Regards.

  16. glyndon says:

    Thanks very much for this series. I’ve been running high-wattage servers, from corporate to home closet, for many years, but am now retired and so am embarking on this new style of low-cost computing because it’s just plain fun (and no more fan noise!).
    Your blog is a godsend – you’ve done all the research to find the top solutions for each function.
    Just today, though, I found out that one app – pianobar, a Pandora player – can’t co-exist with other demanding apps on the same Pi. So, I just buy another Pi for it and keep on going! These things are a blast.
    Thanks again for your work on this and for taking the time to share it so well.

  17. Zing says:

    Nice! You’ve installed all the services I’m interested in installing on my RPi: CrashPlan, OpenVPN, BitTorrent Sync. Well, except for Plex. I wonder how well that would work. How’s the performance of your current server

    • Mel Grubb says:

      The client end of Plex works just fine. In fact, there’s a ready-made distribution for it called RasPlex. That’s the client, though. If you’re wanting the server end, I’m afraid no-one has quite worked that out yet. It simply needs more horsepower than the Pi has in order to do the transcoding. The GPU would make that a non-issue, but Plex isn’t open-source, so the community can’t just go add the GPU support into it. Unless the company behind Plex suddenly takes an interest in optimizing for the Pi, I’m afraid it’s just not going to be possible to run a Plex server on a Pi.

      My own system seems to be doing just fine. Most of the background processes like CrashPlan and BitTorrent Sync yield nicely to other processes, so I haven’t had any issues with media performance. If I were to tell MiniDLNAmto re-index everything or some other intensive process, I could probably force it to behave poorly, but for everything I have running, there seems to be plenty of headroom left at the moment.

  18. gdobbins says:

    FWIW, I was having trouble with CrashPlanEngine going berserk on memory and sending the system into a fatal thrashing to swap. Changing JRE’s (away from the latest 8 from Oracle) didn’t really help.
    What seems to have helped is changing the upper limit of memory allowed to the JRE, which is a runtime parameter in the crashplan/bin/run.conf file. (-MmxNNN)
    As-installed it’s 1024MB, which lets a 512MB system page itself to death. I pushed it down to 320MB, and CrashPlan seems to be ok with it, and it keeps the system from being totally locked up when CP decides it’s time to groom some storage space.

    • Mel Grubb says:

      Nice find. I should update the instructions so that folks set it up that way to begin with in the future.

      • glyndon says:

        FYI,
        This memory ceiling has been in place for several days now, and the machine remains stable and predictable – very good traits!
        The JVM will eventually camp on all the memory allowed to it, but it seems to stop there. I just added about 100GB of new files to its backup selection, and once it processed those in it went back to a quiescent state (albeit sitting on all that memory still) and an idle CPU. The system has remained usable even when CrashPlan is busy because I limited it such that there’s always enough free memory (about 50-80MB) to shell in and look around.
        I have to say, I’m impressed that CrashPlan seems to be tolerating that ceiling well. It must just grab whatever it can and spawn threads accordingly. By not letting it expand into swap space we seem to be able to avoid the system becoming bound up by thrashing to swap.
        It’s great!

      • glyndon says:

        BTW, glyndon and gdobbins are both me. I switched identities accidentally between comments.

  19. Pingback: Raspberry Pi Home Server: Part 10, CrashPlan | MelGrubb.ToBlog()

  20. Pingback: Setting up my Raspberry Pi as a home server | UnaX.dk

  21. Pingback: The Raspberry Pi Home Server – Part 1 | UnaX.dk

  22. Pingback: Raspberry Pi Home Server: Part 15b – Adding more Pis to the UPS | MelGrubb.ToBlog()

  23. Pingback: Raspberry Pi home server - coderkind.com

  24. bertans says:

    Nice tutorial… it help me so much in my first experience with Pi! Thank you!
    Just a question: how frequently have I to run rpi-update as shown in part 3? 😛

    • Mel Grubb says:

      There’s not really a rule. Once the server is up and running, there’s not normally any need to update it, but developers are fixing bugs all the time. You never know when something critical will receive an update. If you’re running Webmin, you can at least tell it to apply security updates automatically. Other than that, I check for updates once every couple of weeks because I’m curious.

  25. lauri says:

    Excellent article!
    I recently purchased a Pi and am looking forward to setting it up as a home server along with learning some PHP and basic server side scripting. This is by far the most detailed guide to get started, thanks.

  26. Pingback: Back Up And Sync Your Files Inside A Mason Jar With Raspberry Preserve | Does Everybody Dream?

  27. Pingback: Back Up And Sync Your Files Inside A Mason Jar With Raspberry Preserve | TechNewsUpdates.Com

  28. Pingback: Todae » Back Up And Sync Your Files Inside A Mason Jar With Raspberry Preserve

  29. Pingback: Best Comprehensive Raspberry Pi Tutorial / Build Page I have used to date | rpiarduinomusings

  30. Still a great install even on an Orange pi PC, I am experimenting with this cheap PC so I can give a new life to my other Raspberrypi for training.
    One thing I have to say is I cannot get minidlna to work at all, no scanning, no new folder called minidlna, I did try making a file for the db but still nothing.even in webmin the server does not show up even though everything is installed.
    I have followed you install to the letter, any suggestions.

    • Mel Grubb says:

      I didn’t bother with the Webmin plugin last time I did this, since it really doesn’t bring anything to the experience at all, but I did do a (nearly) full server rebuild only a couple of weeks ago, and MiniDLNA still worked at that point.

      I don’t believe MiniDLNA will create the directories for you though, if that’s what you were expecting. You need to create the directories and copy your media into them, then edit MiniDLNA’s configuration to point to them and either reboot the server or manually restart the MiniDLNA service. At that point it should scan the folders. You can check whether it’s running with “sudo service minidlan status” just to make sure it’s running. If that doesn’t get you anywhere, make sure you check MiniDLNA’s log files to see if there’s something concrete that it’s complaining about.

      • I did make the directories, as I already had media in the folders from the raspi build which worked brill, but I wanted to use this cheaper orange pi this time. Oh and using ubuntu mate.

        * Documentation: https://help.ubuntu.com/
        Last login: Mon Nov 23 11:36:38 2015 from 192.168.0.103
        orangepi@OrangePI:~$ sudo service minidlna status
        [sudo] password for orangepi:
        ● minidlna.service – LSB: minidlna server
        Loaded: loaded (/etc/init.d/minidlna)
        Active: active (exited) since Mon 2015-11-23 12:25:22 CET; 8h ago
        Docs: man:systemd-sysv-generator(8)
        Process: 3093 ExecStop=/etc/init.d/minidlna stop (code=exited, status=0/SUCCESS)
        Process: 3100 ExecStart=/etc/init.d/minidlna start (code=exited, status=0/SUCCESS)

        Nov 23 12:25:22 OrangePI systemd[1]: Starting LSB: minidlna server…
        Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] utils.c:277: warn: make…/’Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:665: fatal: …A]Nov 23 12:25:22 OrangePI systemd[1]: Started LSB: minidlna server.
        Hint: Some lines were ellipsized, use -l to show in full.
        orangepi@OrangePI:~$ sudo service minidlna status -l
        ● minidlna.service – LSB: minidlna server
        Loaded: loaded (/etc/init.d/minidlna)
        Active: active (exited) since Mon 2015-11-23 12:25:22 CET; 8h ago
        Docs: man:systemd-sysv-generator(8)
        Process: 3093 ExecStop=/etc/init.d/minidlna stop (code=exited, status=0/SUCCESS)
        Process: 3100 ExecStart=/etc/init.d/minidlna start (code=exited, status=0/SUCCESS)

        Nov 23 12:25:22 OrangePI systemd[1]: Starting LSB: minidlna server…
        Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:621: error: …d]Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] utils.c:277: warn: make…/’Nov 23 12:25:22 OrangePI minidlna[3100]: [2015/11/23 12:25:22] minidlna.c:665: fatal: …A]Nov 23 12:25:22 OrangePI systemd[1]: Started LSB: minidlna server.
        Hint: Some lines were ellipsized, use -l to show in full.

        I am thinking now its the Orange pi
        Non of that makes any sense sorry, I did try searching the web on the errors.

      • Mel Grubb says:

        Ubuntu could be the thing that’s changing things. I have only done this under Raspbian, so I might not be much further help. If the Orange Pi is strong enough, you might want to look at Plex Media Server. I’ve done that in a Pi2, and it works great. Much easier to install, too. ________________________________

      • Thanks for getting back to me, I spent so much time with the Orangepi, gave up with it, only one usb ever worked and it vould never find the wifi nano, Back to raspberrypi 😎
        Mind you, I started using the raspi2 with Dietpi and your setup. Even has a radio installed, so now I have your server running plus a radio……always rely on your install method to get everything running.

  31. Pingback: CrashPi – An off-Site backup for the whole family | MelGrubb.ToBlog()

  32. If I get stuck with most things about Raspi I always come back here.
    Now then now then…………..
    Just wondering if you or anyone here has thought about the x300 expansion board for Raspi.
    http://www.suptronics.com/xseries/x300.html
    Now then, as I say I use your setup even on that Orangepi with a dietpi setup your way.
    My thought was a Raspi2 with x300 plus a touch screen all built in and done your way.
    Really am just thinking out loud here.
    Radio and Xbmc or OSMC on a dual boot (as raspbian does not like playing video)
    My question do you think this is feasible? As x300 needs alot of variables.

  33. Eric Barta says:

    Hi again, Mel. I appreciate your response to my other post from 2 nights ago.

    So last night, I finished your tutorial in its entirety and got my home server up and running! While the transfer rates seemed to be steady around 7mbps, which is not fast by any means, it is good enough for what I intend to do with it.

    Of course, however, now that I have finished, I had two 2TB USB 3.0 HDDs show up at my door today, which I would like to use for this server. What would be the best approach to getting those two drives up and running?

    Would you recommend trying to set up a Raid 0 or 1, or would the Pi not be able to handle that?

    Should I try a different form of redundancy? Also, what is the best way to configure the Pi to boot from the SD card? Should I just remove the drive and flash my SD card back to one of the img files I made?

    Thanks for any input, I really appreciate it! You have taught me so much.

    Eric

    • Mel Grubb says:

      I haven’t tried a software-based RAID on the Pi myself, but I’ve heard of folks doing it. A quick google search for “Raspberry Pi RAID” will find you a lot of articles on the subject. The Pi is a bit underpowered for this kind of thing though, especially if you’re running all the other functions on it. I found a two-bay external RAID enclosure and used that.

      You might consider not trying to do a proper RAID, and just synchronizing files across the two drives using rsync instead. You’ll get the safety of redundancy without the overhead of RAID. It won’t be as instantaneous, but if you are okay with the second drive only syncing up every now and then on a schedule, it’ll reduce the load on the Pi the rest of the day.

      My recommendation though, is to look for a USB RAID enclosure, and put your drives in that. It takes the load off the Pi, gets you your safety, and in the event that one of the drives dies, you can replace just the one drive and the system should rebuild itself. Some enclosures may have restrictions on the drives being the same model, so read up on the specs before committing to an enclosure. Mine supposedly doesn’t care if the drives are the same, but you’ll only get a RAID drive as large as the smaller of the two drives. Some day, I want to upgrade to a bigger enclosure that holds more drives, and would let me do more esoteric RAID configurations. Striping isn’t likely to gain me much speed until we get Pis with USB 3, though, so I’m not worried about that just yet.

      • Gary D. says:

        I’ll second that advice, and recommend an inexpensive option that happens to work well.
        D-Link used to make such dual-drive enclosures, but quit updating their firmware years ago. I had one – a DNS321 – and discovered that someone had built alternative firmware for it called ‘Alt-F’. It is basically Linux with software RAID tools and a handy (albeit a little confusing sometimes) web interface. Since it’s RAID in software, It doesn’t care whether the drives match, since it just treats them as an array of blocks. If you mirror drives, the largest possible volume is limited by the size of the smallest one, as you might expect.
        If you can happen upon one of the supported enclosures, Alt-F would be something to try.
        http://sourceforge.net/projects/alt-f

  34. NeoMahler says:

    I’m going to start making a home server, and I’m glad I found this guide, it seems really good. Thanks!

  35. Pingback: 28 | September | 2016 | Delaney Clark

    • Mel Grubb says:

      You say you got it to boot off the hard drive, but it won’t boot at all. Which is it? Did it work once and then stop, or did it never boot at all? Without more to go on, I’d suspect the device or partition UUIDs didn’t get set right. They are different, and have to go in the right place. Also, there’s a reboot there in the middle of the process that’s very important. If you skip that, the changes don’t “stick”. Walk through the steps again very carefully. Don’t skip anything.

  36. Thomas Boje says:

    Hi Mel,
    great solution. It is exactly what I Need and I will spend now the timne over xmas to build up some with a pi3. Wish you and Family a wonderful xmas and a happy new year.
    br
    Thomas

  37. Pingback: raspberry pi plus arduino equals something something – WIL WHEATON dot NET

  38. Pingback: raspberry pi plus arduino equals something something – DigitalNights Media

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s