QNAP NAS as a Debian Linux Server

Several years ago I bought a QNAP TS-109 Network Attached Storage (NAS) device to use as a low power Linux server. I wanted a small server that would be always on, but would be quiet and would not use too much electricity.

After doing a lot of research on the options out there, I found an excellent guide for Installing Debian on the QNAP TS-109. The TS-109 II was one of the most powerful options out there at the time (in my price range) and it was able to run my Linux distribution of choice, Debian.

My NAS has been running faithfully for the past few years, but it was running some pretty old software so I thought it was time for an upgrade. I recently reinstalled my NAS with the newer Debian “Squeeze” release and thought I would document my progress here.

Installing OS

Installing Linux was pretty straightforward. Because I was already running an older Debian release, I simply downloaded and ran the files which copied the Debian installer to flash.

This was  all documented under the “download and flash the installer” section of the guide I linked to above. The install process is the same as the normal Debian CLI installer, only you connect to it via SSH.

After installing the OS I made sure to assign the NAS a static IP address, to make management easier.

Setup sshd

I chose the “ssh server” option during the Debian install, which installed an openssh-server. The only change I made here was in the /etc/ssh/sshd_config file, where I disabled root login.

I was originally planning on using SFTP for file transfer to/from the NAS, but on testing transfer speeds were horribly slow –  around 2 MB/s – I think this is due to the cryptography overhead of SSH, it is simply too much for the 500 MHz ARM processor in the TS-109.

To get around this problem, I installed an (unencrypted) FTP server.

Setup FTP

For my ftp server I chose proftpd, due to its simple configuration. Installing proftpd was simple (#apt-get install proftpd). To increase the security of the server I added a rule limiting login to the configuration file /etc/proftpd/proftpd.conf.

<Limit LOGIN>
DenyGroup !ftpuser

This prevents all users who are not members of the “ftpuser” group from logging in to the FTP server. I added my local user to the ftpuser group with this command.

#useradd ftpuser username

FTP is much faster than SFTP was. While my computer and the NAS both support Gigabit Ethernet, I only have a 100 Mb/s switch. The FTP server was able to transfer at around 11 MB/s, nearly the theoretical maximum of the interface.


Installing a BitTorrent client w/ web interface

I’ve been using rtorrent for a long time now. This command line BitTorrent client has worked well for me for a long time, but it is tedious to setup and use. I thought I would try something different this time.

I did my research on BitTorrent clients that can run on headless servers. I chose Transmission because I was comfortable with the client I had been using for a long time in Mac OS X and Linux. I found an excellent guide to installing the web interface client here.

Now it is up and running beautifully. It is much easier to use than rtorrent and I am very happy with my set up so far. The TS-109 does seem pretty limited by its processor, whenever performing an action the CPU is maxed at 100%. I have doubts that the NAS can transfer files at Gigbait Ethernet speeds.

You can see the transmission webclient and the cpu usage below:

Yet to come

Right now I am messing around with coding my own website. I signed up with a dynamic DNS service and I hope to be hosting my website locally. I hopefully will be configuring this in the coming weeks!