Ubuntu Server 14.04 (Trusty Tahr) – Quick MediaDrop Installation


MediaDrop is a open source online video platform for managing and delivering video, audio and podcasts.


Sadly I found the official documentation to be lacking and had to cross reference it with other install guides to even get a basic setup running.

This guide will take you through a basic installation of MediaDrop that utilizes the built in Paste Server provided by Python. If you prefer a more permanent solution you can setup an Apache 2 or Nginx web server yourself. For the time being I am happy enough to just have MediaDrop running – having experienced a couple of bugs I do not want to mess with my working configuration any further right now.

My working environment is a minimal installation of Ubuntu 14.04 Server on VMware vSphere 5.x.

Let’s begin our installation – first we will elevate ourselves to the root user and then install MySQL, System libraries, development headers, python libraries and tools:

sudo -i

apt-get install mysql-server mysql-client libjpeg-dev zlib1g-dev libfreetype6-dev libmysqlclient-dev python-dev python-setuptools python-virtualenv git

When prompted enter a password for the MySQL root user.

Setup Python virtual environment:

cd /

virtualenv --no-site-packages venv

Activate the virtual environment:

source venv/bin/activate

Install MediaDrop from Git:

git clone git://github.com/mediadrop/mediadrop.git mediadrop-git

Download and install all the necessary dependencies for MediaDrop into your virtual environment:

cd mediadrop-git

python setup.py develop

Generate the deployment.ini file:

paster make-config MediaDrop deployment.ini

We will now bring up a mysql> prompt to administer the MySQL database:

mysql -u root -p

Enter your MySQL password when prompted.

Create the MySQL database mediadrop_db and the MySQL user mediadrop_user and a password for mediadrop_user:

mysql> create database mediadrop_db;
mysql> grant usage on mediadrop_db.* to mediadrop_user@localhost identified by 'mysecretpassword';
mysql> grant all privileges on mediadrop_db.* to mediadrop_user@localhost;
mysql> exit;

Note: Change ‘mysecretpassword‘ to the password you want for mediadrop_user.

Edit the delpoyment.ini file:

nano deployment.ini

Under the [app:main] heading, look for the sqlalchemy.url setting:

sqlalchemy.url = mysql://username:pass@localhost/dbname?charset=utf8&use_unicode=0

Change the username, pass, and dbname entities to mediadrop_user, password and mediadrop_db:

Note: password here refers to the password that you designated earlier for mediadrop_user.

sqlalchemy.url = mysql://mediadrop_user:mysecretpassword@localhost/mediadrop_db?charset=utf8&use_unicode=0

Setup the built in server:

paster setup-app deployment.ini

Enable simple full text searching:

mysql -u root mediadrop_db < setup_triggers.sql -p

Enter your MySQL password when prompted.

Now that MediaDrop itself is installed and the basics are configured, we can test it out using the Paste server:

paster serve --reload deployment.ini

Open a browser and enter the ip address for your server using port 8080. For example – http://server-ip:8080

To access the admin dashboard you need to append /admin to the above url. The default administrative username is admin, and the password is also admin. Remember to change your password!

If you restart your server you will need to activate the virtual environment again and run the Paste server again. A basic script to handle this looks like this:

cd /
source venv/bin/activate
cd mediadrop-git
paster serve --reload deployment.ini

Save this as something like mediadrop-start.sh and then make it executable:

chmod +x mediadrop-start.sh

Run the script as follows:

sudo ./mediadrop-start.sh

As a closing note I did encounter issues accessing the admin panel after changing the admin password when using Firefox. I could access the admin panel using Internet Explorer though.




