DLink DNS-320 NAS as an Always-On BitTorrent Box

This post is a tutorial on how to setup a DLink DNS-320 NAS as an always on BitTorrent box.

Steps to achieve that are:

  1. Install fun_plug0.7 on the NAS
  2. Install Debian on the NAS.
  3. Install and configure Deluge BitTorrent Client on the NAS.
  4. Fine tune of Debian installation.

1.  Install fun_plug0.7 on the NAS

Follow one of the bellow link to install fun_plug on NAS:

2. Install Debian on the NAS.

Follow link bellow to install Debian Squeeze on NAS

3.  Install and configure Deluge BitTorrent Client on the NAS.

For the installation and configuration of Deluge BitTorrent client I used the bellow article. Feel free and use that for a detailed reference.

Install Deluge BitTorrent client on a Debian based machine

I’m going to write down the commands I have used to achieve this:

  • As usual before the installation update your repositories:

apt-get update

  • Installing the necessary components:

apt-get install deluged deluge-console python-mako deluge-web

  • The we have to run for first time the Deluge daemon:


pkill deluged

  • Create a new user that will be used to run deluged

adduser nas_torrent

In my tutorial consider the below credentials:

username: nas_torrent

password: Torrent1!

  • Backup the original configuration

cp ~/.config/deluge/auth ~/.config/deluge/auth.old

  •  Open the original configuration file with your favourite editor

vim ~/.config/deluge/auth

Put the below line to the bottom :


Basicaly the format is as follows:

<username>:<password>:<access level>

  • Start the deluge daemon


If all went ok you will have something similar as below on your screen:


  • Put the below  commands while you are in deluge console:

config -s allow_remote True
config allow_remote

  • Restart the daemon to apply the settings:

sudo pkill deluged

  • Install and launch deluge client

Disable the Classic Mode option:


  • Apply the changes and restart the client after that you will prompted to add host.
  • Complete the fields according to your setup. Username and password are the same as the user we created in the begining


  • After adding the host the connection manager will appear with one entry. Select your connection and press connect.

Now you have your desktop ThinClient connected to the deluge BitTorrent client running on your NAS.

Also you can access the Web UI of the deluge client by visiting the bellow link:

http:// < your_nas_ip > : 8112

But first we have to do some fine tuning to our setup

4. Fine tune of Debian installation.

We have to create two cron jobs that will run every minute to check the status of deluged and deluge-web services to be sure that our client will be always in running state.

Access your NAS via ssh connection.

First we have to create two scripts for deluged and deluge-web services.

  • Use your favourite editor and:

1. Deluge.sh script

vim deluged.sh

   Put the below in the script:


# Check if gedit is running
if ps aux | grep “deluged” > /dev/null
#echo “deluged is running”
echo “deluged is running”

2. Deluge-web.sh script

vim deluged-web.sh

  Put the below in the script:


# Check if gedit is running

if ps aux | grep “deluge-web” > /dev/null
#echo “deluge-web is running”
echo “deluge-web is running”


  • Open the crontab file:

crontab -e

And enter the below lines:

*/1 * * * * sh /root/deluged.sh
*/1 * * * * sh /root/deluged-web.sh

  • Save the configuration and restart your NAS.

Now setup and configuration is complete.

Also you can access your setup via Transdroid android application to access your Deluge client.

You have an Always-On BitTorrent Box accessible from all over the world.

Happy downloading ( and seeding 🙂 ).


7 thoughts on “DLink DNS-320 NAS as an Always-On BitTorrent Box

  1. Thank you for this! I like how you did the auto start cron script.

    Unfortunately, my DNS320 is very slow at the moment after a failed installation of mysql. i reinstalled everything. from debian to deluge to twonky. it’ still slow 😦

    Any ideas on troubleshooting the device? I can’t log into putty after around 10 minutes of the NAS being open. it’s just stuck at a black blank screen, trying to read the device.

  2. Hi thanks for your feedback.
    I think that twonky slows your entire setup.
    Try and install only deluge on your debian installation.
    Dont forget that we are talking about a 800MHz CPU and 128MB RAM, box.

    • thanks for that! i actually stopped twonky. and just ran deluge. it just stops after around 10-15 minutes. i might try to remove the cron job and kill deluge process completely. i also removed apache2 since several installs got interrupted and errors were inevitable. right now, i’m trying to install vim since i used nano to edit the files.. and building dependency got stuck at 56%. Before this vim install, i ran apt-get update and upgrade first. I have no idea what’s wrong. the is there a way to check if deluge is eating up my ram? that 128mb is so small.. 😦 thank you!

  3. Just to update you. I finally found the culprit. The every minute Cron is really the problem. I ran both twonky and deluge without any hitch last night. I used the command “top” to have a system overview. Deluge tends to eat up 15-20% of the memory, while twonky only eats up 10%. So I guess the main limitation is the 128 RAM. Thanks.

  4. Many thanks, so much easier to install this than Transmission. Had many issues with Transmission-daemon on Debian Squeeze on DNS-320.
    Your guide to Deluge worked straight away with no complications.

    Again, thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s