Making technology work for you...

Get Your Free Subscription By Email:

Installing and Configuring MiniDLNA Server On Raspberry Pi

We have already setupped the Raspberry Pi to download files from internet and share them wirelessly over network acting as an NAS. Now it's time to further enhance this functionality to share multimedia content (audio/video/images) using DLNA protocol so our Raspberry Pi can act as an self contained multimedia downloader and server.

Enabling DLNA allows compatible networked device like TV's, cellphones, music systems and computers to enable seamless sharing and playback of digital media between devices. DLNA uses Universal Plug and Play (UPnP) for media management, discovery and control. Follow the instructions ahead to install and configure popular Linux DLNA server utility MiniDLNA on Raspberry Pi running Raspbian.

DLNA server detected by Sony Bravia

Steps to install and configure MiniDLNA on Raspberry Pi :

  1. Install MiniDLNA via aptitude package manager.
  2. sudo apt-get install minidlna
  3. Now, configure as per you needs by editing the configuration file located at - /etc/minidlna.conf. Make sure to change the IP address and your media folder location from the settings below.
  4. # This is the configuration file for the MiniDLNA daemon, a DLNA/UPnP-AV media
    # server.
    # Unless otherwise noted, the commented out options show their default value.
    # On Debian, you can also refer to the minidlna.conf(5) man page for
    # documentation about this file.

    # Path to the directory you want scanned for media files.
    # This option can be specified more than once if you want multiple directories
    # scanned.
    # If you want to restrict a media_dir to a specific content type, you can
    # prepend the directory name with a letter representing the type (A, P or V),
    # followed by a comma, as so:
    # * "A" for audio (eg. media_dir=A,/var/lib/minidlna/music)
    # * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
    # * "V" for video (eg. media_dir=V,/var/lib/minidlna/videos)
    # WARNING: After changing this option, you need to rebuild the database. Either
    # run minidlna with the '-R' option, or delete the 'files.db' file
    # from the db_dir directory (see below).
    # On Debian, you can run, as root, 'service minidlna force-reload' instead.

    # Path to the directory that should hold the database and album art cache.

    # Path to the directory that should hold the log file.

    # Minimum level of importance of messages to be logged.
    # Must be one of "off", "fatal", "error", "warn", "info" or "debug".
    # "off" turns of logging entirely, "fatal" is the highest level of importance
    # and "debug" the lowest.

    # Use a different container as the root of the directory tree presented to
    # clients. The possible values are:
    # * "." - standard container
    # * "B" - "Browse Directory"
    # * "M" - "Music"
    # * "P" - "Pictures"
    # * "V" - "Video"
    # if you specify "B" and client device is audio-only then "Music/Folders" will be used as r oot

    # Network interface(s) to bind to (e.g. eth0), comma delimited.

    # IPv4 address to listen on (e.g.
    # SET TO YOUR PI IP !!!!!!!!!!!

    # Port number for HTTP traffic (descriptions, SOAP, media transfer).

    # URL presented to clients.
    # The default is the IP address of the server on port 80.

    # Name that the DLNA server presents to clients.

    # Serial number the server reports to clients.

    # Model name the server reports to clients.
    model_name=Windows Media Connect compatible (MiniDLNA)

    # Model number the server reports to clients.

    # Automatic discovery of new files in the media_dir directory.

    # List of file names to look for when searching for album art. Names should be
    # delimited with a forward slash ("/").
    album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albuma rt.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

    # Strictly adhere to DLNA standards.
    # This allows server-side downscaling of very large JPEG images, which may
    # decrease JPEG serving performance on (at least) Sony DLNA products.

    # Support for streaming .jpg and .mp3 files to a TiVo supporting HMO.

    # Notify interval, in seconds.

    # Path to the MiniSSDPd socket, for MiniSSDPd support.

  5. Configure MiniDLNA to launch at boot and start the service.
  6. sudo update-rc.d minidlna defaults
    sudo service minidlna start
  7. To force MiniDLNA to scan the configured directories use the following command.
  8. sudo service minidlna force-reload
  9. TIP # 1 : Edit crontab (sudo crontab -e) and add the following line to make MiniDLNA update its file database at 4am every morning :
    0 4 * * * sudo service minidlna force-reload
  10. TIP # 2 : Append max_user_watches=50000 to /etc/sysctl.conf to make iNotify work correctly.


Muchas gracias por el artículo hermano! Siempre me es de mucha utilidad.

Pregunta, ¿para que es y como debe configurarse Inotify?

Muchas gracias de nuevo.

Add new comment

This is just one of the many helpful tips we have posted, You can find more stories here,
Do subscribe to updates using your favorite RSS feed reader or using the secure FeedBurner email update form on top of this post.