In this article, you are going to learn how to create your very own headless Raspberry Pi Torrentbox.
If you really enjoy this article, consider checking out my TechWizTime YouTube Channel.
And for an awesome source of Raspberry Pi Accessories, check out my Raspberry Pi Amazon List.
Let’s get started!
Table of Contents
Log in with the username pi and the password raspberry
Next, we are going to update and upgrade our Raspberry Pi’s Raspbian System.
sudo apt update
sudo apt upgrade
NOTE: You can change your default password for extra security using the following command
sudo passwd
sudo apt-get install openvpn -y
cd /etc/openvpn
sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
sudo unzip openvpn.zip
sudo nano login.conf
On the first line, type in your PIA Username.
On the second line, type in your PIA Password.
To save this file, press Ctrl X then Y then Enter
sudo chmod 400 login.conf
sudo cp *COUNTRYTHATYOUWANTTOCONNECTO*.ovpn *COUNTRYTHATYOUWANTTOCONNECTO*.conf
Now we are going to edit the newly copied CONF file
sudo nano *COUNTRYTHATYOUWANTTOCONNECTO*.conf
Scroll down to the “auth-user-pass” section, press space and add
/etc/openvpn/login.conf
Go down to “crl-verify” and add
/etc/openvpn/
Move down to “ca” and add
/etc/openvpn/
To save this file, press Ctrl X then Y then Enter
Test if the configuration works by typing
sudo openvpn *COUNTRYTHATYOUWANTTOCONNECTO*.conf
If it works, press Ctrl C to finish the connection.
sudo nano /etc/default/openvpn
Create a new line under the last “AUTOSTART” and type in
AUTOSTART=”COUNTRYTHATYOUWANTTOCONNECTTO”
To save this file, press Ctrl X then Y then Enter
Now we just need to reboot the Raspberry Pi
sudo shutdown -r 0
Once we have rebooted and logged back in we can check if the VPN connected.
curl http://ipinfo.io/ip
Compare the IP Address to check if you’re using OpenVPN
Connect your HDD by USB to the Raspberry Pi.
sudo umount /dev/sda1
sudo parted /dev/sda
You can press P to check the partitions at any time.
Next we need to create the filetable.
mktable msdos
Press Y to continue.
mkpart primary ext4 0% 100%
To check if the partition was created succesfully, input
If everything looks good, we can exit the tool
quit
Now we can create the EXT4 filesystem on the partition.
sudo mkfs.ext4 /dev/sda1
Press Y if it asks for confirmation.
Now we will create and mount the hard drive.
sudo mkdir /mnt/torrents
sudo mount /dev/sda1 /mnt/torrents
To check if it worked, use the following command and you should see the mount point at the bottom.
df -h
We want this hard drive to be mounted everytime we reboot. So we need to do the following.
sudo nano /etc/fstab
Create a new line under the last /dev and write
/dev/sda1 /mnt/torrents ext4 defaults 0 0
To save this file, press Ctrl X then Y then Enter
Another reboot.
sudo reboot
After rebooting, we can check to see if the partition was automatically mounted.
df -h
To install deluged and access it from a web browser, we need to install the following.
sudo apt install deluged -y
sudo apt install deluge-web -y
Now we can create the folder structure for our Torrentbox.
cd /mnt/torrents
sudo mkdir downloading
sudo mkdir completed
sudo mkdir watch
sudo mkdir backups
sudo chown -R pi:pi /mnt/torrents/
Now let’s check that we have all the folders created
ls -la
We need to check what our IP Address is so make sure you write it down.
ifconfig
Start Deluge by typing
sudo service deluged start
And let’s start the web-client too
deluge-web
Go to your PC and open up a web browser.
Go to the following address “YOURIPADDRESS:8112”
The login password is “deluge”, after typing it, you should receive a message telling you that you should change it, do it now if you wish.
Look for your Raspberry Pi on the small prompt that will appear (It should be the only one) and click on “Start Daemon” and then hit “Connect”
Go to “Preferences”.
Click on the “Downloads” tab.
In the “Download To” bar, type in “/mnt/torrents/downloading/”
Tick the “Move Completed To” and type in “/mnt/torrents/completed/”
Tick the “Autoadd .torrent files from” box and type in “/mnt/torrents/watch”
Tick the “Copy of .torrent files to” box and type “/mnt/torrents/backups”
Click “Apply”
Click “Ok”
Type “sudo raspi-config” and press “Enter”
Scroll down to “Localization”
Change Your Keyboard Layout: Go down to “Change Keyboard Layout”
Keep it on the “Default English 105 Key”
Go down to “Other”
Choose the language of your keyboard from the list.
Keep the remaining settings on Default.
Change The Timezone: Go down to “Change Timezone”
Choose your continent or region.
Choose your country.
Remove Overscan: Go down to “Advanced Options”
Scroll down to “Overscan”
Choose “No”
Reduce The GPU Memory: Go down to “Advanced Options”
Choose “Memory split”
Change “64” to “16”
Hit “Ok”
Go down to “Finish”
Select “Yes”
sudo nano /etc/rc.local
Create a new line under the last one and type in
# DISPLAY IP ON REBOOT
_IP=$(hostname -I) || true
if [ “$_IP” ]; then
printf “\n*************************************************\n”
printf “Connect to Deluge via http://%s:8112 (Without the space)\n” “$_IP”
printf “*************************************************\n\n”
fi
# DELUGE START ON BOOTsudo -u pi /usr/bin/python /usr/bin/deluge-web &
exit 0
To save this file, press Ctrl X then Y then Enter
Another quick reboot to seal the deal
sudo reboot
sudo nano /etc/samba/smb.conf
Scroll down to “win support”
Delete the “#” and change “no” to “yes”
Go to the very bottom and type in
[TORRENTS]
comment = Torrents
path = /mnt/torrents
create mask = 0755
directory mask = 0755
read only = no
browseable = yes
public = yes
force user = pi
only guest = no”
To save this file, press Ctrl X then Y then Enter
Now we need to reboot the Raspberry Pi once again.
sudo reboot
NOTE: If it doesn’t works, try installing samba and doing another reboot.
sudo apt install samba samba-common-bin -y
sudo reboot
To access from a Windows pc, all you have to do is type \\YOURHOSTNAME or \\YOURIPADDRESS
When it asks for a login information, the username will be “pi” and the password is teh same one you use to log into your Raspberry Pi.
Congratulations, you’ve just created your very own Raspberry Pi Torrentbox, added a VPN to it, configured SAMBA Shares and even changed the host name and that’s it for this tutorial.
Could you do everything by yourself? Did you had any problems during the tutorial? Have any suggestion? Then leave a comment below.
2024 was PACKED with really good new gaming mice releases. Here are the 10 gaming…
Here are my Best Tech Deals for Black Friday in 2024! 17" LG gram (SAVE…
Should you buy the Samsung Galaxy Tab S10+ or the OnePlus Pad 2? Which one…
This video includes websites and apps to watch free movies. Free movie websites and apps…
Coolest Tech of the Month NOV 2024 - EP#96 - Latest Gadgets You Must See!…
I used 50 home automation ideas to automate EVERY minute of my day! Ad: Remove…
View Comments
got an issue, seems as though the deluge-web service isn't starting. I get the error no such file or directory. what do i do? adding the command to the rc.local doesn't seem to work. Worked fine until i changed the hostname.
changed the name back and it didn't do anything.
I'll be doing a re-install soon of mine as I'm upgrading to a Raspberry Pi 3 so I'll test it out again and see if I have any issues :)
I am having the same issue on Rasberry Pi3. You have any luck?
last line should not have ( " )only guest = no”
Should be only guest = no
You should be good to go.
Awesome tutorial btw.
samme issue here, any update?
Hey Mate,
Good tutorial just found aTYPO that caught up myself for a while
sudo apt install deluged -y
sudo service deluge-web -y "should be apt install deluge-web -y"
Thank you kind sir for picking that up. Late night typing never ends well :)
Hey, I followed the steps as listed until I got to "cd /ect/openvpn" and it get the reply no such file or directory. Any ideas on how to solve this?
What speeds is the Raspberry Pi able to maintain (ie 10mbit, 30mbit, 100mbit, 300mbit) and where would you guess the bottlenecks might be? (ie cpu, ram use, data bus, etc.) I've heard someone suggest about 10megabytes/second may be about as fast as an R-pi works due to some bus limit, whether this would be the case or be even slower for torrent or have a different bottleneck i'd be very curious.
Knowledge of bottleneck might suggest alternative single board computers many of which suggest higher performance in some ways.
I find optimally you can get 20mbps. A lot depends on the quality of the VPN, the swarm, the Raspberry Pi edition, etc. A VPN imposes a fair amount of overhead and stress on the resources of the Pi, as the stream has to be encrypted using CPU. However, for light to medium use this project is a great idea.
Possible to add filbot to this setup?
Hello Thank you for the Tutorial.
But im facing a problem with the deluge-web to autostart, it just dont auto start.
I have typed this is in the sudo nano /etc/rc.local
# DISPLAY IP ON REBOOT
_IP=$(hostname -I) || true
if [ “$_IP” ]; then
printf “\n*************************************************\n”
printf “Connect to Deluge via http://%s:8112 (Without the space)\n” “$_IP”
printf “*************************************************\n\n”
fi
# DELUGE START ON BOOT
sudo -u pi /usr/bin/python /usr/bin/deluge-web &
exit 0
-
Now im also facing a problem when i start the web-deluge manually the webserver never start.
I enjoy your channel.I look forward to doing some of those projects When im not a broke ass student.
Torrent Box
Also the twitter part on your give away is broken
I'll look into it shortly. Thanks for the heads up :)
Always interesting.