For sharing video content with a specific, controlled audience — a team, family, or private community — a self-hosted private video platform provides full control without third-party platform dependency. This guide covers building one.
Why Build a Private Platform Rather Than Using Public Services
Beyond avoiding third-party platform costs/limits, a self-hosted private platform ensures genuine content privacy (not indexed publicly, not subject to a third-party's content policies) and full control over access and presentation.
Building on PeerTube for a Self-Hosted Foundation
See How to Install PeerTube (Self-Hosted YouTube Alternative) — PeerTube supports private/unlisted video visibility settings natively, making it a reasonable foundation for a private sharing platform rather than building entirely from scratch.
Configuring PeerTube for Genuinely Private Use
# config/production.yaml
signup:
enabled: false
Disable public signup, ensuring only accounts you explicitly create can access the platform — important for genuinely restricting access rather than accidentally leaving registration open.
Setting Videos to Private/Internal Visibility
PeerTube supports per-video visibility settings (public, unlisted, private, internal-to-instance) — use the most restrictive appropriate setting for your genuine sharing intent.
Building a Simpler Custom Solution (Alternative Approach)
app.get('/video/:id', requireAuth, async (req, res) => {
const video = await getVideo(req.params.id);
if (!userHasAccess(req.user, video)) {
return res.status(403).send();
}
res.render('video-player', { video });
});
For simpler needs, a custom-built lightweight application (authenticated video listing plus HLS/direct video serving, see How to Set Up HLS Streaming with Nginx) may be simpler than adapting a full-featured platform like PeerTube.
Implementing Proper Access Control
See How to Build and Secure a REST API on a VPS and general authentication patterns — ensure video access genuinely requires authentication, and that authorization correctly restricts each user to only videos they're meant to access, not relying on unlisted/obscure URLs alone as a security measure.
Never Relying on "Unlisted" as Genuine Security
An unlisted/unguessable URL isn't genuine access control — if the URL is shared or discovered, anyone can access the content; use it as a convenience layer alongside, not instead of, genuine authentication for content requiring real privacy.
Serving Video Efficiently
See How to Configure Nginx for Efficient Large File/Video Delivery — ensure your video serving configuration supports proper range requests (for seeking/scrubbing) and efficient delivery, regardless of whether you're using a full platform or custom implementation.
Considering Storage and Bandwidth for Your Expected Usage
See VPS Requirements for Media Streaming Servers for general capacity planning — even a "private" platform with limited users can have substantial storage/bandwidth needs if video content and usage volume are significant.
Backing Up Private Video Content
See How to Set Up Automated VPS Backups — private/personal video content is often genuinely irreplaceable (family videos, unique recordings); apply appropriate backup discipline given the potentially unique, non-recoverable nature of this content.
Common Errors
Videos accessible despite intended access restrictions — treat this as a genuine security issue; verify access control logic is actually enforced server-side (not just hidden in the frontend UI), a common and serious mistake in custom-built access-restricted applications.
Continue Reading
- How to Install PeerTube (Self-Hosted YouTube Alternative)
- How to Configure Nginx for Efficient Large File/Video Delivery
- How to Set Up Multi-User Access Control for a Media Server
Browse more articles in Media & Streaming Servers.