Video coming soon…

📹 Setup PeerTube — Self-Hosted Video Platform

Deploy a federated, self-hosted YouTube alternative for video hosting, live streaming, and building your own video community.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install — PeerTube video platform running in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/media/peertube/peertube-ubuntu.sh
chmod +x peertube-ubuntu.sh
sudo bash peertube-ubuntu.sh

Tutorial Steps

1 Download & Run the Installer

The script installs Docker, pulls the PeerTube, PostgreSQL, and Redis images, and starts all containers. PeerTube will be available on port 9000. The installer also configures the required environment variables and volume mounts for persistent video storage.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/media/peertube/peertube-ubuntu.sh
chmod +x peertube-ubuntu.sh
sudo bash peertube-ubuntu.sh

2 Access PeerTube and Create Admin Account

Open your browser and navigate to PeerTube. On first run, create your administrator account with a secure password and configure your instance name, description, and default language. This sets up your personal video community.

http://<your-server-ip>:9000

3 Upload Your First Video

Click "Publish" in the top menu to upload a video. Drag and drop your video file or browse to select it. Fill in the title, description, tags, and privacy settings (Public, Unlisted, or Private). PeerTube will automatically transcode the video into multiple resolutions for adaptive streaming.

4 Configure Federation and Live Streaming

In the Admin panel, enable ActivityPub federation to join the Fediverse and allow other PeerTube instances to follow your channels. To enable live streaming, turn on the live feature in Admin > Configuration, then use OBS or any RTMP client pointing to your server on port 1935 with your stream key.

# RTMP stream URL for OBS
rtmp://<your-server-ip>:1935/live/YOUR_STREAM_KEY

Ports Used

PortPurpose
9000PeerTube Web UI
1935RTMP live streaming
5432PostgreSQL database (internal)

Overview

PeerTube is an open-source, self-hosted video platform using peer-to-peer technology to reduce server bandwidth. Instances can federate with each other via ActivityPub, allowing content to be discovered across the Fediverse. It supports live streaming, playlists, chapters, and a plugin ecosystem.

Why Use It

PeerTube eliminates dependence on YouTube, Vimeo, or other corporate platforms. You control monetization policies, content moderation, data privacy, and storage. Federation means your videos are discoverable from Mastodon, Peertube.social, and other Fediverse platforms without re-uploading.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              PeerTube uses port 9000 for the web interface and port 1935 for RTMP live streaming ingest. Expose port 9000 via HTTPS through a reverse proxy. Open port 1935 in your firewall only if you plan to use live streaming features.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    Alternatives include Jellyfin (private media server, no uploading), Owncast (live streaming only), Odysee (blockchain-based), and Vimeo (cloud, polished). Choose PeerTube for a full YouTube alternative with federation and live streaming on your own server.

                    When Not to Use It

                    Avoid PeerTube if you only need to serve pre-recorded videos to a small private audience — Jellyfin or a simple video web server is much lighter. PeerTube requires significant storage and CPU for video transcoding.

                    PrismaTechWork Professional Help

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      Does PeerTube use peer-to-peer for video delivery?

                      Yes. PeerTube uses WebTorrent to distribute video delivery across viewers. When multiple people watch the same video simultaneously, their browsers share chunks of the video with each other, reducing the bandwidth your server must serve. This is transparent to viewers and works in any modern browser.

                      Can I live stream to PeerTube?

                      Yes. PeerTube supports live streaming via RTMP ingest on port 1935. Configure OBS or any RTMP-compatible streaming software to stream to rtmp://YOUR_SERVER_IP:1935/live with the stream key shown in PeerTube's live stream settings.

                      What is federation and how does it work?

                      Federation means your PeerTube instance communicates with other PeerTube instances via the ActivityPub protocol. Videos on your instance can be followed and shared by users on other instances. Users on Mastodon can also follow your PeerTube channel and see new video posts in their timeline.

                      How much storage does PeerTube require?

                      Storage depends on your video library size. PeerTube stores multiple transcoded versions of each video at different resolutions. A 1-hour 1080p video may require 2 to 5 GB of storage after transcoding. Plan for object storage (S3-compatible) for large libraries to avoid filling your server disk.

                      Can I restrict video access to registered users or specific people?

                      Yes. PeerTube supports video privacy settings: public (visible to all), unlisted (accessible via direct link only), private (visible only to the uploader), and password-protected. You can also restrict upload permissions to admins only, making it a curated platform.

                      Does PeerTube support video chapters and captions?

                      Yes. PeerTube supports chapters defined as timestamps in the video description. For captions and subtitles, upload SRT or VTT files in multiple languages — they appear as selectable subtitle tracks in the video player.

                      Can I use S3 object storage for video files?

                      Yes. PeerTube supports S3-compatible object storage for video files, reducing the load on your server disk. Configure the objectStorage section in your config with your S3 bucket name, region, and credentials. This is recommended for large video libraries.

                      How do I embed PeerTube videos on another website?

                      Each PeerTube video has an embed code available from the video page Share menu. Copy the iframe embed code and paste it into any HTML page. The embedded player respects the video's privacy settings — private videos cannot be embedded.