Skip to main content

Installation

Build the image from the repository and start it with Docker Compose, which already grants the device, capability, volumes, and ports the container needs.

Requirements

Docker memory and CPU limits count as the available resources. VPN connections explains the complete capacity calculation and its fallback.

Build and Start

Run these commands from the repository root:

Repository root
bash
# Check the resolved Compose configuration.
docker compose config

# Build the image and start the container in the background.
docker compose up --build --detach

# Follow the startup logs.
docker compose logs --follow app

On the first start, the container works through these steps:

  1. It checks PUID, PGID, TZ, and the TUN device, and prepares its folders.
  2. It creates /config/database/state.sqlite3 and the installation key at /config/keys/installation.key, then writes Transmission's settings file.
  3. It blocks protected traffic before any Transmission daemon or the VPN controller starts.
  4. It starts the web interface, which prints a one-time claim code to the logs unless a claim secret file is mounted.

tip

The Transmission build runs one compile job at a time by default. A higher TRANSMISSION_BUILD_JOBS build argument runs more jobs at once:

bash
docker compose build --build-arg TRANSMISSION_BUILD_JOBS=4
docker compose up --detach

Run without Compose

Build the image, then pass the same device, capability, volumes, and three published ports to docker run:

bash
docker build --tag transmission-vpn:local .

docker run --detach \
  --name transmission-vpn \
  --restart unless-stopped \
  --user 0:0 \
  --cap-add NET_ADMIN \
  --device /dev/net/tun \
  --env PUID=1000 \
  --env PGID=1000 \
  --env TZ=UTC \
  --publish 22602:22602 \
  --publish 9091:9091 \
  --publish 22605:22605 \
  --volume transmission-vpn-config:/config \
  --volume transmission-vpn-data:/data \
  transmission-vpn:local

warning

On a Docker network without IPv6, wildcard publishing can forward outside IPv6 clients from Docker's private gateway address. It is recommended to use the provided Compose file, whose network has IPv6, or bind the optional remote-access ports to the host's LAN address with --publish <LAN address>:22605:22605 and --publish <LAN address>:9091:9091.

Environment Variables

VariableDefaultDescription
PUID1000User ID that runs unprivileged services and owns app files, from 1 to 60000.
PGID1000Group ID for the same services and files, from 1 to 60000.
TZUTCTime zone name, such as Europe/London, that matches a zone installed in the image.

Compose reads these variables from your shell when it starts the container:

bash
PUID=1001 PGID=1001 TZ=Europe/London docker compose up --build --detach

No environment variable selects the VPN provider or tunnel, holds VPN credentials or keys, or changes Transmission's settings. Those live in the web interface, and settings can also come from a managed configuration file.

Volumes and Ports

Path or portPurpose
/configThe config volume, with the database, the installation key, each connection's Transmission configuration folder, and the optional managed configuration file.
/dataThe data mount, which holds every download.
22602/tcpThe control port, which carries the web interface and the API over plain HTTP.
22605/tcpThe optional web proxy, which carries authenticated HTTP and SOCKS5 traffic from private networks.
9091/tcpThe RPC port, which carries only the optional compatible RPC route over plain HTTP.
  • The container always listens on ports 22602, 22605, and 9091. To reach one on a different host port, change the host side of its mapping, such as "8080:22602" in compose.yml or --publish 8080:22602 with docker run. With host networking, the ports are always 22602, 22605, and 9091.
  • The Compose file keeps /config and /data in named volumes called config and data.
  • The Compose file turns on IPv6 for the container's network, so the web interface sees each IPv6 visitor's own address. Docker Engine 27 or later picks the IPv6 subnet on its own, and on a host without IPv6, you can delete the networks block. IPv6 addresses are often reachable from the internet, so it is recommended to check that your router or host firewall blocks inbound connections to ports 22602, 22605, and 9091.
  • The installation key in /config encrypts the authenticator app's secret, VPN profile contents and connection credentials, and notification secrets, so it is recommended to keep it with the database whenever you copy or move /config, as covered in Updates and Backups.
  • Each Transmission's native RPC uses a separate loopback port inside the container, starting at 9092. These ports are never published.

Upgrade an old /data state mount

Older images kept app state under /data. Stop the old container, change the state folder's mount from -v <state-folder>:/data to -v <state-folder>:/config, and give downloads their own /data mount. On first start, the container moves the old app/keys/installation.key and SQLite files into keys/ and database/ without overwriting anything, and converts a raw 32-byte key to the 64-character lowercase hexadecimal format without changing its key bytes.

An unchanged old run line that mounts only /data is also detected. The container uses that mount as its state directory for the start, performs the same internal layout migration, and logs a warning to move the state mount to /config. It is recommended to change the mount before the next update so /data contains only downloads.

Use Host Folders

It is recommended to mount host folders when you want to reach downloads from the host or back up /config with ordinary file tools. A compose.override.yml file next to compose.yml replaces the named volumes:

compose.override.yml
yaml
services:
  app:
    volumes:
      - ./config:/config
      - ./downloads:/data

It is recommended to set PUID and PGID to the host account that owns the downloads folder. Storage and Permissions covers the ownership rules.

Next Steps