# Deluge with Deluge-Web on Ubuntu 20.04 (lazy guide) ``` sudo su ``` ``` locale-gen en_US.UTF-8 && \ update-locale && \ localectl set-locale LANG=en_US.UTF-8 && \ add-apt-repository ppa:deluge-team/stable && \ apt install -y deluged deluge-web && \ adduser --system --group deluge ``` ``` cat > /etc/systemd/system/deluged.service << EOF [Unit] Description=Deluge Bittorrent Client Daemon Documentation=man:deluged After=network-online.target [Service] Type=simple User=deluge Group=deluge UMask=000 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 EOF ``` ``` cat > /etc/systemd/system/deluge-web.service << EOF [Unit] Description=Deluge Bittorrent Client Web Interface Documentation=man:deluge-web After=network-online.target deluged.service Wants=deluged.service [Service] Type=simple User=deluge Group=deluge UMask=000 ExecStart=/usr/bin/deluge-web -d Restart=on-failure [Install] WantedBy=multi-user.target EOF ``` ``` systemctl daemon-reload && \ systemctl enable deluged && \ systemctl start deluged && \ systemctl enable deluge-web && \ systemctl start deluge-web && \ systemctl reset-failed ``` *Using* * Deluge-Web URL: http://yourIP:8112/ * Default passwrod is "deluge" * Source: https://www.linuxbabe.com/ubuntu/install-deluge-bittorrent-client-ubuntu-20-04 ### Create Apache Reverse Proxy - HTTP ``` sudo su apt update && \ apt install -y apache2 && \ a2enmod proxy proxy_http headers proxy_wstunnel DOMAIN=deluge.yourdomain.tld && \ rm -f /etc/apache2/sites-available/$DOMAIN.conf && \ cat > /etc/apache2/sites-available/$DOMAIN.conf << EOF <VirtualHost *:80> ServerName $DOMAIN ErrorDocument 404 /404.html #HTTP proxy ProxyPass / http://localhost:8112/ ProxyPassReverse / http://localhost:8112/ #Websocket proxy SSLProxyEngine on <Location /:/websockets/notifications> ProxyPass wss://localhost:8112/:/websockets/notifications ProxyPassReverse wss://localhost:8112/:/websockets/notifications </Location> Header always unset X-Frame-Options </VirtualHost> EOF DOMAIN=deluge.yourdomain.tld && \ a2ensite $DOMAIN.conf && \ systemctl restart apache2 ``` ### Optional - Enable HTTPS ``` sudo su apt install -y certbot python3-certbot-apache DOMAIN=deluge.yourdomain.tld && \ EMAIL=deluge@yourdomain.tld && \ certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email $EMAIL -d $DOMAIN systemctl restart apache2 ```