How to set up MiniDLNA on a Raspberry Pi

You can use any client that supports the DLNA protocols to transfer media files from your Raspberry Pi. Using MiniDLNA could be a lightweight alternative to running software like Plex on a Raspberry Pi.

MiniDLNA is a server software that implements DLNA / UPnP streaming protocols. This software is also called ReadyMedia.

These protocols will allow the Raspberry Pi to stream media files such as music, photos and videos over the home network.

You can use any client that supports the DLNA protocols to transfer media files from your Raspberry Pi. Examples of a few clients that support DLNA are Kodi and VLC media player.

Using MiniDLNA could be a lightweight alternative to running software like Plex on a Raspberry Pi.

Install MiniDLNA software on Raspberry Pi

In this section, the article will guide you through the process of installing MiniDLNA software on your Raspberry Pi.

The process is relatively simple and only takes a few minutes to complete.

Step 1. Before installing MiniDLNA, you should make sure that your Raspbian installation is completely up to date. You can update both the package list and all installed packages by running the following two commands.

sudo apt update sudo apt upgrade

Depending on how long it's been since you last ran the update, this might take some time.

Step 2. After the update is complete, you can now proceed to install MiniDLNA on your Raspberry Pi.

Since MiniDLNA is available as part of the Raspbian repository, you can install it using the command below in Terminal.

sudo apt install minidlna

After the installation is complete, you can now proceed to configure it for your media folders.

Configure MiniDLNA for media files

Before starting this section, it's a good idea to set up your media somewhere, be it your Raspberry Pi's SD card or an external hard drive.

In this section, the article will guide you how to configure MiniDLNA so that it shares available data in media folders.

Step 1. Start modifying the MiniDLNA configuration file using the following command on the Raspberry Pi.

sudo nano /etc/minidlna.conf

Step 2. In this file, you need to find the following section. This section is where you will add each folder you want to scan for media content.

# * "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)

Step 3. Under this section, you need to add the folders that you want MiniDLNA to get files from. The format for specifying a media folder is as follows.

media_dir=[TYPE],[PATH]

For [TYPE] , 3 different letters are available. Each letter identifies a different media type.

  1. Letter A for audio files
  2. The letter P is used to designate images
  3. Finally, the letter V is used for the folder containing the video

For example, if you have a folder named / mnt / mediaDrive / that contains a folder for music, photos and movies, you can add the following to the configuration file.

media_dir=A,/mnt/mediaDrive/audio media_dir=P,/mnt/mediaDrive/pictures media_dir=V,/mnt/mediaDrive/videos

Step 4. The next thing to configure is the DLNA hostname.

You can change this by finding and changing the following line.

Find:

#friendly_name=

Replaced by:

friendly_name=PiMyLifeUpMiniDLNA

Step 5. You are now finished configuring the MiniDLNA server on your Raspberry Pi.

You can save this file by pressing CTRL + X , followed by Y , then ENTER.

Step 6. After you have made changes to the MiniDLNA software configuration, you will now need to restart its service. You can restart the MiniDLNA service using the following command.

sudo systemctl restart minidlna

If you do not restart the MiniDLNA service, no changes will take effect.

Step 7. At this point, you should be able to see the Raspberry Pi's MiniDLNA server appear on different devices.

Check status of MiniDLNA server

In this section, I will show you how to quickly check the status of the MiniDLNA server through its web interface.

Step 1. To begin this section, you will need to find the local IP address of the Raspberry Pi.

There are different ways to get the local IP address of the Pi, but one of the easiest is to run the following command on the Raspberry Pi.

hostname -I

Step 2. With the Raspberry Pi's IP address, you can access the following in your favorite web browser. Remember to replace [IPADDRESS] with the IP you retrieved in the previous step.

http://[IPADDRESS]:8200

Step 3. When the page loads, you will be greeted by the next page.

This page shows you the number of files available in the media library, as well as a list of all connected clients.

Picture 1 of How to set up MiniDLNA on a Raspberry Pi

At this point, you have successfully set up the MiniDLNA server software on your Raspberry Pi!

Update 02 October 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile