Gerbera DLNA initial setup

Hello everybody, have you tried to set up the new DLNA option Gerbera?
It is new from 5.0. to have option to use Gerbera instead of miniDLNA.
As I am the one having difficulty with miniDLA I wanted to try it.
Nevertheless the setup is not so simple it seams.
There is just /etc/config/gerbera file with almost empty configuration.
Have any of you tried to generate config.xml file which is necessary for proper operation?
How can it be done and what would be a setup?

  1. start the service (service gerbera start) to create the configuration file (/etc/config/gerbera)

  2. edit /etc/config/gerbera and change enabled from 0 to 1:

    config gerbera config
    option enabled ‘1’
    option debug ‘0’
    option user ‘gerbera’
    option group ‘gerbera’
    option home ‘/tmp/gerbera’

  3. start the service (again) service gerbera start

  4. get the URL of the UI from /tmp/gerbera/gerbera.html; open in browser

  5. In the UI, use the File System button show the directory tree, navigate to the folder that contains the content that you want, then click Add Item. Repeat if you have multiple folders

  6. Select the Database button, then use the folder structure to view what you added.

I’m sure there are improvements to this, but I haven’t read all of the documentation yet.

What I don’t understand is how to persist the changes that are made to /tmp/gerbera/config.xml and /tmp/gerbera/gerbera.db between reboots. When I reboot, I need to run service start gerbera to create the configuration and database. There must be a better way.

Maybe @neheb knows something about that.

The way I made it disabled by default I wanted people to edit the home directory to persistent storage. /tmp is fairly useless since changes die after a reboot. Maybe I should be explicit about that in the Gerbera start message.

Unlike miniDLNA which uses simple ini style files, Gerbera uses an XML file for configuration which makes it difficult to generate and modify it. That’s why there’s no better UCI config.

1 Like
  1. Stop and disable miniDLNA service

  2. Install gerbera package either over command line or LuCI System->Software search for gerbera and Install it

  3. gerbera will not start

root@turris:~# service gerbera start
Gerbera not enabled. Please enable in /etc/config/gerbera

  1. Enable gerbara:

root@turris:~# vi /etc/config/gerbera
option enabled ‘1’

  1. Also worth to set persitent storage (if you have USB,SSD or HDD attached)
    option home ‘/srv/gerbera’

  2. Start gerbera again will generate gerbera config.xml at directory defined in 4.

root@turris:~# service gerbera start
Created default gerbera config at /srv/gerbera/config.xml
Please edit to your liking and restart

  1. It is worth to have second ssh terminal with:

tail -f /var/log/messages

  1. Start gerbera once more time:

service gerbera start

  1. You will see in /var/log/messages following:

INFO: Gerbera UPnP Server version 1.4.0 -
INFO: ====================================================================
INFO: Gerbera is free software, covered by the GNU General Public License version 2
INFO: Copyright 2016-2019 Gerbera Contributors.
INFO: Gerbera is based on MediaTomb: Copyright 2005-2010 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.
INFO: ====================================================================
INFO: Loading configuration from: /srv/gerbera/config.xml
INFO: Checking configuration…
INFO: Setting filesystem import charset to UTF-8
INFO: Setting metadata import charset to UTF-8
INFO: Setting playlist charset to UTF-8
INFO: Configuration check succeeded.
WARNING: Sqlite3 database seems to be corrupt or doesn’t exist yet.
INFO: no sqlite3 backup is available or backup is corrupt. automatically creating database…
INFO: database created successfully.
INFO: About to migrate metadata from mt_cds_object to mt_metadata
INFO: No data will be removed from mt_cds_object
INFO: Migrated metadata - object count: 0
INFO: Initialized port: 49152
INFO: Server bound to:
INFO: The Web UI can be reached by following this link:

  1. Web interface listen on port 49152 as found in step 8

  1. Bind gerbera to correct IP address (interface). In my case, gerbera bind to which is actually WAN interface for my VDSL PPPoE connection little bit tweaked to allow direct connection to VDSL web UI. Nevertheles my local LAN sits on

vi /etc//srv/gerbera/config.xml

and add into <server> ... </server> section <ip> a.b.c.d </ip> configuration:

<import hidden-files="no">

and than you need to restart service to have corect IP:

service gerbera restart

  1. Make it bootable:

root@turris:~# service gerbera enable

So, hopefully this will work…

I don’t remember how TurrisOS does it, but the device needs to be mounted before Gerbera starts.

I remember having this issue with transmission where it would starts before mdadm/mounting of filesystem.

Note that although you add files through the web interface, the configuration file needs to be edited manually for actual customization.

What about using jinja2 for generating the XML from a template?

Note that although you add files through the web interface, the configuration file needs to be edited manually for actual customization.

Once DB created, it is in database. Thus it is not in config.xml. What you likely pointg out is automatical file update when new files appears?

Eh no. I mean configuration stuff like setting up custom clients and whatnot. See:

Sounds excessive from a size standpoint. Then again, size is not a concern here.

I also have no experience with Jinja2.