Skip to main content
Bare metal installation requires manual setup of Prowlarr and FlareSolverr. We recommend Docker deployment for easier setup.

Prerequisites

Before installing Plank on bare metal, ensure you have:
  • Node.js: Version 22 or higher
  • npm: Comes with Node.js
  • ffmpeg: For video transmuxing and subtitle processing
  • Git: For cloning the repository
  • Prowlarr: (Optional) For torrent search functionality
  • FlareSolverr: (Optional) For captcha solving on torrent sites

Install Dependencies

# Add Node.js 22 repository
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -

# Install dependencies
sudo apt-get update
sudo apt-get install -y nodejs ffmpeg git

# Verify installations
node -v
npm -v
ffmpeg -version

Installation Steps

1

Clone the repository

git clone https://github.com/logscore/plank.git
cd plank
2

Create environment file

cp .env.example .env
Edit .env with your configuration:
.env
DATABASE_URL=./plank.db
DATA_PATH=./data
TMDB_API_KEY=your_tmdb_api_key

# Use localhost for bare metal
PROWLARR_URL=http://localhost:9696
PUBLIC_PROWLARR_URL=http://localhost:9696
PROWLARR_API_KEY=  # Get from Prowlarr settings

BETTER_AUTH_SECRET=your-random-32-char-secret
BETTER_AUTH_URL=http://localhost:3300

PORT=3300
ENABLE_FILE_STORAGE=true
Generate a secure auth secret:
openssl rand -hex 32
3

Install dependencies

npm install
4

Build the application

npm run build
5

Run database migrations

npx drizzle-kit migrate
6

Start the server

node build
Or for development with live reload:
npm run dev
Access Plank at http://localhost:3300.

Optional: Install Prowlarr & FlareSolverr

For full torrent search functionality, install these services separately.

Prowlarr Installation

# Add Prowlarr repository
sudo apt-get install -y curl sqlite3
curl -o- https://prowlarr.servarr.com/v1/update/master/updatefile?os=linux | sudo bash

# Prowlarr will be available at http://localhost:9696
See the official Prowlarr installation guide for more options.

FlareSolverr Installation

docker run -d \
  --name=flaresolverr \
  -p 8191:8191 \
  -e LOG_LEVEL=info \
  --restart unless-stopped \
  ghcr.io/flaresolverr/flaresolverr:latest
See the FlareSolverr repository for detailed instructions.

Configure Prowlarr

1

Access Prowlarr

Navigate to http://localhost:9696 and complete the initial setup.
2

Get API key

  • Go to SettingsGeneral
  • Copy the API Key
  • Add it to your .env file:
    PROWLARR_API_KEY=your_prowlarr_api_key
    
3

Add FlareSolverr

  • Go to SettingsIndexers
  • Set FlareSolverr URL: http://localhost:8191
4

Add indexers

Configure torrent indexers in Prowlarr:
  • YTS (movies)
  • 1337x (general)
  • The Pirate Bay
  • Nyaa.si (anime)
  • EZTV (TV shows)

Running as a System Service

systemd (Linux)

Create a systemd service file for automatic startup:
1

Create service file

sudo nano /etc/systemd/system/plank.service
Add the following content:
/etc/systemd/system/plank.service
[Unit]
Description=Plank Media Server
After=network.target

[Service]
Type=simple
User=your_username
WorkingDirectory=/path/to/plank
ExecStartPre=/usr/bin/npx drizzle-kit migrate
ExecStart=/usr/bin/node build
Restart=on-failure
RestartSec=5
EnvironmentFile=/path/to/plank/.env

[Install]
WantedBy=multi-user.target
Replace:
  • your_username with your system username
  • /path/to/plank with the full path to your Plank installation
2

Enable and start service

# Reload systemd
sudo systemctl daemon-reload

# Enable service to start on boot
sudo systemctl enable plank

# Start service now
sudo systemctl start plank
3

Manage the service

# Check status
sudo systemctl status plank

# View logs
sudo journalctl -u plank -f

# Restart
sudo systemctl restart plank

# Stop
sudo systemctl stop plank

PM2 (Cross-Platform)

PM2 is a process manager that works on Linux, macOS, and Windows.
1

Install PM2

npm install -g pm2
2

Create PM2 ecosystem file

nano ecosystem.config.js
Add:
ecosystem.config.js
module.exports = {
  apps: [{
    name: 'plank',
    script: 'build/index.js',
    cwd: '/path/to/plank',
    env_file: '.env',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    error_file: './logs/err.log',
    out_file: './logs/out.log',
    log_file: './logs/combined.log',
    time: true
  }]
}
3

Start with PM2

# Start application
pm2 start ecosystem.config.js

# Save PM2 configuration
pm2 save

# Generate startup script
pm2 startup
4

Manage with PM2

# Check status
pm2 status

# View logs
pm2 logs plank

# Restart
pm2 restart plank

# Stop
pm2 stop plank

# Monitor
pm2 monit

Build and Development Commands

CommandDescription
npm installInstall dependencies
npm run buildBuild for production
npm run devStart development server with live reload
npm run previewPreview production build
npm run checkRun type checking and linting
npx drizzle-kit migrateRun database migrations
npx drizzle-kit generateGenerate new migrations
node buildStart production server

Updating Plank

1

Stop the server

# systemd
sudo systemctl stop plank

# PM2
pm2 stop plank

# Manual
# Press Ctrl+C in terminal
2

Pull latest changes

cd /path/to/plank
git pull
3

Rebuild

npm install
npm run build
npx drizzle-kit migrate
4

Restart server

# systemd
sudo systemctl start plank

# PM2
pm2 restart plank

# Manual
node build

Troubleshooting

Increase Node.js memory limit:
export NODE_OPTIONS="--max-old-space-size=4096"
npm run build
Check database file permissions:
ls -la plank.db
chmod 644 plank.db
If the database is corrupted, restore from backup or delete and recreate:
rm plank.db
npx drizzle-kit migrate
Verify Prowlarr is running:
curl http://localhost:9696
Check the API key in .env matches Prowlarr’s settings:
  • Go to Prowlarr → SettingsGeneral
  • Copy the API key
  • Update PROWLARR_API_KEY in .env
  • Restart Plank
Check what’s using the port:
# Linux/macOS
sudo lsof -i :3300

# Or use a different port
PORT=8080 node build
Verify ffmpeg installation:
which ffmpeg
ffmpeg -version
If not found, install it:
# Ubuntu/Debian
sudo apt-get install ffmpeg

# macOS
brew install ffmpeg

Performance Optimization

Node.js Optimization

# Increase max memory
export NODE_OPTIONS="--max-old-space-size=4096"

# Enable production mode
export NODE_ENV=production

Database Optimization

# Optimize SQLite database
sqlite3 plank.db "VACUUM;"
sqlite3 plank.db "PRAGMA optimize;"

Systemd Resource Limits

Add to your systemd service file:
[Service]
MemoryLimit=2G
CPUQuota=200%
IOWeight=500

Next Steps

Environment Variables

Complete configuration reference

Prowlarr Setup

Configure torrent indexers

Security Guide

VPN setup and best practices

Troubleshooting

Common issues and solutions

Build docs developers (and LLMs) love