MiniDLNA Media Server on Raspberry Pi

Published: September 28, 2020

What is it and why do I need it?

The DLNA standard provides an easy and convenient way to stream files between devices. Its main advantage is that it works with many types of multimedia devices, including consoles, TVs, tablets and smartphones. That's about as much as you need to know from the technical side. In practice, you can use it to share your holiday photos or videos and watch them together with friends on a TV. To make sharing easier, it is a good idea to set up a server. The advantage is obvious - the files will always be available to any device on the network. We will use Raspberry Pi (ideally with an external drive) and the MiniDLNA package for this.

Installation

The installation is straightforward. First, as always, update the package list.

sudo apt update

Then install the required module.

sudo apt install minidlna

Configuration

Open the configuration file using the command below.

sudo nano /etc/minidlna.conf

Find the following section in this file.

Below it, add the appropriate configuration pointing to the location of the folder or folders containing your media. You can also specify which location contains audio files, which contains images and which contains video files. This affects which files are indexed in each location. Add paths using the following format.

media_dir=[TYP],[ŚCIEŻKA]

For each [TYP] value, use:

  • A for audio files

  • P for images

  • V for video files

The screenshot below shows an example configuration.

It is also worth changing the server name to something more friendly. To do this, find the section

#friendly_name=

and add your own name, for example

friendly_name=CleverMediaServer

The configuration is complete. You can now restart the service.

sudo systemctl restart minidlna

Check the server status

The server status is displayed in a web interface. To access it, you need to know the IP address of your device. If you do not know it, you can check it with the command

hostname -I

Now open the following address in your browser

http://adres_raspberry:8200

You will see a list of all files currently in the library, as well as the number of connected clients and their connection counts. You may notice that the counter increases every time you refresh the page - this means the folders are still being scanned. Likewise, if the counter no longer increases, the scan has finished.

Connecting to the server

How you connect depends on the device. Here are a few examples.

On Windows, just open File Explorer and you should see a new entry in the network section. Click it to browse the files on the server.

To browse files on a TV, the TV must have network access (WiFi or Ethernet; I recommend a cable because of the higher speeds). Usually, you need to press the button on the remote used to select or browse sources. A TV that is properly connected to the network should detect the server automatically.

For Android, I recommend the VLC Media Player app, which you can download from the Google Play Store using this link. Of the several apps I tested, this one was the simplest and most intuitive, and most importantly, it achieved the best transfer speeds. It is also free.

Comments (0)

No comments yet.

Add a comment

Comments are published after moderation. Your e-mail address stays private.

MiniDLNA Media Server on Raspberry Pi | CleverBlog