Skip to content
Building from Source

Building from Source

This guide covers compiling TorrPlay manually from source code.


Build Pipeline Overview

    graph LR
    Client["Next.js Frontend (client/)"] -->|pnpm build| Export["Static Assets (client/out/)"]
    Export -->|make client| WebStatic["Go Embed (web/static/)"]
    WebStatic -->|go build| Binary["TorrPlay Executable (torrplay)"]
  

Prerequisites

  • Go (version 1.26 or later)
  • Make (for static client build automation)
  • Node.js 24+ and pnpm 10+, or Docker (the make client target uses local pnpm when available and otherwise falls back to Docker)

Build Steps

1. Clone the Repository

git clone https://github.com/torrplay/torrplay.git
cd torrplay

2. Build the Web Client Static Assets

make client

This compiles the Next.js frontend with local pnpm when available, or falls back to Docker, then copies the exported static web files into ./web/static/.

3. Build the Application Binary

go build -o torrplay ./cmd/torrplay

This embeds the static web assets into the single Go binary torrplay.


Running the Application

./torrplay

By default, TorrPlay listens on port 8090. Access the web UI at http://localhost:8090.


Command Line Flags

./torrplay --help
Usage of ./torrplay:
  -data-dir string
        directory for storing configuration files (default "/home/user/.config/TorrPlay")
  -ipaddr string
        IP address to listen on (default "0.0.0.0")
  -port int
        port to listen on, overrides settings (default -1)

Default Data Directory Paths

The -data-dir flag specifies the directory for storing configuration and database files:

OSDefault Path
Linux / Unix$XDG_CONFIG_HOME/TorrPlay or $HOME/.config/TorrPlay
macOS$HOME/Library/Application Support/TorrPlay
Windows%AppData%\TorrPlay

Building Docker Image Locally

make docker
Last updated on