Portainer Templates logo

Portainer Templates

Tdarr Tdarr

Stack

Multimedia

Tdarr is a popular conditional transcoding application for processing large (or small) media libraries.

Image details

Architecture: amd64, arm64
Image size: 1.4 GB
User: haveagitgat

Source details

Stars: 4k
Forks: 120
Language: Makefile
Updated: 10 days ago

Configuration

Type
Compose
Platform
linux
Image
ghcr.io/haveagitgat/tdarr:latest
Ports
8265:82658266:82668267:82678268:8268
Volumes
/app/server : /portainer/Files/AppData/Config/tdarr/server/app/configs : /portainer/Files/AppData/Config/tdarr/configs/app/logs : /portainer/Files/AppData/Config/logs/media : /portainer/media/temp : /portainer/transcode_cache
Env vars
TZ=Europe/AthensPUID=${PUID}PGID=${PGID}UMASK_SET=002serverIP=0.0.0.0serverPort=8266webUIPort=8265internalNode=truenodeID=MyInternalNode
Restart
unless-stopped
Source

Template by xneo1·Source

Standalone Install

Select an install method, to see config/commands for deploying Tdarr

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select Tdarr, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo
Original stackfile

The compose file this template deploys, straight from its repo:

services:
  tdarr:
    container_name: tdarr
    image: ghcr.io/haveagitgat/tdarr:latest
    restart: unless-stopped
    network_mode: bridge
    ports:
      - 8265:8265 # webUI port
      - 8266:8266 # server port
      - 8267:8267 # Internal node port
      - 8268:8268 # Example extra node port
    environment:
      - TZ=Europe/Athens
      - PUID=${PUID}
      - PGID=${PGID}
      - UMASK_SET=002
      - serverIP=0.0.0.0
      - serverPort=8266
      - webUIPort=8265
      - internalNode=true
      - nodeID=MyInternalNode
    volumes:
      - /portainer/Files/AppData/Config/tdarr/server:/app/server
      - /portainer/Files/AppData/Config/tdarr/configs:/app/configs
      - /portainer/Files/AppData/Config/logs:/app/logs
      - /portainer/media:/media
      - /portainer/transcode_cache:/temp

Or deploy it directly from the source:

git clone https://github.com/xneo1/portainer_templates
cd portainer_templates
docker compose -f Template/Stack/tdarr.yml up -d

More install options in our documentation, or see haveagitgat/tdarr for app-specific guidance.

Tdarr V2: Distributed Transcoding System

Audio/Video Library Analytics & Transcode/Remux Automation


  • FFmpeg/HandBrake + video health checking (Windows, macOS, Linux & Docker)

ImageVersion Reddit Discord

Download/Setup/Installation


About:


More information can be found on the following websites:
https://tdarr.io/
https://docs.tdarr.io/
Builds
Tdarr V2 is a cross-platform conditional based transcoding application for automating media library transcode/remux management in order to process your media files as required. For example, you can set rules for the required codecs, containers, languages etc that your media should have which helps keeps things organized and can increase compatability with your devices. A common use for Tdarr is to simply convert video files from h264 to h265 (hevc), saving 40%-50% in size.
The application is in the form of a click-to-run web-app, comprised of the following 2 components:
  • TdarrServer - Central process which all Nodes connect with
  • TdarrNode - Processes running on same/other devices which collect tasks from the Server

Put your spare hardware to use with Tdarr Nodes for Windows, Linux (including Linux arm/arm64) and macOS.
Designed to work alongside applications like Sonarr/Radarr and built with the aim of modularisation, parallelisation and scalability, each library you add has its own transcode settings, filters and schedule. Workers can be fired up and closed down as necessary, and are split into 4 types - Transcode CPU/GPU and Health Check CPU/GPU. Worker limits can be managed by the scheduler as well as manually. For a desktop application with similar functionality please see HBBatchBeast.
  • Cross-platform Tdarr Nodes which work together with Tdarr Server to process your files
  • GPU and CPU workers
  • Use/create Tdarr Plugins for infinite control on how your files are processed:
https://github.com/HaveAGitGat/TdarrPlugins
  • Audio and video library management
  • 7 day, 24 hour scheduler
  • Folder watcher
  • Worker stall detector
  • Load balancing between libraries/drives
  • Use HandBrake or FFmpeg
  • Tested on a 1,000,000 file dummy library
  • Search for files based on hundreds of properties
  • Library stats
  • Hardware transcoding container (install Nvidia plugin on unRAID/Nvidia runtime container on Ubuntu)


Stats

image ---------------------------------------------------------------------------------------

Nodes

image ---------------------------------------------------------------------------------------

Job reports

image ---------------------------------------------------------------------------------------

Property explorer

image ---------------------------------------------------------------------------------------

Worker verdict history

image ---------------------------------------------------------------------------------------

Plugin stack system

image ---------------------------------------------------------------------------------------

Property search

image ---------------------------------------------------------------------------------------

Library schedule

image ---------------------------------------------------------------------------------------
Tdarr is extremely modular/configurable and the main idea behind it is creating a plugin stack to clean up/standardise your files. For example, a typical plugin stack might look like this:
(1) Transcode non hevc files into hevc

(2) Remove subs

(3) Remove meta data (if title)

(4) Add aac stereo audio if none (eng preferred)

