Install headless Deluge torrent server in a jail.
Contents
1. Introduction
Deluge is a cross platform bittorrent client licensed in GNU gpl v3. It can be installed in standalone mode with a graphical environment but also in client/server mode which support remote control with graphical (GTK), web or console user interfaces.
It utilises the libtorrent library and it's features and you can extend them, thanks to it's plugins ecosystem.
2. Tested
2017/08/09
FreeBSD |
11.1 |
Deluge |
15 |
3. Preparations
Topics |
Values |
ip address of the deluge server |
ip_of_the_server |
FreeBSD's unpriviledged user that start the deluge daemon |
deluge - ID 1001 |
ip address of the deluge jail |
glpi_db_user_password |
jail system user for deluge |
deluge - ID 1001 |
admin user in deluge |
delugeadmin |
your server hostname |
your_hostname |
4. Install FreeBSD
Standard installation of freeBSD
5. Create an unpriviledged user
The method is described in the handbook at the chapter Users and Basic Account Management
# adduser Username: deluge Full name: deluge Uid (Leave empty for default): Login group [deluge]: Login group is deluge. Invite deluge into other groups? []: Login class [default]: Shell (sh csh tcsh nologin) [sh]: nologin Home directory [/home/deluge]: Home directory permissions (Leave empty for default): Use password-based authentication? [yes]: no Lock out the account after creation? [no]: no Username : deluge Password : <disabled> Full Name : deluge Uid : 1001 Class : Groups : deluge Home : /home/deluge Home Mode : Shell : /usr/sbin/nologin Locked : no OK? (yes/no): yes adduser: INFO: Successfully added (deluge) to the user database. Add another user? (yes/no): no Goodbye!
An alternative method to create a user is to use the command pw
pw useradd -n deluge -u [ID] -G wheel -m -c "Deluge BitTorrent Client" -s /sbin/nologin -w no
You can check that the user has been created with the command # cat /etc/passwd
Specify the deluge user
# sysrc deluged_user="deluge"
Note : you can check the result of this command in the rc.conf configuration file with the command cat /etc/rc.conf
6. Install Deluge
Thanks to the port maintainer rm@freebsd.org, since October 2016 the port includes a version without the GTK environment !
Install Deluge
pkg install deluge-cli
Note that you can search for the available ports with the command pkg search deluge
Make sure that deluge will start at boot
sysrc deluged_enable="YES"
= configuration file =
create de default directory to contain configs files
mkdir -p /home/deluge/.config/deluge chown -R deluge:deluge /home/deluge/
Start/stop the deluge daemon to generate config files
# service deluge start # service deluge stop
7. Sources
8. To do
9. Credits
Original howto written by David Stievenard