🔥 Holiday Sale! 25% Off Platinum Membership and up to 50% Off on Deployarr (ends December 31).

Install MiniDLNA on Ubuntu

There is an updated post describing installation of MiniDLNA on Ubuntu Server (12.04 LTS Precise Pangolin).


DLNA allows you to play home network media on all compatible devices over the network. A DLNA server is a streaming video server that can stream content to other networked media players. MiniDLNA is a media server for Ubuntu and other Linux operating systems. In this post, I will discuss how to install MiniDLNA on Ubuntu server.

I recently purchased the LG 42" LED TVand LG Bluray Player, basically to stream movies from my Ubuntu Lucid Lynx 10.04 Home Server.

I found that I could not manually connect to SAMBA shares on my Linux server and was figuring out other ways to stream media to my TV/Player (Update: I can now connect to my SAMBA shares. Please see end of the post). It could have been a one big investment gone bad if I were not able to play media from my server. Thankfully, I found some options: tvmobili and minidlna. I even considered Amahi Home Server which allowed one click installation of media servers such as UShare and MiniDLNA.

Find a list of best rated dlna servers here.

Upon reading more I decided to try MiniDLNA and Ubuntu and I am glad I did. Setting up MiniDLNA DLNA server on my Ubuntu Server was extremely easy. So here is how it goes:

Download and Install MiniDLNA

Download MiniDLNA from here: http://sourceforge.net/projects/minidlna/files/

Extract the files:

tar -zxvf filename.tar.gz

This results in two files: /usr/sbin/minidlna and /etc/minidlna.conf. CD to the respective directories and move the files as follows:

sudo mv minidlna /usr/sbin/
sudo mv minidlna.conf /etc/minidlna.conf

Configure MiniDLNA

Configure /etc/minidlna.conf file. Below is my minidlna.conf file:

# port for HTTP (descriptions, SOAP, media transfer) traffic. 
port=8200

# network interface to bind to (this is the only interface that will serve files). You could comment the following line to enable all interfaces.
network_interface=eth0

# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
#   can prepend the type, followed by a comma, to the directory:
#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
media_dir=A,/home/myusername/media/music
media_dir=P,/home/myusername/media/photos
media_dir=V,/home/myusername/media/videos

# set this if you want to customize the name that shows up on your clients
friendly_name=My-MiniDLNA

# this should be a list of file names to check for when searching for album art
# note: names should be delimited with a forward slash ("/")
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=no

# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO. I don't use TiVo. so I disabled it.
enable_tivo=no

# default presentation url is http address on port 80
#presentation_url=http://www.mylan/index.php

# notify interval in seconds. default is 895 seconds. This I believe is the rate at which the folder cache is refreshed. I set it to scan every 5 min.
notify_interval=300

# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1

Make sure to allow incoming connection on port 8200 on the server.

Start MiniDLNA using the following command:

/usr/sbin/minidlna -f /etc/minidlna.conf

Upon starting MiniDLNA builds the index of all the files. I have noticed that this demands a lot of CPU for a few minutes. But it will calm down soon.

Now go to "My Media" on the LG TV or Bluray player or whatever it is called on your DLNA client device and you should see "My-MiniDLNA" server or the name you used.

Find some of the best rated dlna compatible Bluray players here.

I was able to browse through folders and play AVI, JPG, and MP3 files without any problems. If you would like to start the MiniDLNA server automatically when Ubuntu Server boots then create the following file in /etc/init.d:

sudo vi myminidlna

and enter the following content.

#!/bin/sh
# Mini DLNA

case "$1" in
'start')
        /usr/sbin/minidlna -f /etc/minidlna.conf
        ;;
'stop')
        ;;
*)
        echo "Usage: $0 { start | stop }"
        ;;
esac
exit 0

Save it and restart your server. Immediately after booting the MiniDLNA server starts indexing the files so expect your CPU run high. As soon as it is done you should see all your files on your DLNA client. Note that DLNA does not recognize subtitle files (example: .srt). There you go, the easy tutorial to setup dlna server. Enjoy!

Updates:

  • Today I got the player to recognize my SMB Share on my Linux Server. The player plays videos (with subtitles), music, and pictures from my SAMBA server. In a separate post I have provided instructions on how to configure SMB / CIFS on LG bluray player.
Be the 1 in 200,000. Help us sustain what we do.
125 / 150 by Dec 31, 2024
You will gain benefits such as Deployarr access, discord roles, exclusive content, ad-free browsing, and more.
🔥 Holiday Sale! 25% Off Platinum Membership $399.99 $299.99 (ends December 31).
Join the Geek Army (starting from just $1.67/month)

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.

Holiday Sale