Multiple Deluge users

It was recently just me using Deluge on my server, but now my friend (and his friend) would like it too. I thought there might be a way to use one web server and three different daemons (along with three init.d scripts), but I tried this and it’s not as secure and robust as I’d like. So I basically create three entire deluge daemon/webserver combos running alongside each other. It’s horribly kludgy, but it works. As soon as Deluge develop some sort of conf-based multiuser setup or something, I’m there.

Assuming you’ve got one Deluge instance set up properly (for details on that, see here) you now just need to create a couple more by duplicating all the init.d scripts, etc. and affixing them to the correct existing users (or you can create a new user if you want, it doesn’t really matter). For reference, both my friends were using rtorrent, so I’m transitioning them from that to Deluge.

This wiki page is very important. It contains the init.d scripts and log details that we’re going to use to setup Deluge for another user. I’m assuming you already have a user setup with the default “deluge” name. Let’s say the user we want to set Deluge up for is called “bob”.

Init Scripts

Thus for DELUGED-USER you’ll want to put “bob”. Also, you’ll need to change the file’s name as we already have the /etc/default/deluge-daemon file. I like to name them in the follwing style: /etc/default/deluge-bobd.

Save the init.d script as /etc/init.d/deluge-bobd. Make sure to do sudo chmod 755 /etc/init.d/deluge-bobd.

You should change the following lines:

# Provides:          deluge-daemon
#                    /etc/default/deluge-daemon.
NAME1="deluged"
NAME2="deluge"
DAEMON1_ARGS="-d"    # Consult `man deluged` for more options
DAEMON2_ARGS=""    # Consult `man deluge-web` for more options
PKGNAME=deluge-daemon

To something like this:

# Provides:          deluge-bobd
#                    /etc/default/deluge-bobd.
NAME1="deluged_bob"
NAME2="deluge_bob"
DAEMON1_ARGS="-d -p 58847 -L info -l /var/log/deluge_bob/daemon/warning.log"    # Consult `man deluged` for more options
DAEMON2_ARGS="-p 8113 -L info -l /var/log/deluge_bob/web/warning.log"    # Consult `man deluge-web` for more options
PKGNAME=deluge-bobd

We have specified a particular listening port for the daemon and for the webserver. These ports are simply the default ports + 1 – it means they won’t conflict (you’ll need to check these ports fit your own configuration). Next, we can create those log paths.

Logs

Simply adjust the paths it has in the wiki to the something like the following:

sudo mkdir -p /var/log/deluge_bob/daemon
sudo mkdir /var/log/deluge_bob/web
sudo chmod -R 755 /var/log/deluge_bob
sudo chown -R bob:bob /var/log/deluge_bob

Then let logrotate.d know how you want the logs rotated, fire up nano /etc/logrotate.d/deluge_bob and enter:

/var/log/deluge_bob/*/*.log {
        weekly
        missingok
        rotate 7
        compress
        notifempty
        copytruncate
        create 600
}

Save it and you’re done, logging-wise.

Starting Up

Now start the daemon and enter the default pass of “deluge”, and change whatever preferences you want to (more information here). The Connection Manager will pop-up and display the default Deluge daemon connection on port 58846. This is not your daemon as we have it running on 58847. In order to add our daemon to the Connection Manager, select the default entry and click Remove. Now click Add. The host is “localhost” and the port is 58847 in this case. The username and password are contained within Deluge’s auth file. This is kept in the Deluge user’s home directory at this path: ~/.config/deluge/auth. It contains three strings separated by colons. The first part is the username, the second is the password, and the third is the permissions level (normally 10 which means admin). Enter the username and password into Connection Manager! Now click “Add” and you’ll see it added. Now you can click “Connect”. You’re ready to add torrents!

2 thoughts on “Multiple Deluge users

  1. Great post, just what I was looking for. :) I am have a strange problem with the webui. I can log into the two different webui (8112 and 8113) from the same computer. However, when I log into one webui, it will kick me off the other webui and ask for a password. Vice Versa. That is, I can’t be logged into both webui at the same time.

    Reply
    • Hey, glad to see it helped!

      That’s probably (complete guess) because the session cookie is being replaced. You could test this by opening up the two different addresses in different browsers.

      I did this with the expectation that it would be used by users across different computers.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>