(5) Remove closed captions
In this example, plugins 1,2,3 and 5 are community plugins which are available for you to use immediately. Plugin 4 can be created in the plugin creator interface in Tdarr and will appear as a local plugin.
Each of the plugins are conditional, so are only used if needed. They are located in Tdarr/Documents and are written in JavaScript so if none of the plugins do what you want then you can modify/create new plugins if you have a bit of coding experience (or get the gist from having a look). Steps for doing so are in the README here:https://github.com/HaveAGitGat/Tdarr
Plugins . Ask for help in the Discord channel if need be.
Here is an illustration of how the plugin stack works:
image
For the term 'streams', here is an example of how a file appears in Tdarr search results:
image
That file has 3 streams - a video, audio and subtitle stream. Subtitles and closed captions are very different. Where is the closed caption data in this example? It's embedded inside the h264 video stream.
Extra streams and closed captions which you don't need can cause problems with direct playing and syncing files, so you might as well remove them (it's recommended to use something like Bazarr for subtitles). Even when playing files in programs such as VLC or Kodi, subtitles/closed captions can cause playback delays and make things stuttery for a few seconds when jumping around the video.
Extra streams can also take up a lot of space. Don't be surprised to see some files in your library with 15+ audio/commentary/subtitle tracks in a bunch of different languages. These can take up an extra GB+ per file.
The plugin creator is split into 'Filters' and 'Actions'. Filters encapsulate the actions, so the actions will only be carried out if the filter conditions are met.
Current filters:
Filter by codec

Filter by medium

Filter by age

Filter by resolution

Filter by size
Current actions:
Transcode - HandBrake basic options

Transcode - HandBrake/FFmpeg custom arguments

Transcode - Standardise audio stream codecs

Transcode - Add audio stream

Transcode - Keep one audio stream

Remux container
Some actions/plugins have built-in filters (specified in the plugin creator). This means they'll automatically detect if a file needs to be processed or not (such as the remove subtitles community plugin). Additional filters can be added.
Some of the actions have become quite complicated so take a bit more time. For example, the 'Keep one audio stream' has 16 different outcomes as it tries to determine the best audio stream to keep based on the codec, language and channel count you specify.
If you have a request for a new filter/action, then try and think of it generically so I can implement it in way that other people can configure and apply it to their (slightly) different circumstances. Request on GitHub,Reddit or Discord.
For example, to maximize direct play, a plugin stack like this can be used:
(1) If not in h264, transcode into h264 [h264 is a more universal video codec than others]

(2) If not in mp4, remux into mp4 [mp4 is the most universal container]

(3) Remove subs

(4) Remove closed captions
(5) Add aac stereo audio if none (eng preferred) [very universal audio codec/channel count]

(6) Remove meta-data if title meta detected [Stops annoying titles appearing in Plex]

Serve Tdarr on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying tdarr.example.com to http://tdarr:8265

Add this to your Caddyfile

tdarr.example.com {
	reverse_proxy http://tdarr:8265
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:8265 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :8265
  • Stop the other service, or pick a different host port. In 8265:8265 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:8265. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, tdarr can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 8265

Permission denied on volumes

If the logs show "permission denied", the app can't write to its data folder on the host.

  • Fix the ownership: sudo chown -R ${PUID}:${PGID} /portainer/Files/AppData/Config/tdarr/server (and the same for the other mapped folders)
  • Or set the PUID and PGID variables (defaults ${PUID}:${PGID}) to match your own user, found with id $USER

Image won't pull

Test the pull directly on the host: docker pull ghcr.io/haveagitgat/tdarr:latest

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm64
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A Compose stack

Tdarr is a Compose stack, a set of containers defined in one file and brought up together by Portainer, then started and stopped as a single app.

The app image

An image is the app packed up ready to go, everything Tdarr needs bundled into one download. This template pulls ghcr.io/haveagitgat/tdarr:latest, which Docker fetches once (about 1.4 GB) and then starts your own copy from.

Where the image comes from

Docker pulls its images from registries, public libraries of ready-built apps. Tdarr's comes from the GitHub Container Registry, published by haveagitgat.

Version tags

The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Pin a specific tag if you would rather stay on one version.

Which machines it runs on

Every image is built for particular CPU types. This one ships for amd64, arm64, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.

Ports

A port is the door the app answers on. A mapping like 8265:8265 means it's reachable on port 8265 of your server, where the left number is yours to change and the right one belongs to the app. It opens:

  • 8265:8265
  • 8266:8266
  • 8267:8267
  • 8268:8268

Volumes

A volume is where Tdarr keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:

  • /app/server from /portainer/Files/AppData/Config/tdarr/server on the host
  • /app/configs from /portainer/Files/AppData/Config/tdarr/configs on the host
  • /app/logs from /portainer/Files/AppData/Config/logs on the host
  • /media from /portainer/media on the host
  • /temp from /portainer/transcode_cache on the host

Environment variables

Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Tdarr takes 9 of them, all with defaults you can leave alone or tweak:

  • TZ, defaults to Europe/Athens
  • PUID, pulled from your own environment
  • PGID, pulled from your own environment
  • UMASK_SET, defaults to 002
  • serverIP, defaults to 0.0.0.0
  • serverPort, defaults to 8266
  • webUIPort, defaults to 8265
  • internalNode, defaults to true
  • nodeID, defaults to MyInternalNode

Restart policy

The restart policy here is unless-stopped, so Docker restarts Tdarr after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Users and permissions

The PUID and PGID settings tell it which user and group to act as on your host. Point them at your own account (find yours with id $USER) so the files it writes into your mounted folders come out owned by you rather than root.

Networking

Nothing custom is set, so Tdarr sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.

Container name

Once it's deployed, Portainer names the container tdarr. That's what you'll spot in the containers list and use in commands like docker logs tdarr.

Platform

The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Tdarr up. Add the template list to Portainer once, then deploying Tdarr is a click rather than a wall of config.