Quantcast
Channel: Lowyat.NET: Latest topics in Reviews and Guides
Viewing all articles
Browse latest Browse all 559

[GUIDE] Headless Ubuntu Server Deluge, How-To setup deluge in Ubuntu Server

$
0
0
Hope this guide help anyone that is new to this setup which I have just setup myself one of this which I google search.

How to install Deluge (v1.2.x/v1.3.x) headless on Ubuntu Server

Deluge is a great BitTorrent client that you can install on Ubuntu to allow you to share your favourite files with the rest of the BitTorrent community.

In the newer versions of Ubuntu, Deluge comes in two parts; the server (also called the daemon) and the user interface. This means you can install the Deluge daemon as a headless service and then control it from a remote machine. You can either control the daemon using the Deluge client itself (for example the Windows version of Deluge) or alternatively you can use your browser to control it. If you've not installed VNC and are running a purely headless setup then running Deluge headless is pretty much your only option! So, here's how you install it:

So, first off we need to create a new user called "deluge" and perform a couple more steps:
CODE
sudo adduser --disabled-password --system --home /var/lib/deluge --gecos "SamRo Deluge server" --group deluge
sudo touch /var/log/deluged.log
sudo touch /var/log/deluge-web.log
sudo chown deluge:deluge /var/log/deluge*


Install the Deluge Daemon and WebUI
Next we'll install the Deluge daemon itself:
CODE
sudo apt-get install deluged deluge-webui


Run the Deluge Daemon on startup
Now we've got the components installed we need to make everything run on start-up. So, let's create the first script we need by typing the following command in a Putty Session:

CODE
sudo vi /etc/default/deluge-daemon


This will create and open a file called deluge-daemon
Next, assuming you're using Putty, highlight the following 5 commands, right-click on them and select Copy

CODE
# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"


*when using vi, remember to enter "INSERT" mode before pasting anything. Check the first line to see if anything missing[\b]
Toggle back to the Putty Session and press the [Insert] key once and then right click and the 5 lines we've just copied above will be pasted into the file.

Now press the [Esc] key once and type [cool.gifwhistling.gifq
to save and quit out of the script. If you make a mistake editing the file then issue :q! instead of whistling.gifq to abort your changes.

Creating the "Init Script"

Now we need an "init script". This script is rather long but we can do some more copying and pasting to implement this script. So, type the following command in your Putty Session to create and open the script:

CODE
sudo vim /etc/init.d/deluge-daemon


Next, highlight and copy this script

Toggle back to your Putty Session and press the [Insert] key once and then right click and the whole script you've just highlighted will be pasted into the screen.

*when using vi, remember to enter "INSERT" mode before pasting anything. Check the first line to see if anything missing

Now to modified the script a little to fit your needs.

From this
CODE

DAEMON1_ARGS="-d -c /var/lib/deluge -l /var/log/deluged.log -L warning"
DAEMON2_ARGS="-p 9092 -c /var/lib/deluge -l /var/log/deluge-web.log -L warning"


To this
CODE

DAEMON1_ARGS="-d -p 9093 -c /var/lib/deluge -l /var/log/deluged.log -L warning"
DAEMON2_ARGS="-p 9092 -c /var/lib/deluge -l /var/log/deluge-web.log -L warning"


To enable "https" connection:
add --ssl in
CODE
DAEMON2_ARGS="-p 9092 --ssl -c /var/lib/deluge -l /var/log/deluge-web.log -L warning"


Anything else, please consult with deluge and deluged-web manual:

CODE
man deluge
man deluged-web


As before, press the [Esc] key once and type whistling.gifq to save and quit out of the script. If you make a mistake editing the file then issue :q! instead of whistling.gifq to abort your changes.

We now need to make this script executable. So:

CODE
sudo chmod a+x /etc/init.d/deluge-daemon


Now we need to make sure this script runs on start-up. To do this type the following command:

CODE
sudo update-rc.d deluge-daemon defaults


Cross your fingers and restart the server by typing the following command:

CODE
sudo shutdown -r now

or
CODE
sudo reboot -h now


Accessing Deluge via the web interface

You should now be able to access the Web front-end for Deluge by typing http://MyMediaserver:9092 into the address bar of your browser where MyMediaserver is the name you gave to your server when you installed Ubuntu. Alternatively the IP address of the server works just as well.

You should now be presented with the Deluge login-screen. Enter deluge for the password and you should then see a screen similar to this (Note: This is access from Windows 7):

[attachmentid=2693067]

Accessing Deluge via the Deluge client

Open the /var/lib/deluge/auth to edit:

CODE
sudo vi /var/lib/deluge/auth


Which will show you this for first time access:

CODE
localclient:a7bef72a890:10


Add a user and password to the authentication file (this does not have to be your server's user/pass):

CODE
username:password:level


where the authentication levels can be obtain from Deluge Authentication Support

Assuming that you have enable the deluge-webui than access it through the webui. Click on the Preferences icon (the screwdriver/spanner) on the Deluge web interface and select Daemon, check the Allow Remote Connections and change the Daemon port: if necessary.

[attachmentid=2693068]

Run the deluge client. Click on the Preferences icon (the screwdriver/spanner) on the Deluge client and select Interface. Untick the Classic Mode than restart your deluge client.

You will see something like this on the new start of the deluge client:

[attachmentid=2693069]

Click on Add. Enter your deluge server IP address or URL and port number for the deluge daemon running on your server. Enter your username and password created previously in the /var/lib/deluge

Opening the correct ports on your router

In order to start downloading Torrents you need to open up some ports on your router. If you click on the Preferences icon (the screwdriver/spanner) on the Deluge web interface and select Network, the Incoming Ports (the From: and To: ports inclusively) are the ports you need to open on your router. You can obviously change these ports if so wish, but make sure they match your router settings. Make sure you also uncheck the Use Random Ports option if you're going to be opening a specific port range on your router.

References:
Guide to setup a headless torrent box. - source: Build Media Server
Deluge support for ThinClient setup - source: Deluge ThinClient Setup

Viewing all articles
Browse latest Browse all 559

Trending Articles