Skip to content

Instantly share code, notes, and snippets.

@zrsmithson
Created December 29, 2020 03:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zrsmithson/ff404086c68249844af6cc28b1e08240 to your computer and use it in GitHub Desktop.
Save zrsmithson/ff404086c68249844af6cc28b1e08240 to your computer and use it in GitHub Desktop.

Introduction

Tdarr is a . The setup/install docs are mostly alright as a guide to figure out how to install for Linux, but I found some specific quirks when installing on Debian that I wanted to document.

These instructions were used to install on Debian 11,, specifically in a vm hosted using kvm on proxmox.

Operating System: Debian GNU/Linux bullseye/sid
          Kernel: Linux 5.9.0-5-amd64
    Architecture: x86-64

In my setup, I have my files on a remote NAS. Some instructions might need some modification if a local folder needs to be used for holding files.

pre-install

Create a tdarr user that will be used to run the service

sudo useradd -r -s /bin/false tdarr
sudo usermod -aG sudo tdarr

Tdarr uses the following folder to store config files, so create it as tdarr user:

sudo -H -u tdarr mkdir -p /home/tdarr/Documents

Some other required dependencies: sudo apt install -y sudo gnupg apt-transport-https lsb-release handbrake-cli git-core p7zip-full nodejs

MongoDB

Get the MongoDB gpg key and add it to a new keyring file

curl https://www.mongodb.org/static/pgp/server-4.2.asc | sudo tee -a /usr/share/keyrings/buster-mongodb-org-4_2.asc

Add a source entry for apt, pointed to this new keyring

echo "deb [signed-by=/usr/share/keyrings/buster-mongodb-org-4_2.asc] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main
# deb-src [signed-by=/usr/share/keyrings/buster-mongodb-org-4_2.asc] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee -a /etc/apt/sources.list.d/mongodb-org-4_2.list

Note: this is apparently the replacement for adding the key directly to the global apt keyring. IT's somewhat new to me, so if you encounter any issues, feel free to revert bac to the deprecated method with curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -

Install mongodb from this newly added repo, enable the service to start at boot and start it

sudo apt update && sudo apt install -y mongodb-org
sudo systemctl enable mongod.service
sudo systemctl start mongod.service

Download the latest Tdarr release

They all can be found here https://github.com/HaveAGitGat/Tdarr/releases. The version I used was v1.2066-Beta, but feel free to update the wget command to the latest version

wget https://github.com/HaveAGitGat/Tdarr/releases/download/v1.2066-Beta/Tdarr-Linux-1.2070.zip

Extract to /usr/local/src

7z x -o/usr/local/src ./Tdarr-Linux-1.2070.zip

Create a systemd service and enable it

Create /etc/systemd/system/tdarr.service with the following:

[Unit]
Description=Tdarr - Audio/Video Library Analytics & Transcode/Remux Automation
Documentation=https://github.com/HaveAGitGat/Tdarr
After=mongod.service
Wants=mongod.service

[Service]
Environment=MONGO_URL=mongodb://localhost:27017/Tdarr
Environment=PORT=8265
Environment=ROOT_URL=http://localhost/
Type=simple
User=tdarr
ExecStart=/usr/bin/node /usr/local/src/Tdarr-Linux-1.2070/bundle/main.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable and start the service

sudo systemctl enable tdarr.service
sudo systemctl start tdarr.service

This should work, but might require a reboot. The server should now be accessible at http://<server_ip>:8265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment