Skip to main content

Run and Compose

Run​

If using Docker, please still read the previous page of instructions as the configurations will be the same except you'll be setting the variables through env vars instead of the Config.json files (except for the pathTranslators as those can't be set through env vars).

info

For a complete list of all available configuration variables and detailed explanations, see the Configuration Variables page.

There are amd64 containers (most users will need these) and armv8 containers (for Raspberry Pi, Apple M1 etc):

ghcr.io/haveagitgat/tdarr
ghcr.io/haveagitgat/tdarr_node

The 'tdarr' container contains Tdarr_Server and a Tdarr_Node

Set internalNode=true to enable the Node in the Server container.

The 'tdarr_node' container contains a Tdarr_Node

info

For the examples, if on Windows replace the \ at the end of each line with a ^

caution

If running on Raspberry Pi, you may need to add --privileged

Authentication

New installs have authentication on by default, so every Node, including the internal Node in the 'tdarr' container, needs an apiKey to connect. See Authentication to set it up.

For NVIDIA GPUs, the Docker run examples use --gpus=all and the Compose example uses GPU device reservations. Only add --runtime=nvidia or runtime: nvidia if docker info lists an nvidia runtime; otherwise Docker will fail with unknown or invalid runtime name: nvidia.

The following shows an example Docker run command for the 'tdarr' container:

docker run -ti \
-v /docker/tdarr/server:/app/server \
-v /docker/tdarr/configs:/app/configs \
-v /docker/tdarr/logs:/app/logs \
-v /media:/media \
-v /transcode_cache:/temp \
-e "serverIP=0.0.0.0" \
-e "serverPort=8266" \
-e "webUIPort=8265" \
-e "internalNode=true" \
-e "inContainer=true" \
-e "ffmpegVersion=7" \
-e "nodeName=MyInternalNode" \
-e "auth=true" \
-e "apiKey=" \
-e "openBrowser=true" \
-e "maxLogSizeMB=10" \
-e "cronPluginUpdate=" \
--network bridge \
-p 8265:8265 \
-p 8266:8266 \
-e "TZ=Europe/London" \
-e PUID=1000 \
-e PGID=1000 \
-e "NVIDIA_DRIVER_CAPABILITIES=all" \
-e "NVIDIA_VISIBLE_DEVICES=all" \
--gpus=all \
--device=/dev/dri:/dev/dri \
--log-opt max-size=10m \
--log-opt max-file=5 \
ghcr.io/haveagitgat/tdarr
info

Tdarr Nodes connect outbound to the Server on serverPort and do not open an inbound node port. The legacy nodeIP and nodePort variables have not been needed since 2.00.17 (22 March 2022). Existing Docker or Podman configurations can remove any published node-port mapping, such as 8267:8267 or 8268:8268.

Where setting internalNode=true/false enables or disables the Tdarr Node running in the Server container. The apiKey variable is used by that internal Node.

The following shows an example Docker run command for the 'tdarr_node' container (includes extra options for enabling GPUs):

docker run -ti \
-v /docker/tdarr/configs:/app/configs \
-v /docker/tdarr/logs:/app/logs \
-v /media:/media \
-v /transcode_cache:/temp \
-e "nodeName=MyExternalNode" \
-e "serverIP=0.0.0.0" \
-e "serverPort=8266" \
-e "inContainer=true" \
-e "ffmpegVersion=7" \
-e "nodeType=mapped" \
-e "priority=-1" \
-e "cronPluginUpdate=" \
-e "apiKey=" \
-e "maxLogSizeMB=10" \
-e "pollInterval=2000" \
-e "startPaused=false" \
-e "transcodegpuWorkers=1" \
-e "transcodecpuWorkers=2" \
-e "healthcheckgpuWorkers=1" \
-e "healthcheckcpuWorkers=1" \
--network bridge \
-e "TZ=Europe/London" \
-e PUID=1000 \
-e PGID=1000 \
-e "NVIDIA_DRIVER_CAPABILITIES=all" \
-e "NVIDIA_VISIBLE_DEVICES=all" \
--gpus=all \
--device=/dev/dri:/dev/dri \
--log-opt max-size=10m \
--log-opt max-file=5 \
ghcr.io/haveagitgat/tdarr_node

The Server data (database, samples, plugins etc) is now stored in '/app/server'.

As mentioned above, both the Server and the Node need to have access to the same media and transcode cache paths.

To make configuration easier and to set pathTranslators (if required), you can map the configs folder on both the Server and Node:

-v /tdarr_configs:/app/configs \

When viewing '/tdarr_configs', on the host machine, you'll be able to see the Server and Node configuration files:

Tdarr_Node_Config.json
Tdarr_Server_Config.json

Note: Env vars take precedence over the JSON configs. Also, the following folders are chowned on start-up (unless the container starts as a non-root user):

/home/Tdarr
/temp
/logs
/app

Please use the Docker config tool if you need help configuring the Docker run command. If you are new to Docker, have a look at the Docker Guide on the left

Compose​

The following shows a docker-compose example

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
environment:
- TZ=Europe/London
- PUID=${PUID}
- PGID=${PGID}
- UMASK=002
- serverIP=0.0.0.0
- serverPort=8266
- webUIPort=8265
- internalNode=true
- inContainer=true
- ffmpegVersion=7
- nodeName=MyInternalNode
- auth=true
- apiKey= # API key for the internal Node
- openBrowser=true
- maxLogSizeMB=10
- cronPluginUpdate=
- NVIDIA_DRIVER_CAPABILITIES=all
- NVIDIA_VISIBLE_DEVICES=all
volumes:
- /docker/tdarr/server:/app/server
- /docker/tdarr/configs:/app/configs
- /docker/tdarr/logs:/app/logs
- /media:/media
- /transcode_cache:/temp

devices:
- /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]


# node example
tdarr-node:
container_name: tdarr-node
image: ghcr.io/haveagitgat/tdarr_node:latest
restart: unless-stopped
network_mode: service:tdarr
environment:
- TZ=Europe/London
- PUID=${PUID}
- PGID=${PGID}
- UMASK=002
- nodeName=MyExternalNode
- serverIP=0.0.0.0
- serverPort=8266
- inContainer=true
- ffmpegVersion=7
- nodeType=mapped
- priority=-1
- cronPluginUpdate=
- apiKey=
- maxLogSizeMB=10
- pollInterval=2000
- startPaused=false
- transcodegpuWorkers=1
- transcodecpuWorkers=2
- healthcheckgpuWorkers=1
- healthcheckcpuWorkers=1
- NVIDIA_DRIVER_CAPABILITIES=all
- NVIDIA_VISIBLE_DEVICES=all

volumes:
- /docker/tdarr/configs:/app/configs
- /docker/tdarr/logs:/app/logs
- /media:/media
- /transcode_cache:/temp

devices:
- /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]

Running as a non-root user (optional)​

From 3.01.00, both containers can start as a non-root user with no capabilities:

    user: "1000:1000" # uid 1000, or any uid with primary group 0 e.g. "4321:0"
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]

Any other uid:gid also needs group_add: ["0"] and tmpfs: ["/run:exec,uid=<uid>,gid=<gid>"].

PUID/PGID are ignored and nothing is chowned, so mapped folders must already be writable by that user. For hardware transcoding, add the /dev/dri device groups with group_add. Changing ffmpegVersion needs root.