Skip to content
KiraLT edited this page Oct 10, 2021 · 11 revisions

Heroku

Deploy

Heroku forbids P2P services, so your account can be suspended (learn more)

Deploy to Heroku with one click, works with free tier!

Okteto

Develop on Okteto

Okteto forbids P2P services, so your account can be suspended (learn more).

Deploy to Okteto with one click, works with free tier!

NPM package

npm version npm downloads

The npm module can be installed with npm or yarn on a local machine, depending on your preference.

npm install -g torrent-stream-server

Once installed, you can always run torrent-stream-server --help to see a list of available commands.

Run server

torrent-stream-server serve

Go to http://127.0.0.1:3000

Configuration

You can pass configuration file with -c argument:

torrent-stream-server serve -c config.json

NPX

You can run using NPX:

npx torrent-stream-server serve

From source

CodeQL code style: prettier

git clone https://github.com/KiraLT/torrent-stream-server.git
cd torrent-stream-server
npm install
npm run build
npm run start

Go to http://127.0.0.1:3000

Check Contribution guide for details on how to work with the source.

Docker

Docker

This will start a new instance with the latest version listening on 3000 port (see all versions).

docker run -d --name torrent-stream-server ghcr.io/kiralt/torrent-stream-server:latest

Custom port

If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used:

docker run -d --name torrent-stream-server -p 80:3000 ghcr.io/kiralt/torrent-stream-server:latest

You'll be able to access it on http://localhost

Kubernetes

Deploy with Helm3

# Add repository (add only once)
helm3 repo add torrent-stream-server https://kiralt.github.io/torrent-stream-server
helm3 repo update

# Install or update
helm3 upgrade --install torrent-stream-server torrent-stream-server/torrent-stream-server

Configuration

You can change the configuration by providing values.yaml.

Examples

Add custom domain

helm3 upgrade --set ingress.host=domain.com --install torrent-stream-server torrent-stream-server/torrent-stream-server

Set ENV variables

helm3 upgrade --set env.API_KEY="my key" --install torrent-stream-server torrent-stream-server/torrent-stream-server

VPS

The cheapest way to host something is using VPS (Virtual private server). Check The safest countries to download torrents.

Providers

A list of some cheap VPS providers:

Setup

  1. When buying VPS choose the latest Ubuntu OS
  2. Connect to the server via SSH (use PuTTY on Windows).
  3. Fetch latest packages info: sudo apt update
  4. Update all packages: sudo apt upgrade
  5. Add NodeJS package: curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
  6. Install NodeJS: sudo apt-get install -y nodejs
  7. Install PM2 process manager: sudo npm install pm2 -g
  8. Install Torrent Stream Server: sudo npm install torrent-stream-server -g
  9. Start Torrent Stream Server on port 80 with process manager: sudo PORT=80 pm2 --update-env start torrent-stream-server -- serve

Go to http://127.0.0.1 (replace 127.0.0.1 with your server IP). If you get an unsafe warning - check how to bypass it on chrome.

SSL & custom domain

The easiest way to connect a custom domain and SSL is using Cloudflare DNS. Forward your custom DNS to Cloudflare, then add an A record with your server's IP address. Cloudflare will automatically proxy all requests with that domain and a free SSL certificate.

cloudflare