How to set up a DLNA server on a Raspberry Pi

These instructions assume that you already have an external drive mounted on your Raspberry Pi and that it is accessible from the directory /media/USB_Drive. A tutorial describing how to mount an external drive on a Raspberry Pi is available here

Update your repository

cd ~
sudo apt-get update

Install miniDLNA

sudo apt-get install minidlna

Edit the miniDLNA config file

sudo nano /etc/minidlna.conf

Edit the media directory to point to your media files

media_dir = /media/USB_Drive/MediaServer

Remove the hash sign and give your server a friendly name

friendly_name = RaspberryPi

Remove the hash sign so that inotify is set to yes. MiniDLNA will now automatically index new media files as they are added to your media directory

inotify=yes

Save changes and exit the config file

press control x
press y
press return

restart the miniDLNA service

sudo service minidlna restart
sudo service minidlna force-reload

Your media files should now be available to any DLNA client on your network