Putting your RaspberryPi to work with a sleek torrent client & Plex TV setup
Tags: showdev, tutorial, beginners, iot
Published: 2021-12-29 13:18:03

---
title: Putting your RaspberryPi to work with a sleek torrent client & Plex TV setup
published: true
description: A short guide setting up Vuetorrent + qbittorrent and Plex TV on a RaspberryPi or any other hardware
tags: showdev, tutorial, beginners, iot
 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czbyflbmth4syibntzty.png
---

### Intro

I guess we all know that torrents present a fantastic opportunity (amongst other things) for families to digitize their old VHS tapes that contain embarrassing videos of your childhood and then share these videos with others using an efficient BitTorrent protocol. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kfmzsis5suih3o8c3buz.png) 

Then, once everyone has those videos that were supposed to die together with the old technology we also need to watch them, this is where the good guy Plex comes in.

In this short tutorial we will setup a Vuetorrent and Plex combo on a RaspberryPi. Using this installation method you will get few great things out of the box:

- Drag & drop torrent files to download them. You can select individual files from a larger torrent like in any other client.
- Shared directory between torrent client container and Plex so you can view them
- Optional public HTTPS URL to connect to Vuetorrent from anywhere in a form **https://dev-{YOUR ID}.synpse.cloud**

### Hardware

- Raspberry Pi 4
- [5V 3A power supply](https://www.okdo.com/p/okdo-multihead-pi-4-power-supply-5-1v-3a/)
- [128GB SD card](https://www.amazon.co.uk/gp/product/B07NY23WBG/ref=ppx_yo_dt_b_asin_title_o08_s00)


### Software

- [Synpse](https://cloud.synpse.net) - provides app deployment, SSH and HTTPS access.
- [Vuetorrent](https://github.com/WDaan/VueTorrent) - Vuetorrent is a nice looking skin for otherwise a bit dated [qbittorrent](https://www.qbittorrent.org/)
- [Plex](https://www.plex.tv/en-gb/) - probably the best option to stream things locally to your smart TV. 

### Step 1: Install Docker

Depending on your RaspberryPi OS Docker installation might vary but in most cases this script from [https://docs.docker.com/engine/install/ubuntu](https://docs.docker.com/engine/install/ubuntu/) should do the job: 

```
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
```

### Step 2: Install Synpse agent on your device

Log into your [Synpse account](https://cloud.synpse.net/), navigate to the "Devices" section and then click on "Provision". Use the command in your RaspberryPi terminal. This will download, install and initialize the synpse agent.

Once the device has appeared in your Synpse dashboard:

![RaspberryPi](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jupxyd5sx7gay5x584vg.png) 

Once device is visible, click on the "edit labels" from the menu. Add a label 'type: rpi':

![Label your device](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kwny82taaflm99lhp90u.png)
 
In Synpse, applications are installed into the devices based on device labels so it's a good practice to label your devices accordingly.

### Step 3: Create Vuetorrent and Plex deployment

Applications in Synpse are defined in yaml format. If you have used Docker Compose or Kubernetes before, it will feel familiar. You can read more about them [here](https://docs.synpse.net/synpse-core/applications). 

To create the application:
1. Select the namespace (should be 'default' on the left side menu)
2. Click on "New Application" button in the top
3. Copy paste the yaml from below

```yaml
name: torrent
scheduling:
  type: Conditional
  selectors:
    type: rpi
spec:
  containers:
    - name: qbittorrent
      image: cr.hotio.dev/hotio/qbittorrent # Using an image that already contains vuetorrent
      ports:
        - 80:8080
      volumes:
        - /data/qbittorrent/config:/config
        - /media/downloads:/downloads
        - ./vuetorrent:/vuetorrent
      env:
        - name: PUID
          value: "1000"
        - name: PGID
          value: "1000"
        - name: TZ
          value: Europe/London
        - name: UMASK_SET
          value: "022"
        - name: WEBUI_PORT
          value: "8080"
    - name: plex
      image: lscr.io/linuxserver/plex
      networkMode: host # Using host network as it will be exposing quite a few ports for various protocols
      volumes:
        - /data/plex:/config
        - /media/downloads:/media/downloads
      env:
        - name: PUID
          value: "1000"
        - name: PGID
          value: "1000"
        - name: VERSION
          value: docker
        - name: PLEX_CLAIM
          value: "" # Optional, you can get your claim here https://www.plex.tv/claim/

```

**Logging into the Vuetorrent:**

Once deployed, it will take a few seconds or minutes (depending on your internet speed) to download and start the docker containers. Once started, you can access it on *http://{YOUR DEVICE IP}:80* address. Initial username is `admin` and password is `adminadmin`. 

Once logged in, go into settings and configure the UI theme:

![update qbittorrent theme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/od05zuedber8yy7rleoy.png)
 
Then, change your password:

![update vuetorrent password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvrimbhiohi5c6mpj96b.png)
 

**Logging into Plex:**

You can login into it using port *http://{YOUR DEVICE IP}:32400*

### Step 4: Configuring Plex libraries

To see whatever you have downloaded via Vuetorrent to your local machine in Plex. For both Films and TV Shows the media path should be `/media/downloads`:

![configuring library](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zoo1xpc1wz0o5drrv2ka.png)

### Step 5 (optional): Expose it to the internet so you can connect from anywhere

At this step we will enable remote access via HTTPS to our Vuetorrent installation on the RaspberryPi. If you have skipped password setup, please do it, otherwise malicious users or automated bots could hijack your device.

1. Go to your device details
2. In the top right corner set the port to your Vuetorrent port which should be 80
3. Turn on the switch

## Next Steps

### Connect your smart TV

Most TVs now have inbuilt Plex TV apps. You can use it to pair it with your Raspberry Pi server. As long as you are using same account, it should just work.

### Download content

Add a torrent to the Vuetorrent dashboard. Once downloaded, it should appear in your Plex library.


## References

- https://www.qbittorrent.org/ - torrent client
- https://hotio.dev/containers/qbittorrent/ - Docker image with embedded Vuetorrent
- https://hub.docker.com/r/linuxserver/plex/tags - LinuxServer.io provided Plex Docker image
- https://www.plex.tv/en-gb/ - streaming app

---
*Originally published at https://synpse.net/blog/vuetorrent-plex/*