Streaming Media Server – GNUMP3d

April 13, 2007

The GNU MP3/Media Streamer is a simple application which makes it possible to navigate through your audio an video collection via a browser, and stream playlists across a network. GNUMP3d is a streaming server for MP3s, OGG vorbis files, movies and other media formats.The software supports browsing, searching, and streaming all via your browser with support for MP3, OGG Vorbis, WMA and many other types of audio files.

If you have a large music collection then streaming it across a LAN, or the internet, is a logical thing to do with it. Now we will have a look at gnump3d.

Install Gnump3d in Ubuntu

sudo apt-get install gnump3d

This will install all the required packages for gnump3d

When the software is installed it will have the following options configured
The directory containing all your media, /var/music by default.

The port number the server should listen upon, 8888 by default.

The user the daemon should run as, gnump3d by default.

Now you need to access go to http://youripaddress:8888

To change the theme you wish to use simply click upon the “Preferences” link and you should see the following screen here you can change theme:

The Default Configuration file is located at /etc/gnump3d/gnump3d.conf. Here you can change most common things like the default theme, the security options or the downsampling support.

Change the default directory containing multimedia files for GNUMP3d

By default multimedia files location is /var/music.If you want to change this to /home/music using the following steps

Backup existing config file

sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup

Edit the configfile

gksudo gedit /etc/gnump3d/gnump3d.conf

Search for the following line

root = /var/music

Replace with the following line

root = /home/music

Save and exit file

Restart gnump3d service using the following command

sudo /etc/init.d/gnump3d restart

Change the default port number for GNUMP3d

By Default gnump3d server port will listen port number 8888.If you want to change to 7878 use the following steps

Edit the config file

gksudo gedit /etc/gnump3d/gnump3d.conf

Find this line

port = 8888

Replace with the following line

port = 7878

Save and exit the edited file

Restart gnump3d service using the following command

sudo /etc/init.d/gnump3d restart

Now you can access at http://youripaddress:7878

Restricting the access to the serverBy default the server is open to the world; which means that anybody who can connect to your server can browse or play any of your available music, see your statistics, or perform searches.

If you wish to impose tighter controls you have two options:

  1. Restrict access by the IP Address of the client.
  2. Restrict access via password protection.

IP Address Restriction

Allowing Addresses

This is the simplest method of restricting which visitors can browse and stream your music. Edit the configuration file and include all the IP addresses, or ranges which you’d like to be able to use your via the ‘allowed_clients’ setting.

If you wish to enable everybody to access the server then leave the setting as it is by default ‘allowed_clients = all’ – otherwise follow the examples to limit access, eg:

#  Limit the clients who can connect and use your server by IP address.
## Multiple entries are allowed - simply seperate the values by ';' as# shown in some of the examples below.##  Only people on the same subnet, (class C):# allowed_clients = 192.168.2.x##  Only one machine may connect:# allowed_clients =  Everybody local, and one remote address:# allowed_clients = 192.168.2.x;  Everybody local, and one remote range:# allowed_clients = 192.168.2.x; 194.237.82.x#

Denying Addresses

To complement the ‘allowed_clients’ option there is a matching ‘denied_clients’ setting which allows you to deny particular address.

The deny options take precendence over the allowed options, so in the following example all the IP addresses in the 192.168.2.x range have acesses except, and

allowed_clients =

denied_clients =;

Restrict access via password protection

You may also restrict access to the server by username + password.
This is enabled by default you just need to create a password file inside your music repository.

The password file must be called ‘.password‘ and should contain a list of all the usernames and passwords which are accepted. (Note that this file must be readable to the user which the server is running as).

The password file is assumed to be in the following format:


If the visitor enters a valid username and password they will be able to browse – otherwise they won’t.

Password Protection Evasion

Every few months a user will report a security issue with the server when they realise that if they know the name of an audio file they can download it without being prompted for a password.

This is a deliberate hole. Although that might seem nonsensical its mandated by the way the server works.

If you enable the password protection what you are actually doing is denying random visitors the ability to browse your music archives GUI, including the playlists.

However you’re not protecting against the users who know what directory structure you have – if a remote user knows you have the following file they can download it directly:

Why is that?

It’s because 99% of available MP3 players know nothing of HTTP authentication, which is used to prompt visitors for their password.

If we protected the audio files as well as the GUI files then the client MP3 players would be unable to download the audio tracks and streaming would break for all users.

So, whilst the password protection is useful, and does stop somebody from discovering your archive structure it doesn’t give foolproof protection.

Powered by ScribeFire.