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 clienttarget 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 torrplay2. Build the Web Client Static Assets
make clientThis 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/torrplayThis embeds the static web assets into the single Go binary torrplay.
Running the Application
./torrplayBy default, TorrPlay listens on port 8090. Access the web UI at http://localhost:8090.
Command Line Flags
./torrplay --helpUsage 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:
| OS | Default 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 dockerLast updated on