Description of how to install the software needed for Lobber.

Page index
  1. Common
  2. Web application and tracker server
  3. Storage node
  4. Database server
  5. Development sandbox


All hosts are running Ubuntu (10.04) with the following extra packages and customizations.

apt-get install git-core git-doc ssl-cert python-virtualenv
apt-get install postfix
# local only configuration!

Web application and tracker server

Install the following packages:

apt-get install apache2 libapache2-mod-wsgi libapache2-mod-shib2 libpq-dev python-dev python-twisted python-pip

If you don't want to install libpq-dev and python-dev you can install psycopg2 with apt and later symlink it to your virtual python environment.

ln -s /usr/lib/python2.6/dist-packages/psycopg2 /path/to/lobber_env/lib/python2.6/site-packages
ln -s /usr/lib/python2.6/dist-packages/mx /path/to/lobber_env/lib/python2.6/site-packages
ln -s /usr/lib/python2.6/dist-packages/psycopg2-2.0.13.egg-info /path/to/lobber_env/lib/python2.6/site-packages

Orbited can not be installed in the lobber python environment because it requires python-twisted.

pip install orbited

Set up a virtual python environment (virtualenv) and activate it.

virtualenv --no-site-packages /path/to/lobber_env
source /path/to/lobber_env/bin/activate

Install the needed python applications. (Yes, orbited again...needed as import in django)

pip install django django-tagging django-form-utils psycopg2 orbited

You need these if you are setting up a development sandbox:

pip install uuid django-evolution django-extensions werkzeug django-debug-toolbar

Get Lobber from and check out the latest stable version.

git clone git://
cd lobber
git checkout bud-light

Create the a log, torrent and a dropbox directory in the lobber root directory. Make the writable by the Apache user.

cd /path/to/lobber/
mkdir logs
mkdir torrents
mkdir dropbox

Symlink the environment directory and Django admin media directory in to the src directory.

cd /path/to/lobber/src
ln -s /path/to/lobber_env env
ln -s env/lib/python2.6/site-packages/django/contrib/admin/media admin-media

Edit paths and other options in
BASE_DIR = '/path/to/lobber'

APP_ADDR = 'host_ip or FQDN'
BASE_UI_URL = 'https://' + APP_ADDR

TRACKER_ADDR = 'host_ip or FQDN'

    ('Your name', ''),

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'lobber'
DATABASE_USER = 'lobber'
DATABASE_PASSWORD = 'secret_password'
DATABASE_HOST = 'database host'
DATABASE_PORT = 'database port'

DROPBOX_DIR = '/path/to/lobber/dropbox'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'secret'

    'django.contrib.contenttypes',      # For the Permission model.

If you are using Django 1.3 (standard from pip) then you need to change your database settings to:
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'lobber',
        'USER': 'lobber',
        'PASSWORD': 'secret',
        'HOST': 'database_server',
        'PORT': 'database_port'

Synchronize the database.

./ syncdb

Setup Orbited by creating /etc/orbited.cfg:


* -> localhost:61613


session.ping_interval = 300


#Don't enable debug by default

and make sure that orbited is started like this automatically at boot:

echo "orbited -c /etc/orbited.cfg" >> /etc/rc.local

Then start orbited:

orbited -c /etc/orbited.cfg &

Activate some Apache modules:

a2enmod shib2
a2enmod headers
a2enmod rewrite
a2enmod proxy
a2enmod proxy_http

Restart Apache

/etc/init.d/apache2 restart

Edit lobber/src/lobber.wsgi:


Create /etc/apache2/conf.d/lobber:

WSGIPythonPath "/path/to/lobber:/path/to/lobber/src"
WSGIPythonHome "/path/to/lobber/src/env"
WSGIRestrictStdout Off
WSGIScriptAlias / /path/to/lobber/src/lobber.wsgi

Edit /etc/apache2/sites-available/default-ssl:

Alias /admin-media /path/to/lobber/admin-media
Alias /site-media /path/to/lobber/site-media

Documentation on how to set up Apache to handle https can be found here:


Usual problems:

  • /path/to/lobber/logs/web.log is not writable by www-data (apache user).
  • /path/to/lobber/torrents/ is not writable by www-data (apache user).
  • /path/to/lobber/dropbox/ is not writable by www-data (apache user).
  • /path/to/lobber/db/ (if you are using sqlite) is not writable by www-data (apache user).

Missing documentation

Documentation on how to set up federated login using mod_shib2 should be added or linked to.

Set up cron jobs for expiring old torrents, keys and peers.

# m h dom mon dow command
*/5 * * * * cd /path/to/lobber/src/ && ./ expire_peers 5
0 0 * * * cd /path/to/lobber/src/ && ./ expire_torrents
5 0 * * * cd /path/to/lobber/src/ && ./ expire_keys

To be able to accept file uploads in the Lobber web application you need to install a Lobber storage node on the web application and tracker server.

Storage node

See Running a storage node (bud light)

Note that the web application and tracker server needs a storage node nowadays – that's how we do file upload.

Database server

apt-get install postgresql-client-8.4

Look at the official Django database documentation.

Setting up your own development sandbox

  1. apt-get install python-virtualenv
  2. virtualenv /mina/envs/lobber
  3. . /mina/envs/lobber/bin/activate
  4. pip install django django-extensions django-tagging orbited uuid django-evolution werkzeug psycopg2
  5. git clone (alt. git pull)
  6. cd lobber
  7. git checkout <branch>
  8. mkdir db
  9. mkdir logs
  10. cd src
  11. ./ syncdb
  12. ln -s /mina/envs/lobber env
  13. ln -s env/lib/python2.6/site-packages/django/contrib/admin/media admin-media
  14. Edit paths in
  15. ./ runserver_plus