0%

TorrServer on a VPS: A Secure Remote Streaming Setup

11 мин 2026-08-17T12:00:00+03:00
Rianvy
This post is also available in 🇷🇺 Русский
TorrServer on a VPS: A Secure Remote Streaming Setup

A complete guide to installing TorrServer on a remote VPS, from choosing a server to connecting Lampa securely.

How TorrServer works on a VPS

TorrServer retrieves pieces from the BitTorrent network, keeps a buffer in RAM, and sends the video stream to a client over HTTP or HTTPS. Moving it to a VPS shifts peer-to-peer traffic to the server, but your home connection is still used to receive the finished video stream.

Benefits of this setup include:

  • access from your TV, phone, and laptop outside your home network;
  • 24/7 operation without leaving a home computer running;
  • a fast data-center connection independent of your home upload speed;
  • one server for several personal devices.

The trade-offs are the monthly VPS cost, outbound traffic, and the need to secure and maintain a public server.

What you need

VPS requirements

These are guidelines rather than hard requirements. Actual load depends on the media bitrate, viewer count, cache size, and whether transcoding is enabled.

Resource CPU
Starting point 1 vCPU for standard proxying
Comfortable setup 2+ vCPU; more for GStreamer transcoding
Resource RAM
Starting point 1 GB
Comfortable setup 2 GB for a larger cache or multiple streams
Resource Disk
Starting point 5 GB
Comfortable setup 10 GB with room for the OS, logs, and metadata
Resource Network
Starting point media bitrate plus 30–50% headroom
Comfortable setup a 200 Mbps or faster port
Resource OS
Starting point a modern glibc-based Linux
Comfortable setup Ubuntu 22.04/24.04 or Debian 12/13

TorrServer’s main streaming cache lives in RAM, so you do not need 10–20 GB of disk specifically for the cache. Old distributions and musl-based systems may not run the current binary. The official installer checks the CPU architecture, operating system, and glibc version.

There is no universal rule that every 4K stream needs exactly 100 Mbps. A typical 1080p file may use 10–40 Mbps, while a high-bitrate 4K remux can peak above 100 Mbps. Use the file’s actual bitrate and leave extra headroom.

Choosing a VPS provider

Plans change frequently. Before paying, check the current price, port speed, outbound traffic allowance, and whether BitTorrent is permitted by the provider’s terms.

Provider Aéza
What to verify available regions, plan type, and traffic policy
Link aeza.net
Provider Xorek Cloud
What to verify port speed, traffic allowance, and selected region

For the standard build without transcoding, network capacity and RAM matter most. CPU performance also matters when using the -gst GStreamer build for remuxing or transcoding.

SSH client

The examples use Termius , but any SSH client will work. Termius Starter includes SSH, SFTP, and command autocomplete. Cloud synchronization between mobile and desktop devices is a Pro feature.

Step 1: Prepare the server

Order a VPS with Ubuntu 22.04/24.04 or Debian 12/13. The provider will give you an IP address, a username, and either a password or an SSH key.

On the first connection, compare the server’s SSH fingerprint with the value shown in the provider panel when one is available. Do not blindly accept an unexpected fingerprint.

Connect to the server and update the operating system:

apt update && apt upgrade -y
apt install -y curl ca-certificates

If you are not logged in as root, add sudo before administrative commands.

Step 2: Install TorrServer

Download the installer as a file, inspect it if you wish, and run it interactively:

curl -fsSL https://raw.githubusercontent.com/YouROK/TorrServer/master/installTorrServerLinux.sh \
  -o installTorrServerLinux.sh
chmod 755 installTorrServerLinux.sh
sudo bash ./installTorrServerLinux.sh

Choose the latest release in the menu. The standard build is suitable for direct streaming. Use the -gst build only when you need GStreamer features; it may require more CPU.

The installer:

  • detects the architecture and checks glibc compatibility;
  • installs the binary in /opt/torrserver;
  • creates a dedicated torrserver system user;
  • creates and enables torrserver.service in systemd;
  • can configure logging and HTTP Basic Auth;
  • supports future updates and reconfiguration.

Enable HTTP authentication during installation and choose a unique username and a long password. Credentials are stored in /opt/torrserver/accs.db, while the --httpauth flag enables their validation.

Check the service:

systemctl status torrserver --no-pager
journalctl -u torrserver -n 50 --no-pager

Service management commands:

systemctl restart torrserver
systemctl stop torrserver
systemctl start torrserver

How authentication works

TorrServer does not accept a username and password as the value of -a. The -a or --httpauth option is a boolean switch. Users are stored in accs.db next to config.db:

{
  "admin": "REPLACE_WITH_A_LONG_UNIQUE_PASSWORD"
}

