Deluge Client in a FreeNAS 11 iocage Jail Easy Tutorial

FreeNAS 11 introduces a new way to manage jails, iocage. As FreeNAS transitions there is a gap for users that leveraged precreated plugins in previous versions of FreeNAS. This guide will help you create a jail in, assign users, permissions and installing Deluge the BitTorrent client in an iocage managed jail.

  1. SSH into FreeNAS as root
  2. Creating the iocage jail
    iocage create -n "deluge" -r 11.1-RELEASE ip4_addr="vnet0|192.168.0.5/24" vnet="on" allow_raw_sockets="1" defaultrouter="192.168.0.1" boot="on" host_hostname="deluge"
  3. Console into the iocage jail
    iocage console deluge
  4. Add the following to /etc/rc.conf
    # Enable SSHD
    sshd_enable="YES"

    # Enable Deluge
    deluged_enable="YES"
    deluge_web_enable="YES"
  5. Install sudo bash and deluge packages
    pkg install sudo bash deluge
  6. (Optional) Create non-root user for interactive logins:
    [root@deluge /root]$ adduser
    Username: patrick
    Full name:
    Uid (Leave empty for default):
    Login group [patrick]:
    Login group is patrick. Invite patrick into other groups? []:
    Login class [default]:
    Shell (sh csh tcsh bash rbash nologin) [sh]: bash
    Home directory [/home/patrick]:
    Home directory permissions (Leave empty for default):
    Use password-based authentication? [yes]:
    Use an empty password? (yes/no) [no]:
    Use a random password? (yes/no) [no]: yes
    Lock out the account after creation? [no]:
    Username : patrick
    Password :
    Full Name :
    Uid : 1001
    Class :
    Groups : patrick
    Home : /home/patrick
    Home Mode :
    Shell : /usr/local/bin/bash
    Locked : no
    OK? (yes/no): y
    adduser: INFO: Successfully added (patrick) to the user database.
    adduser: INFO: Password for (patrick) is:
    Add another user? (yes/no): n
    Goodbye
  7. (Optional) Configure sudo non-root administrator
    echo "user ALL=(ALL) ALL" >> /usr/local/etc/sudoers
  8. Create non-root deluge user to run the services as
    [patrick@deluge /home/patrick]$ sudo adduser
    Username: deluge
    Full name:
    Uid (Leave empty for default):
    Login group [deluge]:
    Login group is deluge. Invite deluge into other groups? []:
    Login class [default]:
    Shell (sh csh tcsh bash rbash nologin) [sh]: bash
    Home directory [/home/deluge]:
    Home directory permissions (Leave empty for default):
    Use password-based authentication? [yes]:
    Use an empty password? (yes/no) [no]:
    Use a random password? (yes/no) [no]: yes
    Lock out the account after creation? [no]:
    Username : deluge
    Password :
    Full Name :
    Uid : 1002
    Class :
    Groups : deluge
    Home : /home/deluge
    Home Mode :
    Shell : /usr/local/bin/bash
    Locked : no
    OK? (yes/no): y
    adduser: INFO: Successfully added (deluge) to the user database.
    adduser: INFO: Password for (deluge) is:
    Add another user? (yes/no): n
    Goodbye
  9. Create directories for deluge services to startup
    sudo mkdir /home/deluge/.config/deluge
    sudo chown -R deluge:deluge /home/deluge/.config
  10. Edit the deluged startup script to use the newly created deluge user
    sudo vi /usr/local/etc/rc.d/delugedLocate the following line and update it from :
    : ${deluged_user:="abcdefghijklmnop"}
    to …
    : ${deluged_user:="deluge"}
    Save and exit.
  11. Edit the deluge_web startup script to use the newly created deluge user
    sudo vi /usr/local/etc/rc.d/deluge_webLocate the following line and update it from :
    : ${deluged_user:="abcdefghijklmnop"}
    to …
    : ${deluged_user:="deluge"}
    Save and exit.
  12. Start the deluge services
    sudo service deluged start
    sudo service deluge_web start
  13. Browse to
    http://hostname:8112
    and enjoy.

6 Thoughts on Deluge Client in a FreeNAS 11 iocage Jail Easy Tutorial

    1. Yes. When you added the user it should have created a home directory for deluge which should have set the correct permissions for the deluge user to create the .config file. If it is not, ‘su – deluge’ to become the deluge user then issue a ‘touch /home/deluge/.config’ to create that configuration file. Try that and let me know how it works.

Leave a Reply to wanstronianCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.