What is a DLNA media server good for?
Currently most routers with USB ports have a DLNA media server, this means that, if we connect an external hard drive or pendrive, we can play multimedia content on any device connected to the local home network. No need to do anything else. However, it is possible that our router is not powerful enough to perform this task, especially since a lot of processors are used to read the movie or series that we are going to play, and, for multimedia content. Depending on the bitrate, this may not be enough. For this reason, it is most common to use an external DLNA server such as Debian on any Linux-based server such as a NAS, Raspberry Pi, or any device.
A DLNA server on a server with a Linux operating system will serve us for:
- This allows our TV to detect the server and reproduce the content (audio, video and photo) that is on the server.
- Other devices such as smartphones, tablets and even our console can detect this and play the contents of the DLNA server via WiFi.
- We can connect other devices such as compatible speakers.
Logically, it is necessary that all devices have compatibility with the DLNA server that we are going to install.
DLNA servers we can use
One of the most widely used DLNA servers is the popular miniDLNA, which is compatible with many operating systems and almost all devices. In our case, this is what has always given us the best results, although there are others like Fuppace that work very well (XigmaNAS integrated into NAS-oriented operating systems). Another widely used DLNA server, for example, is the Plex Media Server, which includes not only Plex but also an integrated DLNA server for TVs that are not compatible with your application.
The main feature of miniDLNA is that it is a DLNA server that consumes very little resources at both the CPU and RAM levels, everything will work really fast, and the CPU load will be the act of reading the multimedia content of the external disk. . This DLNA server can be installed on any Linux regardless of hardware, however logically we need to have something powerful so that there is no problem, and we must take into account its power consumption as it is available for 24 hours will be active. . Other features are that it has a really simple configuration, but a very important detail is that it does not allow audio and/or video transcoding, as such, we must ensure that our TV supports the various video formats that exist. does.
At RedesZone we’ve been using miniDLNA for over 5 years, and in all this time we’ve had no problems playing multimedia content, except for older TVs that don’t support newer video codecs like H.265. , but yes your TV is (relatively) new you shouldn’t have any problems. +
MiniDLNA Installation and Commissioning
The miniDLNA program is so famous that we have it available in the official repositories of major GNU/Linux distributions, therefore, we will get it through the package manager. In this tutorial we have used Debian 10, but you can use any version like Ubuntu, Linux Mint or any other distribution, as they all have exactly the same operation.
The first thing we should do is install miniDLNA with all its dependencies:
sudo apt install minidlna
Once installed, we start the miniDLNA service:
sudo service minidlna start
Automatically, this service will start from the operating system, we don’t need to do anything else, as you can see when we enter:
sudo service minidlna status
Configure MiniDLNA Server
This DLNA server is configured through a single configuration file that we have to edit, therefore, it greatly facilitates its configuration and start-up, as we will not need to edit many, only one. To edit it, we will use any text editor, normally vim or nano is used, in our case, we will use nano.
sudo nano /etc/minidlna.conf
In the configuration file itself we will have all the necessary documents for starting a DLNA server, but in RedesZone we will explain in detail how to configure it, since it comes in English. An important detail is that we have a man page (manual) of miniDLNA media server available, so, we can get more details about the operation.
The first thing we need to learn is to load sources of multimedia content, depending on whether we have video, audio or photographs, the syntax would be the following:
As you can see, if we want to load “A” is audio, P is pictures, and V is video, in this way, it will appear completely categorized on TV. If we want videos and photos to appear, we can also do this, this is ideal for cameras that record video:
Another sentence that we have to configure is where to store the DLNA database, in this case, this is done by uncommenting the following line:
The same happens with the directory of logs or registers when there is some kind of error:
The rest of the configuration options can be left as is:
We have all the sentences already written in the configuration file, but they are commented out, so we should uncomment them so that they become active. Once we have configured it, we save the configuration file and proceed to reboot the DLNA server so that it applies the changes correctly.
sudo service minidlna restart
After doing all this, we can access our TV or smartphone and test the DLNA media server.
Configure Linux Server Firewall
Firewall always works on all Linux operating systems, usually based on iptables, but we have “allow all” by default, so you don’t need to create any additional rules to access DLNA media server Will be If you have configured the iptables firewall in restricted mode with “deny all”, you need to introduce two rules for its correct operation.
iptables -A INPUT -p tcp --dport 8200 -j ACCEPT
iptables -A INPUT -p udp --dport 1900 -j ACCEPT
We assume that you have only one network interface and one subnet, if you want to filter by port or subnet, you have to add this, this rule is to allow local access only to the two ports defined above.
If you want to persist these rules in the firewall, you must execute the following command:
iptables-save > /etc/iptables/rules.v4
Now we can check if everything is working properly with DLNA client, such as TV, smartphone or tablet.
Check MiniDLNA Server Status
If we access our local IP address from the web or from a computer, and we enter port 8200, we will access the miniDLNA status web interface. Here we will only see the number of media library, audio, video and image files. We will also be able to see the clients currently connected to the DLNA media server along with their IP address, MAC address and number of connections.
In our case, we have placed:
Play the content of our DLNA server
Now that we have everything set up correctly, all we have to do is find the DLNA server on the local network. Depending on which client (device) you use, you will need to use a range of programs:
- TVs: In all TVs, DLNA media server detection is fully automatic, it will appear in the upper or lower part where removable storage devices appear.
- We can use KODI or VLC, which are two best options for all platforms: Windows PC, Linux or MacOS.
- Android: VLC or bubbleupnp are two applications that will allow us to discover the DLNA server in the environment and run it.
- iOS: VLC
In all these programs, we should go to the “Network” section and look for the option like UPnP or DLNA, and our newly configured DLNA server will appear automatically, if it is not visible on any device, then We recommend that you check out iptables. Firewall, and if it is active.
As you have seen, it is really easy to install and configure DLNA server on our NAS or Linux server, all we have to do is install it and configure a text file with not much difficulty.
Freelance twitter maven. Infuriatingly humble coffee aficionado. Amateur gamer. Typical beer fan. Avid music scholar. Alcohol nerd.