Basic Raspberry Pi is a small computer which consists of ARM 11 processor with 512 MB RAM which is running at a frequency of 700 MHz. It can be turned into a home server by adding some hardware and doing some configurations. This can be used to study about web design and server administration. The main highlight of Raspberry Pi is it requires very less space and power than a normal PC.  Now a day’s, everyone works with multiple devices such as desktops, laptops, tablets, smartphones etc. The data’s stored in these devices are commonly transferred via USB drives whenever required. Now the scenario is changing, people are using cloud services to store information because of its unique feature. That is the data can be accessed from anywhere and from any device. But some personal data’s like movies, photos, songs etc. are not required to be stored in clouds. Taking that into point here we are suggesting a simple home server which helps these data’s to be stored and shown directly in any devices. It is a simple project for all Raspberry Pi lovers.

Benefits of Raspberry Pi

  • Low cost: - Raspberry Pi is very cheap compared to other, approximately $35.
  • Energy efficient: - Raspberry Pi has components that use low power. The server is expensive due to hardware costs.  Raspberry Pi is energy efficient. The Pi uses about 5 to 7 Watts of electricity.
  • Low noise: - It does not have moving parts and fans. The Pi has SD card for storage. It is fast and does not have moving parts.  It is completely silent.
  • Small form factor: - Pi with case can hold in hand. Pi can integrated inside devices.
  • Status lights: - The Pi motherboard has several statuses light. It shows the power status, disk I/O etc.
  • Expansion capabilities: - So many devices available for Pi at affordable price. Pi has two USB ports. More devices can added with this USB ports.

Components required

  • Raspberry Pi
  • Medium size SD flash card
  • USB thumb drive
  • Hard drive

The SD flash card is used for local storage. Select the fastest one for this application. A large drive is used whenever we opt for backups and multimedia files.

Installing Operating System

Step 1:-

Download the Raspian image from their website and install the image into SD card.

Step 2:-

Connect monitor, mouse, and keyboard before booting the Raspberry Pi. The monitor has to be turned ON before booting the Raspberry Pi.

Step 3:-

For the first boot, a Raspberry Pi configuration screen will pop up. Follow the instructions and may set it like this as given below.  The OS image is resized. To make it more secure, it is possible to change the password. A custom name can be given to the local network. After all these steps, click finish.  

After configuration, the pi@raspberrypi prompt will be shown. At any time, it can be configured using the following command. To run raspbian configuration via ssh this command is used.

sudo raspi-config

To make an IP address, modify the code to set up the home server.

>> sudo nano -w /etc/network/interfaces

Step 4:-

The eth0 line iface eth0 inet dhcp is changed into following commands.

======/etc/network/interfaces======

...

iface eth0 inet static

address 192.168.1.10

netmask 255.255.255.0

gateway 192.168.1.1

...

======/etc/network/interfaces======

Step 5:-

A local user is created.

>> sudo adduser YOURUSERIDHERE

>> sudo usermod -a -G users YOURUSERIDHERE

>> sudo usermod -a -G sudo YOURUSERIDHERE


Step 6:-

Update the system. 

>> sudo apt-get update; sudo apt-get upgrade


Upgrade the system to make the operating system more secure.

Step 7:-

Raspberry Pi is shutdown using following commands.

>> sudo /sbin/shutdown -h now

Check the green LED on Raspberry Pi circuit board monitor to know whether the system is shut down or not. After the system shut down, disconnect the attached devices such as keyboard, monitor etc.  from the Raspberry Pi.

Step 8:-

USB storage is connected to Raspberry Pi. Restart the system by giving back the power.  The green LED glows when the system starts.

Step 9:-

When the Raspberry Pi starts, then ssh into Raspberry Pi using other systems which is in the network. The entire configuration can be finished remotely. SSH is a network protocol used to exchange the data between two computers through secure channel.

>> ssh YOURUSERIDHERE@192.168.1.10 

Now the Raspberry Pi starts working.

Connecting Peripherals

To connect an external storage device, automounter is used. It is more flexible to handling devices.

>> sudo apt-get install autofs

>> sudo nano -w /etc/auto.master 

======/etc/auto.master======

...

/misc /etc/auto.misc

...

======/etc/auto.master======

>> sudo nano -w /etc/auto.misc

Backup

Providing backup is a feature of home server. It is very simple in Raspberry Pi due to the wide range of network sharing options in Linux. A backup directory is exported onto the Raspberry Pi external USB storage device using Samba.

Step 10:-

Configuring Samba is a simple process.  Install Samba and common-bin library. 

>> sudo apt-get install samba samba-common-bin

To access the local ID use smbpsswd.

>> sudo smbpasswd -a YOURUSERIDHERE

Edit Samba configuration file

>> sudo nano -w /etc/samba/smb.conf

Add windows backup path.

Step 11:-

Restart Samba to implement edits.

>> sudo /etc/init.d/samba restart

After these steps, it is possible to access any files which are stored on the storage drive from any devices that is connected in same local network.

Related Items