How to Install PeerTube (Self-Hosted YouTube Alternative)

PeerTube is a decentralized, open-source video hosting platform — letting you run your own YouTube-style video sharing site, optionally federated with other PeerTube instances via ActivityPub.

What Makes PeerTube Different

Unlike a simple self-hosted media server, PeerTube is built for public video publishing and discovery, with support for federation (interacting with other PeerTube instances) and peer-to-peer video delivery to reduce server bandwidth load.

Prerequisites

  • Ubuntu 22.04/24.04 VPS: 4 vCPU, 4 GB RAM minimum (more for active transcoding)
  • PostgreSQL and Redis
  • A domain name

Step 1 — Install PostgreSQL and Redis

See How to Install and Secure Redis on Ubuntu & Debian and the PostgreSQL installation guides in the Databases category.

Step 2 — Create the PeerTube Database

sudo -u postgres createuser -P peertube
sudo -u postgres createdb -O peertube -E UTF8 -T template0 peertube_prod

Step 3 — Install Node.js and Yarn

See How to Install Node.js on Ubuntu & Debian (with NVM).

Step 4 — Create a Dedicated System User

sudo useradd -m -d /var/www/peertube -s /bin/bash peertube

Step 5 — Download and Install PeerTube

sudo su - peertube
wget -q "https://github.com/Chocobozzz/PeerTube/releases/latest/download/peertube-vLATEST.zip"
unzip peertube-*.zip

Step 6 — Configure PeerTube

cp config/production.yaml.example config/production.yaml
nano config/production.yaml

Set your domain, database credentials, and Redis connection details.

Step 7 — Set Up as a systemd Service

sudo cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now peertube

Step 8 — Configure Nginx as a Reverse Proxy

PeerTube provides a sample Nginx configuration in its installation files — adapt it for your specific domain.

Step 9 — Add HTTPS

sudo certbot --nginx -d yourdomain.com

Step 10 — Create Your Administrator Account

cd /var/www/peertube/peertube-latest
NODE_ENV=production NODE_CONFIG_DIR=/var/www/peertube/config node dist/scripts/create-admin.js -u admin

Configuring Video Transcoding

PeerTube automatically transcodes uploaded videos into multiple resolutions for adaptive playback — this is CPU-intensive; see How to Set Up a Video Transcoding Pipeline with FFmpeg for the underlying process PeerTube automates.

Federation with Other Instances

Under admin settings, you can follow other PeerTube instances, letting their content appear in your instance's federated timeline, and allow other instances to follow yours — entirely optional, and can be disabled for a fully standalone instance.

Storage Planning

Video hosting requires substantial storage that grows with every upload — consider object storage integration (PeerTube supports S3-compatible storage) for scalable, decoupled video storage rather than relying solely on local VPS disk.

Common Errors

Uploads fail or time out — check Nginx's client_max_body_size and proxy timeout settings, which often need increasing well beyond defaults for video upload workflows.

Continue Reading

Browse more articles in Media & Streaming Servers.

  • peertube, self hosted youtube alternative, decentralized video hosting, peertube installation
  • 0 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

İlgili diğer dökümanlar

How to Install Jellyfin Media Server on a VPS

Jellyfin is a free, open-source media server — a fully self-hosted alternative to Plex or...

How to Install Plex Media Server on a VPS

Plex is a widely-used media server platform offering a polished interface and broad device...

How to Set Up Nginx RTMP for Live Video Streaming

Nginx's RTMP module lets you run your own live video streaming server — accepting a stream...

How to Set Up HLS Streaming with Nginx

HTTP Live Streaming (HLS) delivers video by breaking it into small segments served over standard...

How to Install Icecast for Internet Radio Streaming

Icecast is a lightweight, open-source streaming server purpose-built for audio — ideal for...