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.
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.
Download the Raspian image from their website and install the image into SD card.
Connect monitor, mouse, and keyboard before booting the Raspberry Pi. The monitor has to be turned ON before booting the Raspberry Pi.
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
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======
A local user is created.
>> sudo adduser YOURUSERIDHERE
>> sudo usermod -a -G users YOURUSERIDHERE
>> sudo usermod -a -G sudo YOURUSERIDHERE
Update the system.
>> sudo apt-get update; sudo apt-get upgrade
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.
USB storage is connected to Raspberry Pi. Restart the system by giving back the power. The green LED glows when the system starts.
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.
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
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.
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.
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.