Raspberry Pi as NAS and music player

How to create a multi functional Raspberry Pi for websites, mediaplaying and NAS

Summary

Create a cheap NAS, Music Player Daemon and Web Server with the cheap Raspberry Pi and Debian Wheezy.

Goal

In this tutorial we will install Raspbian (Debian Wheezy) on an SD-Card for the Raspberry Pi B. The result is a working, headless Linux server that can be used as a web server, to play music and store all the family's documents and files in a central place available on other Linux and Windows machines in your network.

Audience

Raspberry Pi owners

Prerequisites

For this tutorial you will need:

  • A Raspberry Pi B
  • A USB adapter to power the Raspberry Pi (micro USB)
  • A powered USB Hub for the 2,5" drive or a powered USB harddisk
  • keyboard, mouse
  • A monitor with an HDMI connector
  • An HDMI cable
  • PC Speakers
  • UTP Network cable
  • Internet connection
  • DHCP Server (normally present in your home (wifi) router)

Required knowledge

You do not need to be overly familiar with installing and using Debian. The tutorial will show you everything. However, some basic knowledge about creating a file system on an SD Card, connecting the hardware and basic troubleshooting connections comes in handy.

But most of all: copy and paste the code segments, relax and enjoy!

 

Required tools

Depending on what hardware you are using as a 'normal' PC you might need:

Windows computer

  • Putty for making SSH connections
  • Notepad++ for making some files

Ubuntu/Linux

  • SSH client installed
  • Text editor like GEdit, VI, Mousepad etc etc.

 

 

Tutorial lessons

This tutorial exists of a number of lessons which must be followed in order to reach the desired effect. Please review each step by clicking on the title

1 - Connecting the hardware

In this lesson we will connect all the hardware.
Now we have a working hardware setup. Next step is to setup your boot device.

2 - Setting up an SD Card

In this step we will create a basic boot system on the SD card.
After this lesson you have created your boot device for the Raspberry Pi version of Debian Jessy: Raspbian.

3 - Booting and following basic install

The first boot will install all software by downloading it from the internet. Then you are ready to start tweaking.
You now have a basic operating system, available through SSH without login for further configuring. Fileshares will be added later.

4 - Create a backup

Now that you have a working SD card with a basic OS that is remotely available, it's time so safeguard all your work.
Now you have a backup of the basic Pi setup. Feel free to make a backup as often as you want by returning to this subject.

5 - Enable SSH

In this lesson we will setup more SSH options.
Now, we can easily login to our Raspberry Pi without ever having to login!

6 - Attach external storage

In this lesson we will attach and mount the external storage
You now have securely mounted the external storage. It is available through a certain directory on your Raspberry Pi.

7 - Add users

In this lesson we will change the way Debian creates users. We will use this to store all userinformation like configuration files and documents on the external storage instead of the (vulnerable) SD-card.
Users are now safely created on the external storage.

8 - Install Samba

Samba will enable your Raspberry Pi to function as a NAS: Network Attached Storage.
Now we have a Raspberry Pi capable of sharing files for all computers in your network.

9 - Configure SAMBA for shared files

In this lesson we will further configure SAMBA and enable users to login to SAMBA Shares
Now users can login and manage all their files in a secure way.

10 - Install Music Player Daemon

In this lesson the Music Player Daemon is installed. This background service will play music from a designated source through the default audio channel (jack or HDMI).
Now we have turned our Raspberry Pi into a remote controlled music player.

Tags