Multimedia Server with Raspberry Pi

Tired of switch on the notebook every time I need to download something, watch telefilms or listen music, today I made a black box using a RaspberryPi to make these things.

2013-09-16 22.19.50

The box provides these services:

  • SSH network filesystem
  • Realtime Media streaming
  • Music player with web interface
  • Torrent daemon with web interface


The hardware setup consists in a RaspberryPi A-Model connected with an usb-hub which connects to an ethernet adapter and a external hard drive.


I chose archlinux as linux distro for the server. Download the latest archlinux raspberry release and write to an SD with dd:

dd if=archlinux-hf-2013-07-22.img of=/dev/mmcblk0 bs=1M

Find your raspberry address with nmap:

nmap -sV –open -p22

Login with ssh:

ssh root@192.168.1.x (the default password should be root)

Update the system with pacman -Suy (it takes several minutes), set the root password and reboot.

External Hard Drive

Now we configure the external hard drive. First of all, we write mounting rules on /etc/fstab. For me that I’ve an external drive with two partition, I wrote:

/dev/sda1               /mnt/backups        ext4            defaults,auto,user     0 0
/dev/sda2               /mnt/media        ntfs            defaults,auto,user     0 0

Now you can use this hard drive as an external drive for all PCs in your LAN, you only need to configure it in the clients. For example, you can use sshfs-fuse to automatically mount this drive in your linux box using this /etc/fstab rule:

sshfs#root@rpi_ip:/ /mnt/rpi fuse defaults,auto,user,idmap=user 0 0

Torrent daemon

Another useful thing to do with the raspberry, is to set it as a “Torrent daemon” to handle your downlaods, and control them with a web interface. I chose Transmission as daemon; let’s install it with:

pacman -S transmission-cli

Then enable the daemon:

systemctl enable transmission

You may want to personalize the daemon settings, therefore you should edit /var/lib/transmission/transmission-daemon/.config/settings.json (while the daemon is stopped). Then start it:

systemctl start transmission

The web interface is available by default at http://rpi_ip:9091.

Music station

The Raspberry Pi provide an analog audio output; then why don’t use it? Maybe isn’t cool controlling the playlist easily lying on the sofa? I don’t think so. The steps are easy, first install alsa stuff and your prefered music player (I choose cmus, that implements also remote control):
pacman -S alsa-utils alsa-firmware alsa-lib alsa-plugins cmus libmad

Then enable cmus daemon:

cmus –listen

If you want this daemon started at boot time, you should put this bashline on autostart file. If you decided to use cmus, I advise cmus-droid-remote, that allows you to control your cmus instance. You can also install cmus-app to add a web interface.

Realtime Media streaming

The last thing I done is install a realtime media streamer with a remote control interface; I choose  jinzora. Install it following this article.

Final trick

At the end, I wrote a shell script to stop transmission and umount external filesystem before reboot the cpu:

echo Stopping transmission…
sleep 1
systemctl stop transmission

echo Umounting external hd…
sleep 2
umount /mnt/backup
umount /mnt/media

echo Reboot.
sleep 2


Leave a Reply

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

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

Facebook photo

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

Connecting to %s

%d bloggers like this: