This tutorial will be showing you how to install Deluge on Ubuntu 18.04 desktop and server. Deluge is a free, open-source (GPL3) and lightweight BitTorrent client, available for Linux, FreeBSD, Mac OS X and Windows. It has a rich collection of plugins that you can install to extend its functionality. For example, you can install the streaming plugin so you can stream video or audio directly from Deluge while downloading. The latest stable version, 1.3.15, was released on May 12, 2017.
Install Latest Version of Deluge on Ubuntu 18.04 Desktop from PPA
Ubuntu 18.04 software repository includes Deluge 1.3.15. However, when a newer version comes out, it would take some time for the Ubuntu team to update it. To ensure you get the newest version as soon as possible, you need to install it from official Deluge PPA. Open up a terminal window, then run the following 2 commands one at a time.
sudo add-apt-repository ppa:deluge-team/ppa sudo apt install deluge
Note that on Ubuntu 18.04, you don’t need to manually run sudo apt update
after adding a PPA. It will run automatically. This PPA also works on other Linux distributions that are based on Ubuntu such as Linux Mint and Elementary OS. If you already have deluge installed, then the above commands will update your deluge to the latest version. Don’t worry, your existing torrents will be fine.
Once installed, you can start it from application menu.
Deluge 1.3.15 user interface
How to Enable Deluge Autostart on Ubuntu 18.04 Desktop
To enable autostart, open the Startup Applications
from your applications menu. Then click Add
button to add a new startup program. In the Name field, you can enter something like “Deluge GTK”. In the Command field, enter /usr/bin/python /usr/bin/deluge-gtk
. You can leave the comment field blank. Click Add
.
Install Deluge BitTorrent on Ubuntu 18.04 Server
You can install Deluge BitTorrent daemon on a server and manage the program via the Deluge web interface (You control it in a web browser). Use the following command to install Deluge daemon and Deluge Web interface on Ubuntu 18.04 server.
sudo add-apt-repository ppa:deluge-team/ppa sudo apt install deluged deluge-webui
Then create the deluge
user and group so that deluge can run as an unprivileged user, which will increase your server’s security.
sudo adduser --system --group deluge
The --system
flag means we are creating a system user instead of normal user. A system user doesn’t have password and can’t login, which is what you would want for Deluge. A home directory /home/deluge/
will be created for this user. You may want to add your user account to the deluge
group with the following command so that the user account has access to the files downloaded by Deluge BitTorrent. Files are downloaded to /home/deluge/Downloads
by default. Note that you need to re-login for the groups change to take effect.
sudo gpasswd -a your-username deluge
Once that’s done, create a systemd service file for deluge with your favourite text editor such as nano.
sudo nano /etc/systemd/system/deluged.service
Copy and paste the following lines into the file.
[Unit] Description=Deluge Bittorrent Client Daemon After=network-online.target [Service] Type=simple User=deluge Group=deluge UMask=007 ExecStart=/usr/bin/deluged -d Restart=on-failure # Configures the time to wait before service is stopped forcefully. TimeoutStopSec=300 [Install] WantedBy=multi-user.target
To save a file in Nano text editor, press Ctrl O
, then press Enter
to confirm. Now start deluge deamon with the following command. Since we want Deluge to run as the deluge
user, there’s no need to add sudo
to the command, but you will be asked to enter your password.
systemctl start deluged
You may also want to enable auto start when Ubuntu 18.04 is booting up.
systemctl enable deluged
Check Deluge status:
systemctl status deluged
You can see that deluged is running and autostart is enabled. If it’s exited or isn’t running, you may need to restart it with systemctl restart deluged
.
Accessing Deluge WebUI
To be able to access the deluge WebUI, we also need to create a systemd service file for deluge web.
sudo nano /etc/systemd/system/deluge-web.service
Copy and paste the following texts into the file.
[Unit] Description=Deluge Bittorrent Client Web Interface After=network-online.target [Service] Type=simple User=deluge Group=deluge UMask=027 ExecStart=/usr/bin/deluge-web Restart=on-failure [Install] WantedBy=multi-user.target
Save and close the file. Then start and enable deluge-web, check its status. Again, there’ no need to add sudo
to the commands.
systemctl start deluge-web systemctl enable deluge-web systemctl status deluge-web
Once the deluge-web
service is running, it listens on TCP port 8112. Now in your Web browser address bar, type
your-server-ip:8112
You will be asked to enter a password, which by default is deluge
, to access the Web UI. (Your firewall might be preventing access to port 8112, so check your firewall setting if you can’t access the web UI).
It’s recommended to change the default password. After you choose to change password, the connection manager
window will pop up asking you to connect to Deluge daemon which is listening on 127.0.0.1:58846
. Select the connection and click Connect button.
Then you will be able to change the WebUI password. Note that you need to click the Change
button to apply this change.
And now you can use Deluge BitTorrent on your Ubuntu 18.04 server from the web interface.
To add new torrents, click the add button on the upper left corner. You can add a torrent file from your local computer or add magnet link. By default, files are downloaded to /home/deluge/Downloads
directory.
Set Up Nginx Reverse Proxy for Deluge WebUI
A reverse proxy is a proxy for another server, in this case the Deluge WebUI. First install Nginx on Ubuntu 18.04.
sudo apt install nginx
Start Nginx
sudo systemctl start nginx
Then create a Nginx server block file for Deluge WebUI.
sudo nano /etc/nginx/conf.d/deluge-webui.conf
Copy and paste the following texts into the file. Replace the red-colored text with your own domain name. You should also set the A record for your domain name.
server { listen 80; server_name torrent.yourdomain.com; access_log /var/log/nginx/torrent.yourdomain.com.access; error_log /var/log/nginx/torrent.yourdomain.com.error; location / { proxy_pass http://127.0.0.1:8112; } }
Save and close the file. Then test Nginx configuration.
sudo nginx -t
If the test is successful, reload Nginx
sudo systemctl reload nginx
Now you can access Deluge WebUI via your domain name (torrent.yourdomain.com
). Now you may want the deluge-web process to listen only on localhost (127.0.0.1)
, so that it’s not exposed to the Internet. To achieve that, we need to edit the systemd service file.
sudo nano /etc/systemd/system/deluge-web.service
Find the following line.
ExecStart=/usr/bin/deluge-web
Change it to
ExecStart=/usr/bin/deluge-web -i 127.0.0.1
Save and close the file. Then reload systemd daemon.
systemctl daemon-reload
And restart deluge-web service.
systemctl restart deluge-web
You can check the listening status with:
sudo netstat -lnpt | grep 8112
Enable HTTPS
To secure the Web UI, you can install a free Let’s Encrypt certificate. First you need to install the Let’s Encrypt client (certbot) on Ubuntu 18.04 server.
sudo apt install software-properties-common sudo add-apt-repository ppa:certbot/certbot sudo apt install certbot python3-certbot-nginx
Python3-certbot-nginx
is the Certbot Nginx plugin. After they are installed, run the following command to automatically obtain and install Let’s Encrypt certificate.
sudo certbot --nginx --redirect --agree-tos --hsts --staple-ocsp --email your-email-address -d torrent.yourdomain.com
Once that’s done, refresh deluge Web UI. It will be automatically redirected to HTTPS connection.
I hope this tutorial helped you install Deluge on Ubuntu 18.04 desktop or server. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care.
Rate this tutorial
[Total: 13 Average: 4.4]