The regular web settings do not provide a separate, reliable way to create these credentials. To change authentication, run the official installer again:

sudo bash ./installTorrServerLinux.sh --reconfigure

Step 3: Test it safely

Do not expose 8090/tcp to the entire internet just to test the installation. Create an SSH tunnel from your computer:

ssh -L 8090:127.0.0.1:8090 root@SERVER_IP

While the SSH session remains open, visit http://127.0.0.1:8090 in your browser and enter the TorrServer username and password.

Basic Auth encodes a password but does not encrypt it. Public access over plain http://IP:8090 is therefore unsafe even with authentication enabled. Use HTTPS or a private VPN for permanent remote access.

Step 4: Configure the firewall

Allow the server’s real SSH port first. If the server uses OpenSSH on the standard port 22:

apt install -y ufw
ufw allow OpenSSH
ufw enable
ufw status verbose

If SSH uses a custom port, allow that port before enabling UFW.

For the recommended Nginx setup, do not create a public rule for port 8090. We will allow HTTP and HTTPS after installing Nginx, when the Nginx Full profile is available.

If you need a temporary direct-access test, restrict it to your device’s current public IP:

ufw allow from YOUR_PUBLIC_IP to any port 8090 proto tcp

Remove that rule after testing with ufw status numbered, followed by ufw delete RULE_NUMBER.

Step 5: Add HTTPS with Nginx

This step requires a domain with an A or AAAA record pointing to the VPS.

Install Nginx and Certbot, then allow web traffic:

apt install -y nginx certbot python3-certbot-nginx
ufw allow 'Nginx Full'
ufw status verbose

Create the virtual host:

nano /etc/nginx/sites-available/torrserver
server {
    listen 80;
    listen [::]:80;
    server_name torr.example.com;

    location / {
        proxy_pass http://127.0.0.1:8090;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Authorization $http_authorization;

        proxy_buffering off;
        proxy_request_buffering off;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
    }
}

Replace torr.example.com with your domain, enable the site, and validate the configuration:

ln -s /etc/nginx/sites-available/torrserver /etc/nginx/sites-enabled/torrserver
nginx -t
systemctl reload nginx
certbot --nginx -d torr.example.com

Use https://torr.example.com after Certbot issues the certificate. Make sure port 8090 is not exposed by UFW or the provider’s cloud firewall.

If you do not have a domain, connecting the VPS and your devices through WireGuard, Tailscale, or another private VPN is safer than publishing TorrServer over HTTP.

Step 6: Connect Lampa

The exact menu location depends on the client version, but it is usually under Settings → TorrServer.

  1. Open the TorrServer settings in Lampa.
  2. Enter the protected address, such as https://torr.example.com.
  3. Save it and run the connection test.
  4. Test playback with a torrent containing content you are legally allowed to watch.

Basic Auth support varies between Lampa builds. If your client provides separate username and password fields, use them. Do not assume that a URL such as https://user:password@torr.example.com will work: web builds often reject embedded credentials or requests to an insecure HTTP resource. In that case, use a VPN or a client/plugin with explicit authentication support instead of disabling server protection.

Alternative: Docker

Install Docker by following the official Docker Engine guide . The example below assumes Nginx runs on the same VPS, so it publishes TorrServer only on the loopback interface.

Create the persistent directory and authentication file:

install -d -m 700 /var/lib/torrserver/config
nano /var/lib/torrserver/config/accs.db
chmod 600 /var/lib/torrserver/config/accs.db

Contents of accs.db:

{
  "admin": "REPLACE_WITH_A_LONG_UNIQUE_PASSWORD"
}

Start the container:

docker run -d \
  --name torrserver \
  --restart unless-stopped \
  -p 127.0.0.1:8090:8090 \
  -e TS_HTTPAUTH=1 \
  -v /var/lib/torrserver:/opt/ts \
  ghcr.io/yourok/torrserver:latest

The persistent data directory in the official image is /opt/ts, not /data. With the default TS_CONF_PATH, the authentication file must be available as /opt/ts/config/accs.db inside the container.

Useful commands:

docker logs -f torrserver
docker restart torrserver
docker stop torrserver
docker start torrserver

To update, pull the new image, recreate the container with the same command, and keep /var/lib/torrserver:

docker pull ghcr.io/yourok/torrserver:latest
docker rm -f torrserver
# Run the docker run command above again.

Performance settings

The current TorrServer defaults are a safe starting point. Change them only after testing a representative file.

Setting Cache size
Default 64 MB
Guideline for a VPS with 1–2 GB RAM 128–256 MB when enough RAM is available
Setting Preload cache
Default 50%
Guideline for a VPS with 1–2 GB RAM 50–75% for inconsistent swarms
Setting Connections limit
Default 25
Guideline for a VPS with 1–2 GB RAM 25–50
Setting Upload rate limit
Default 0 — unlimited
Guideline for a VPS with 1–2 GB RAM limit only when outbound traffic is metered