48 thoughts on “Ubuntu Server 14.04 (Trusty Tahr) – Quick MediaDrop Installation

  1. Nice guide! Thank you!

    One thing I might recommend would be to checkout a branch/rev in case the master/HEAD breaks. That being said I had to user master/HEAD to get it to work.

    1. I tried specifying a production release but I could not get it to work – so in the end I had to settle for what I could get!

      Thanks for your comment!

    1. Yes, I have mediadrop-git and venv in my root directory. I was working through multiple guide to try and find something that worked. You can change the directories if you like. 🙂

  2. Hi Mike, got through your extremely helpful walk through here and have media drop up and running! Outstanding since I have very little nix background and less python.
    I think I did something wrong somewhere though because all uploads fail. Could you possibly be able to give me a lead?

    Thanks for the great walkthrough!

    1. I would check that this section was done right:

      mysql> create database mediadrop_db;
      mysql> grant usage on mediadrop_db.* to mediadrop_user@localhost identified by ‘mysecretpassword’;
      mysql> grant all privileges on mediadrop_db.* to mediadrop_user@localhost;
      mysql> exit;

      and this:

      sqlalchemy.url = mysql://mediadrop_user:mysecretpassword@localhost/mediadrop_db?charset=utf8&use_unicode=0

      I had a look online but I didn’t see a whole lot about uploads not working for MediaDrop.

    1. Hi Mary, I just went did a clean Ubuntu install and then installed MediaDrop. I uploaded a video just fine – I had to log in as an admin to approve the upload before I could see it on the main site.

      I’m not sure why you are having a problem?

  3. Hi Mike,

    I have been following your tutorials precisely, running a clean Ubuntu 14 LTS vm install using VMware 11 Workstation on a Windows machine. After following every step of your tut exactly, (and after three attempts), I still fail at the step where the built-in server is being set up;

    paster setup-app deployment.ini

    The error after this command is;

    ImportError: No module named aniso8601

    After spending several days researching, I cannot find anything about this. Would you happen to know any pointers or be able to help me out? Thank you very much.

    1. Hi Chris,

      I had a look for this error too and have not been able to find anything yet. I would suggest posting on the MediaDrop forum for assistance.

      1. That fix works really great…
        I am working on a production setup where I have 8 servers.
        2 Haproxy and load balance servers
        3 web servers running mediacore and nginx.
        3 database servers running with percona xtraDB cluster.
        Everything is working great with Haproxy balancing traffic between server (both web and database servers).
        But one thing I quite don’t understand is how to fix mediacore error 2038 when uploading files…
        I read and through all forums and can’t find a working solution…
        I tried to change the data folder ownership and increase and decrease the upload file size in mediacore settings, nothing works..
        Have you faced the same issue and how did you fix it ?

  4. Thanks for the link…. it is a weird issue with mediacore..
    But I figured out how to fix it by just playing with the upload settings.
    The default limit is 300MB.
    First of all I increased that limit to 1500MB… And then I tried to upload a 800MB file a couple of times. Of course it did not work.
    So I changed the upload settings back again to 300MB and curiously no more issues and error with uploading files between the size of 1MB to 299MB…
    Ask me how is it possible, I won’t be able to explain it Mike…
    Maybe mediacore needs a jump start before working properly…

    1. Thanks for the help with MediaDrop. I was wondering how you increased the default upload limit to > 300MB. I want to upload videos that are > 300MB, and not sure how to do that. It sounds like you changed the upload settings to 1500MB and then reverted back to 300MB to get it to work. This leads me to wonder, is it even possible to increase the default upload limit? On the MediaDrop forum about this very topic, they say that it is important to know the matter in which MediaDrop is being deployed, but no mention of how that is important;


      Any thoughts would be greatly appreciated!

      1. I have production servers running after reading Micheal post about Mediadrop quick installation.

        So I went to the following link, (section that talks about using nginx with mediadrop.


        and I

        Edit /etc/nginx/sites-available/default

        there is a section where you have to setup the upload limit “ client_max_body_size 300M;”
        here is a sample of that file

        # Configure our MediaCore App for NGINX+UWSGI
        server {
            # Define server parameters:
            # Listen on port 80 for requests to mydomain.com
            # log to /path/to/nginx/logs/mydomain.access.log using the main log format.
            listen       80;
            server_name  telemele.tv;
            access_log /var/log/mediacore.access.log;
            # Important: This setting will define maximum upload size, so make
            # sure it is sane for your purposes! For example, if you have a
            # 300MB upload limit in MediaCore, people will say “Yay! I can upload
            # my 300MB video!” However, if this setting is set to 10MB, then no
            # one will be able to upload videos over 10MB and people will not
            # like you very much.
            client_max_body_size 300M;
            # Define NGINX Static File Paths
            # First, define our default document root for static file serving.

        As you can see, you can put whatever value that your server can support or file server can cope with..

        These settings must match your settings in from your admin interface…
        To get there, go to ADMIN—SETTINGS
        In settings you will see a list of options such as
        – API
        – Upload ( way way at the end), click on it and there you can increase and decrease the upload size…
        But you don’t need to be running in production mode with Nginx or Apache to play with the upload limit…
        Like I mentioned before, it may work or may not…. It happened that it worked for me….
        But I still believe there must be a more technical explanation about that error 2038 when uploading large files…
        I read all forums, I tried all suggestions but nothing really worked… mystery….

  5. Thanks so much Chris. I have another question for you since you have been so helpful to me. Were you able to deploy MediaDrop on your production server following this tutorial exactly, or did you make some changes and follow your own tutorial?

    It is my understanding that in order to deploy on a prod server, the installation files (mediadrop-git and venv) must be accessible by the web server. This tutorial is great for using the Paster server and running locally, (which I was able to do successfully), but now when I try to deploy using a production server, I am unable to do so, and was thinking it may be related to the installation occurring in the root directory. What worked for you?

    Thanks for all the guidance, fellow MediaDrop users.

  6. I used the the tutorial provided by Michael to start with…. It is a great tutorial that will have you mediadrop up and running in less than an hour..
    Please read the forum, you will have great inputs from other members about some error or problems you may face while installing mediadrop.

    For my production deployment, I used the two sources provided at the end of Michael’s tutorial, nginx deployment section in particular..
    You will see some small differences. For example one tutorial will install mediadrop in cd / ….
    and another one will do it in cd /opt/… .
    This is up to you…
    You will also notice that the official install tutorial from mediadrop.net requests to generate the deployment.ini outside of the mediadrop-git directory for example… But again, it is one way of doing things and I think you can leave everything in one directory like explained in Michael tutorial..

    In production you need a few things:
    1- provide your mediadrop location when you will configure the following file

    2- chown -R www-data:www-data /mediadrop-git/data

    3- change mediadrop port from 8080 to 80.

    The remaining part of my production system is made of a bunch of different configuration where I use the following technologies:
    1- Percona cluster
    2- syncthing
    3- Haproxy
    You don’t need to go this way with more than 3 web servers like I did…
    I think one server with a good resources can still do a descent job…

  7. I had it all working on Unbuntu 12.04, but after upgrading to 14.04 I just cannot get Mediadrop to deploy on apache with mod_wsgi.
    Any ideas?

  8. Currently this part of this tutorial does not work, because of a missing dependency during the build.

    python setup.py develop fails with error:

    Searching for aniso8601==1.0.0

    Note: Bypassing https://pypi.python.org/simple/aniso8601/ (disallowed host; see http://bit.ly/1dg9ijs for details).

    Couldn’t find index page for ‘aniso8601’ (maybe misspelled?)
    Scanning index of all packages (this may take a while)

    Note: Bypassing https://pypi.python.org/simple/ (disallowed host; see http://bit.ly/1dg9ijs for details).

    No local packages or download links found for aniso8601==1.0.0
    error: Could not find suitable distribution for Requirement.parse(‘aniso8601==1.0.0’)

    You have to add ,*.python.org to the end of the line: allow_hosts = static.mediadrop.net to allow some of the dependencies to be downloaded.

  9. Adding ,*.python.org allowed me to progress to the paster setup-app deployment.ini step, but pastescript wasn’t installed which is corrected by

    apt-get install python-pastescript

    After this, the command setup-app deployment.ini yields the error:

    Traceback (most recent call last):
    File “/usr/bin/paster”, line 4, in
    File “/usr/lib/python2.7/dist-packages/paste/script/command.py”, line 93, in run
    commands = get_commands()
    File “/usr/lib/python2.7/dist-packages/paste/script/command.py”, line 135, in get_commands
    plugins = pluginlib.resolve_plugins(plugins)
    File “/usr/lib/python2.7/dist-packages/paste/script/pluginlib.py”, line 82, in resolve_plugins
    File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 725, in require
    needed = self.resolve(parse_requirements(requirements))
    File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 628, in resolve
    raise DistributionNotFound(req)
    pkg_resources.DistributionNotFound: aniso8601==1.0.0: Not Found for: MediaDrop (did you run python setup.py develop?)

    pip install aniso8601 doesn’t help here… also, I can see that the previous step’s command line output says aniso8601 was successfully installed.

    These guys have done a shit job of packaging this for deployment.

    1. Thanks for taking the time to comment Thomas – it was a bit of a pain to get this installed when I cobbled this guide together. It will be a while before I get to look at this one again though.

  10. Thank you very much.
    Very clean & straight forward steps.

    Earlier I struggled to get MediaDrop running on CentOS 7, with multiple failed attempts.

  11. Mike Lane, Thanks a lot, I tried follow their official documentation but couldn’t figure it out. I also tried so many other articles. But your is the best one. Its just worked liked a charm. Thanks a lot friend.

  12. Hello I wonder if anybody has been successful with auto-thumbnail… I have been uploading videos manually with thumbnails. It is a long process and I would like to know any of you guys had found a solution.

    1. https://github.com/docdawning/mediadrop-handbrake-bot

      mediadrop-handbrake-bot is a simple php daemon. It watches mediadrop media tables and loops over uploaded media. When an unencoded one is found it invokes handbrake to encode it in an h264, “Apple TV 3” compatible one. Then it creates the needed media_files in mediadrop db and set the original media as encoded.

      It also creates thumbnails using ffmpeg. I’ve created a little script directory in here. You can tune the thumbnail script a little if you want. Right now it mindlessly just makes a thumbnail from 15s in to the video, so I guess you’d better have a video at least that long or there will be no automatic thumbnail. Also, if your uploaded video doesn’t need to be transcoded, then the thumbnail generation offered by this won’t apply since the script starts by looking for “unencoded” media.

      There’s also some relevant commentary in the php file.


      git clone https://github.com/docdawning/mediadrop-handbrake-bot.git /opt/mediadrop-handbrake-bot
      sudo add-apt-repository ppa:stebbins/handbrake-releases; sudo apt-get update; sudo apt-get -y install handbrake-cli
      Optional: My thumbnail generation uses ffmpeg, to install it: sudo apt-get install ffmpeg
      Update path info in .php and .conf file if you installed to some other path
      Copy .conf file to /etc/init/ (Note upstart disregards symlinked .conf files, so actually copy in there, lame, I know)
      start handbrake bot service with “start handbrake-bot”
      Watch plugin output if you want: tail -f /var/log/upstart/handbrake-bot.log
      Paypal donate a beer to Doc: http://www.dawning.ca/about/


      fill media_file metadata as size and bitrate
      send email via php mail to media author when encoding is done
      upstart script for ubuntu/debian distros

      Many todos:

      multiple encoding profiles
      script parameterization ( remove all hardcoded paths )
      Improved thumbnail generation (right now the small, medium and large sizes are all the same)
      ini-based config file support

      1. That script is outdated…. Mediadrop version 10 and 11 can’t quite well work with that script. I even contacted the guy who created the script about that issue. The script needs an update..

      2. Thanks for the update Christo. It was a bit of a pain to get this running when I looked at it – I don’t have any plans at the moment to update this blog post, sorry!

  13. Thank you for this. I have used the guide to successfully setup MediaDrop on Ubuntu16.04. I intend to run it in vSphere as a video on demand service for medical education in a Public hospital (Australia). I don’t suppose anyone can instruct me on how to silence the terminal output ? Or at least run it in the background so another admin doesn’t close it by accident? I am pretty new to Ubuntu….I also wanted to try and get it to run at server boot but I’m not sure how. Even if no responses come through: Thanks again. It’s a thourough and excellent guide.

      1. *Thorough (atrocious, I should have corrected that)!

        I’m currently going through your other posts to see if I can pillage anything extra, I hope you don’t mind?

        I’ll check that link this evening – Thanks again.

  14. Hi Mike,

    Thank you very much for the well compiled document.
    I have installed mediadrop on Ubuntu 14.04 machine, is there a way to start the web services on boot of the system.

  15. Thank you for this tutorial.

    However, I get problem when do : paster make-config MediaDrop deployment.ini

    Traceback (most recent call last):
    File “/usr/bin/paster”, line 4, in
    File “/usr/lib/python2.7/dist-packages/paste/script/command.py”, line 93, in run
    commands = get_commands()
    File “/usr/lib/python2.7/dist-packages/paste/script/command.py”, line 135, in get_commands
    plugins = pluginlib.resolve_plugins(plugins)
    File “/usr/lib/python2.7/dist-packages/paste/script/pluginlib.py”, line 82, in resolve_plugins
    File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 725, in require
    needed = self.resolve(parse_requirements(requirements))
    File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 628, in resolve
    raise DistributionNotFound(req)
    pkg_resources.DistributionNotFound: bleach>=1.4.1: Not Found for: MediaDrop (did you run python setup.py develop?)

    could you helpme to solve it? is there something missing?

    1. Hi Samsul, my original post is over 3 years old now and I imagine that MediaDrop has changed since then – I would post in their forum for support or a more up to date installation guide.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s