How to Install Gerbera on Ubuntu 16.04

The Universal Plug and Play (UPnP) is a network protocol designed to allow devices to connect easily and simplify the digital media sharing, communications, and entertainment between your devices on your local network. It exists some Linux tools which can help you to set up a UPnP server at your home. Among these tools, there is a new tool named Gerbera on GitHub. It is a UPnP media server which allows streaming your digital media through your home network. In this article, we will show you how can install and configure it on Ubuntu 16.04.

1) Installation

You can install Gerbera through the ppa maintained by Stephen Czetty

# add-apt-repository ppa:stephenczetty/gerbera && apt-get update
More info: https://launchpad.net/~stephenczetty/+archive/ubuntu/gerbera
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpx3kfjkor/secring.gpg' created
gpg: keyring `/tmp/tmpx3kfjkor/pubring.gpg' created
gpg: requesting key 828C83D0 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpx3kfjkor/trustdb.gpg: trustdb created
gpg: key 828C83D0: public key "Launchpad PPA for Stephen Czetty" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://cm.archive.ubuntu.com/ubuntu xenial InRelease

Now you can install it

# apt install gerbera
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following additional packages will be installed:
 gerbera-common gerbera-daemon libjs-prototype libtag1v5 libtag1v5-vanilla libupnp8

2) Launch

To start gerbera you need to start the service. At the same time, you can enable it to start when you OS starts

# systemctl start gerbera && systemctl enable gerbera
Synchronizing state of gerbera.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable gerbera

Gerbera uses the port number 49152 so make sure the port is unused. You can now launch gerbera

Gerbera can be accessed through your navigator

You have two tabs to navigate through gerbera and your computer:

  • Database: This part shows the files which can be accessed by the public
  • Filesystem: This part helps you to browse your files in order to choose the one to be streamed

3) Add files to stream

Now that you have launched gerbera, you can browse your folders via the Filesystem tab in order to choose the media file to stream

You can check if the file has been added through the Database tab

4) Start streaming

To stream the added files, you just need a compatible upnp application to access the file. In my case, I will launch a upnp application on my phone. By default, the server is named gerbera

When you choose gerbera, you can see the file

When you click on the file, you can start streaming

Now you know how to can stream your video through any compatible device on your network.

5) Troubleshooting

In my case, during the installation, I faced some problems which I could be able to resolve them. I estimated that this part can help you if you face the same problem.

 Unable to start gerbera service

After the installation, check the service. You can have the error below

if the service doesn't start properly, you would need to edit the system daemon file of gerbera with the content below

# vim /lib/systemd/system/gerbera.service
[Unit]
Description=Gerbera Media Server
After=network.target

[Service]
Type=simple
User=gerbera
Group=gerbera
ExecStart=/usr/bin/gerbera -c /etc/gerbera/config.xml
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Then reload

# systemctl daemon-reload

Now you can restart the gerbera service

# systemctl restart gerbera

Now the gerbera service should be able to start properly. If it still doesn't work, you can try to follow this GitHub link of gerbera which shows how to load gerbera as a system daemon

Gerbera's UI is disabled

Another issue that I faced was the gerbera UI which was not able to start. When launching I had the error below in my browser
Gerbera's UI is disabled. If you did not expect this, please check your configuration.

You will need to enable the UI in the /etc/gerbera/config.xml file as below:

# vim /etc/gerbera/config.xml

These two points can help you if you face the same issues.

Alain Francois 10:02 am

About Alain Francois

IT Linux administrator passionate of free and open source software, I work on Linux Systems since some years on installations and deployments of certain solutions. I like to share my experiences with a wider audience by training and conferences.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.