Support #738

Install a F-Droid Repo Server on FreeBSD

Added by Daniel Curtis over 8 years ago. Updated over 8 years ago.

Package Management
Target version:
Start date:
Due date:
% Done:


Estimated time:
2.00 h
Spent time:


This is a guide on installing the F-Droid server to serve a local android package repository on FreeBSD 9.

NOTE: Due to the lack of support for the Android SDK on FreeBSD, the F-Droid Repo does not work as expected. -3/12/16

Prepare the Environment

  • Make sure the system is up to date:
    pkg update && pkg upgrade
  • Install a few dependencies:
    pkg install git python2 py27-pip py27-virtualenv bash jpeg openjdk
  • Add the fdroid user
    pw add user -n fdroid -m -s /bin/sh -c "F-Droid" 

Install Android SDK

WARNING: The Android SDK is not supported on FreeBSD. Don't expect it to work out of the box.

  • Download Android SDK:

Install F-Droid Server

  • Switch to the fdroid user:
    su - fdroid
  • Clone the fdroid source:
    git clone
  • Install the fdroid server:
    cd fdroidserver
    virtualenv env/
    source env/bin/activate
    pip install -e .
    python2 install
  • Exit from the fdroid user back into the root user:

Install Nginx

  • Install nginx:
    pkg install nginx
  • Start and enable nginx at boot:
    echo 'nginx_enable="YES"' >> /etc/rc.conf
    service nginx start
  • Create a configuration directory to make managing individual server blocks easier
    mkdir /usr/local/etc/nginx/conf.d
  • Edit the main nginx config file:
    vi /usr/local/etc/nginx/nginx.conf
    • And strip down the config file and add the include statement at the end to make it easier to handle various server blocks:
      worker_processes  1;
      error_log  /var/log/nginx-error.log;
      events {
          worker_connections  1024;
      http {
          include       mime.types;
          default_type  application/octet-stream;
          sendfile        on;
          keepalive_timeout  65;
          # Load config files from the /etc/nginx/conf.d directory
          include /usr/local/etc/nginx/conf.d/*.conf;

Setup F-Droid Repo

  • Create the fdroid repository directory:
    mkdir -p /usr/local/www/
    chown -R fdroid:www /usr/local/www/
  • Create the fdroid server block config file:
    vi /etc/nginx/conf.d/
    • And add the following:
      server {
      listen 80 default_server;
      autoindex on;
      access_log /var/log/ main;

      location / {
      root /usr/local/www/;
      index index.html index.htm;

Initialize the F-Droid Repo

  • Switch to the fdroid user:
    su - fdroid
  • Initialize a bare F-Droid repository:
    cd /usr/local/www/
    fdroid init



Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 30

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • Status changed from In Progress to Suspended

Also available in: Atom PDF