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 that 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) Install Gerbera on Ubuntu
You can install Gerbera through the ppa maintained by Stephen Czetty
$ sudo add-apt-repository ppa:stephenczetty/gerbera-updates $ sudo apt-get update
Now you can install gerbera
$ sudo apt install gerbera
2) Launch Gerbera
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.
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
$ sudo 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
$ sudo systemctl daemon-reload
Now you can restart the gerbera service
$ sudo 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:
$ sudo vim /etc/gerbera/config.xml
These two points can help you if you face the same issues.