Project

General

Profile

Support #732

Install a Headless Deluge Bittorrent Server on FreeBSD

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
01/22/2016
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

This is a guide on how to install the Deluge bittorrent client on a server and controlled by the web interface on FreeBSD 9 10 11.

Prepare the Environment

  • Make sure the system is up to date:
    pkg update && pkg upgrade
    

Install Deluge

  • Install deluge:
    pkg install deluge-cli
    
  • Create the deluge user:
    pw useradd -n deluge -m -c "Deluge" -s /sbin/nologin -w no
    
  • Create the directory to store the deluge config files:
    mkdir -p /home/deluge/.config/deluge
    chown -R deluge:deluge /home/deluge/
    
  • Start and enable the deluge daemon at boot:
    echo 'deluged_enable="YES"' >> /etc/rc.conf
    echo 'deluged_user="deluge"' >> /etc/rc.conf
    service deluged start
    
  • Start and enable the deluge web interface at boot:
    echo 'deluge_web_enable="YES"' >> /etc/rc.conf
    echo 'deluge_web_user="deluge"' >> /etc/rc.conf
    service deluge_web start
    

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;
      }
      
  • Add a deluge site server block:
    vi /usr/local/etc/nginx/conf.d/deluge.example.com.conf
    
    • Add the following:
      server {
          listen       80 default_server;
          server_name  deluge.example.com;
          access_log  /var/log/deluge.example.com.log;
      
          location / {
              proxy_pass http://localhost:8112/;
          }
      }
      

Torrenting Protection

Encryption

  • From the web interface, go to Preferences -> Encryption
    1. Make sure Inbound is Enabled
    2. Make sure Outbound is Enabled
    3. click the Level menu and choose Full Stream
    4. Make sure to enable [X] Encrypt entire stream
    5. Click Apply and OK

Blocklist

  • From the web interface, go to Preferences -> Plugins and enable the Blocklist plugin, then click OK.
  • Check for new list every 1 day
  • Import blocklist on startup is checked
  • Click Apply and OK.

The Onion Router

  • Install TOR:
    pkg install tor
    
  • Tor users are strongly advised to prevent traffic analysis that exploits sequential IP IDs by setting:
    sysctl net.inet.ip.random_id=1
    
  • Edit the TOR config file:
    vi /usr/local/etc/tor/torrc
    
    • And add/modify the following lines:
      RunAsDaemon 1
      
  • Start and enable TOR at boot:
    echo 'tor_enable="YES"' >> /etc/rc.conf
    service tor start
    
  • From the web interface, go to Preferences -> Proxy:
  • Configure Web Seed type to Socksv5:
    1. Set host to localhost
    2. Set port to 9050
  • Configure Tracker type to Socksv5:
    1. Set host to localhost
    2. Set port to 9050
  • Configure DHT type to Socksv5:
    1. Set host to localhost
    2. Set port to 9050

Resources

#1

Updated by Daniel Curtis about 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 70
#2

Updated by Daniel Curtis about 8 years ago

  • Description updated (diff)
#3

Updated by Daniel Curtis about 8 years ago

  • Description updated (diff)
#4

Updated by Daniel Curtis about 8 years ago

  • Description updated (diff)
  • % Done changed from 70 to 90
#5

Updated by Daniel Curtis about 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100
#6

Updated by Daniel Curtis over 7 years ago

  • Description updated (diff)
  • Target version changed from FreeBSD 9 to FreeBSD 10
#7

Updated by Daniel Curtis over 6 years ago

  • Description updated (diff)
  • Target version changed from FreeBSD 10 to FreeBSD 11

Also available in: Atom PDF