The upload rate value is expressed in KiB/s: 1024 is approximately 1 MiB/s and 5120 is approximately 5 MiB/s. Setting it too low may reduce your contribution to the swarm. Check the provider’s outbound traffic policy and billing first.

Troubleshooting

The service does not start

systemctl status torrserver --no-pager
journalctl -u torrserver -n 100 --no-pager

Check permissions under /opt/torrserver, validate the JSON in accs.db, and make sure the binary matches the VPS architecture.

Nginx returns 502 Bad Gateway

ss -tlnp | grep 8090
curl -I http://127.0.0.1:8090
nginx -t
journalctl -u nginx -n 50 --no-pager

When a reverse proxy is in use, listening on 127.0.0.1:8090 is normal and safer. The service does not need to be publicly reachable on 0.0.0.0:8090.

Lampa cannot connect

  1. Open the TorrServer address in a browser on the same device.
  2. Check the certificate and use https:// after configuring Certbot.
  3. Confirm that your Lampa build supports Basic Auth.
  4. For a web client, check the browser console for mixed-content and CORS errors.
  5. Inspect journalctl -u torrserver -f or docker logs -f torrserver.

The stream keeps buffering

  1. Compare the file bitrate with both the VPS and home download speeds.
  2. Select a torrent with enough reachable peers.
  3. Increase the cache gradually and monitor RAM with free -h.
  4. Check packet loss and the route between the device and the VPS.
  5. If transcoding is enabled, inspect CPU usage with top.

Updating TorrServer

Do not use an update script that stops the service before a new binary has downloaded successfully. The official installer already provides a safe update command:

curl -fsSL https://raw.githubusercontent.com/YouROK/TorrServer/master/installTorrServerLinux.sh \
  -o installTorrServerLinux.sh
chmod 755 installTorrServerLinux.sh
sudo bash ./installTorrServerLinux.sh --update --silent

Check the service and the path of the running binary afterwards:

systemctl status torrserver --no-pager
systemctl show torrserver -p ExecStart --no-pager

The binary name depends on the CPU architecture and whether you selected the standard or -gst build. List installed files with ls -1 /opt/torrserver/TorrServer-*.

Pros and cons

Pros Access from personal devices away from home
Cons Monthly VPS cost
Pros Runs 24/7
Cons Requires security updates and maintenance
Pros Fast data-center connection
Cons Your home downlink is still used for viewing
Pros Peer traffic moves to the VPS
Cons The provider may limit or prohibit BitTorrent
Pros No always-on home computer required
Cons Multiple streams require more resources

Conclusion

TorrServer on a VPS is useful when you want a personal server for several devices and remote access outside your home network. A modest VPS with 1–2 GB of RAM is usually enough for standard proxying, but choose the plan based on actual media bitrate, outbound traffic limits, and the provider’s rules.

Most importantly, never expose port 8090 without protection. Use a dedicated system user, built-in authentication, HTTPS or a private VPN, and the official update mechanism.

Resource TorrServer repository and documentation
Resource TorrServer releases
Resource Lampa
Resource Docker Engine
Resource Termius
Resource Previous Lampa article
Link 0x69.ru

© 2025 - 2026 0x69.ru

Powered by ❤️

Readme.md

whoami 👨‍💻

$ cat /etc/profile

Username: Rianvy
Real name: Maksim Alexandrov
Age: 28
Location: Tula, RU
Role: Senior Developer & UI/UX Designer 😎

About

This blog is my personal knowledge base, where I push notes about my tech stack, life experience, and everything that triggers my interest => 🚀

Contact

Open for collaboration 🤝 — ready to merge ideas and work on joint projects.

Stack

💻 Programming Languages

  • C#, PHP, JavaScript/TypeScript, Python

⚛️ Frontend

  • React / Next.js, Vue.js / Nuxt.js
  • Tailwind CSS / SCSS
  • Responsive layout (HTML, CSS, JS) 📱

🔧 Backend

  • Laravel, Node.js / Express / NestJS
  • REST APIs

🗄️ Databases

  • MySQL, PostgreSQL, MongoDB, Redis

🛠️ DevOps

  • Docker, Git, CI/CD, Linux 🐧

🎨 Design & Graphics

  • Figma — UI/UX design and prototyping
  • Photoshop — graphics and image editing
  • After Effects — motion design and animation 🎬
My Open Source Projects 🌟
Name VKify
Description A powerful browser extension for customizing VKontakte with ad blocking, themes, privacy mode, and custom CSS
Description A private local-first extension for cleaning Reddit posts, comments, saved items, and votes directly in the browser