PeerTube: Federated Video Platform
YouTube alternative with ActivityPub. Host videos with federation support.
PeerTube is a free, decentralized video hosting platform that puts you in control of your content while connecting you to a global federation of independent video platforms. It’s a privacy-respecting, censorship-resistant alternative to centralized platforms like YouTube.
What is PeerTube?
PeerTube is a federated video platform built on ActivityPub, the same protocol powering Mastodon and the broader Fediverse. Instead of relying on a single corporate entity, PeerTube creates a network of independent instances that can share content and audiences while maintaining individual ownership and control.
Why Choose PeerTube?
Decentralization and Federation:
- Join a network of independent instances
- Follow creators across different PeerTube servers
- No single point of failure or censorship
- Own your instance, own your data
Privacy and Freedom:
- No algorithmic manipulation
- No data mining or tracking
- No arbitrary content restrictions
- Full control over your platform rules
Advanced Features:
- WebTorrent/P2P video distribution
- Live streaming support (RTMP and HLS)
- Multiple quality transcoding
- Plugins and customization
- Federation with Fediverse (Mastodon, etc.)
Cost Effective:
- No revenue sharing with platform
- Bandwidth shared via P2P
- Scale with your community
- Self-hosted infrastructure
PeerTube vs. Centralized Platforms
| Feature | PeerTube | YouTube | Vimeo |
|---|---|---|---|
| Monthly Cost | $0 | $0 (ads/revenue share) | $0-$75+ |
| Content Ownership | Full | Limited | Limited |
| Federation | Yes | No | No |
| Privacy | Complete | Minimal | Limited |
| Monetization Control | 100% yours | 45% revenue share | Platform fees |
| Algorithmic Feed | Optional | Forced | Limited |
| P2P Bandwidth | Included | N/A | N/A |
| Live Streaming | Included | Requires subscribers | Premium only |
Prerequisites
Before starting, ensure you have:
- Docker and Docker Compose installed
- At least 4GB RAM (8GB+ recommended)
- CPU with hardware transcoding (Intel Quick Sync or NVIDIA GPU highly recommended)
- Storage for videos (starts at 50GB, grows with content)
- PostgreSQL and Redis (included in Docker setup)
- Domain name (required for federation)
- Email server or SMTP credentials (for notifications)
- Stable internet connection
Understanding PeerTube Architecture
PeerTube consists of several components:
Web Server: Node.js application serving the platform Database: PostgreSQL for metadata and user data Redis: Caching and job queue management Transcoding: FFmpeg with hardware acceleration Storage: Object storage for videos (local or S3-compatible) P2P Distribution: WebTorrent for bandwidth sharing Federation: ActivityPub for cross-instance communication
Directory Structure
Create organized directories for PeerTube:
# Create PeerTube directories
mkdir -p /opt/peertube/{config,data,postgresql,redis}
# Set ownership
sudo chown -R $USER:$USER /opt/peertube Directory Explanation:
/opt/peertube/config: PeerTube configuration files/opt/peertube/data: Video files, thumbnails, torrents/opt/peertube/postgresql: Database storage/opt/peertube/redis: Cache and job queue data
Docker Compose Configuration
Complete Production Setup
Create /opt/peertube/docker-compose.yml:
version: '3.8'
services:
peertube:
image: chocobozzz/peertube:production-bookworm
container_name: peertube
restart: unless-stopped
ports:
- "9000:9000" # Web interface
- "1935:1935" # RTMP for live streaming
volumes:
- /opt/peertube/data:/data
- /opt/peertube/config:/config
environment:
- PEERTUBE_DB_USERNAME=peertube
- PEERTUBE_DB_PASSWORD=peertube_secure_password_change_me
- PEERTUBE_DB_HOSTNAME=postgres
- PEERTUBE_REDIS_HOSTNAME=redis
- PEERTUBE_WEBSERVER_HOSTNAME=peertube.yourdomain.com
- PEERTUBE_WEBSERVER_PORT=443
- PEERTUBE_WEBSERVER_HTTPS=true
- [email protected]
- PEERTUBE_SMTP_HOSTNAME=smtp.gmail.com
- PEERTUBE_SMTP_PORT=587
- [email protected]
- PEERTUBE_SMTP_USERNAME=your-[email protected]
- PEERTUBE_SMTP_PASSWORD=your-app-password
- PEERTUBE_SMTP_TLS=true
depends_on:
- postgres
- redis
postgres:
image: postgres:16-alpine
container_name: peertube-postgres
restart: unless-stopped
volumes:
- /opt/peertube/postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_USER=peertube
- POSTGRES_PASSWORD=peertube_secure_password_change_me
- POSTGRES_DB=peertube
redis:
image: redis:7-alpine
container_name: peertube-redis
restart: unless-stopped
volumes:
- /opt/peertube/redis:/data
command: redis-server --appendonly yes Important Configuration Notes:
- Change all passwords to strong values
- Set your domain in
PEERTUBE_WEBSERVER_HOSTNAME - Configure SMTP for email notifications
- HTTPS is strongly recommended for federation
With Hardware Transcoding (Intel Quick Sync)
Add device mapping for Intel hardware transcoding:
version: '3.8'
services:
peertube:
image: chocobozzz/peertube:production-bookworm
container_name: peertube
restart: unless-stopped
ports:
- "9000:9000"
- "1935:1935"
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0
group_add:
- "109" # render group ID - check with: getent group render
volumes:
- /opt/peertube/data:/data
- /opt/peertube/config:/config
environment:
- PEERTUBE_DB_USERNAME=peertube
- PEERTUBE_DB_PASSWORD=peertube_secure_password_change_me
- PEERTUBE_DB_HOSTNAME=postgres
- PEERTUBE_REDIS_HOSTNAME=redis
- PEERTUBE_WEBSERVER_HOSTNAME=peertube.yourdomain.com
- PEERTUBE_WEBSERVER_PORT=443
- PEERTUBE_WEBSERVER_HTTPS=true
- [email protected]
- PEERTUBE_TRANSCODING_ENABLED=true
- PEERTUBE_TRANSCODING_THREADS=4
- PEERTUBE_TRANSCODING_PROFILE=vod_profile
depends_on:
- postgres
- redis
postgres:
image: postgres:16-alpine
container_name: peertube-postgres
restart: unless-stopped
volumes:
- /opt/peertube/postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_USER=peertube
- POSTGRES_PASSWORD=peertube_secure_password_change_me
- POSTGRES_DB=peertube
redis:
image: redis:7-alpine
container_name: peertube-redis
restart: unless-stopped
volumes:
- /opt/peertube/redis:/data
command: redis-server --appendonly yes With NVIDIA GPU Transcoding
For NVIDIA hardware transcoding:
version: '3.8'
services:
peertube:
image: chocobozzz/peertube:production-bookworm
container_name: peertube
restart: unless-stopped
runtime: nvidia
ports:
- "9000:9000"
- "1935:1935"
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
- PEERTUBE_DB_USERNAME=peertube
- PEERTUBE_DB_PASSWORD=peertube_secure_password_change_me
- PEERTUBE_DB_HOSTNAME=postgres
- PEERTUBE_REDIS_HOSTNAME=redis
- PEERTUBE_WEBSERVER_HOSTNAME=peertube.yourdomain.com
- PEERTUBE_WEBSERVER_PORT=443
- PEERTUBE_WEBSERVER_HTTPS=true
- [email protected]
- PEERTUBE_TRANSCODING_ENABLED=true
- PEERTUBE_TRANSCODING_THREADS=0
volumes:
- /opt/peertube/data:/data
- /opt/peertube/config:/config
depends_on:
- postgres
- redis
postgres:
image: postgres:16-alpine
container_name: peertube-postgres
restart: unless-stopped
volumes:
- /opt/peertube/postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_USER=peertube
- POSTGRES_PASSWORD=peertube_secure_password_change_me
- POSTGRES_DB=peertube
redis:
image: redis:7-alpine
container_name: peertube-redis
restart: unless-stopped
volumes:
- /opt/peertube/redis:/data
command: redis-server --appendonly yes Deployment
Verify Hardware Access
For Intel Quick Sync:
# Check devices exist
ls -la /dev/dri/
# Verify permissions
groups $USER
# Add if missing
sudo usermod -a -G video,render $USER
# Verify render group ID
getent group render For NVIDIA:
# Test NVIDIA runtime
docker run --rm --runtime=nvidia nvidia/cuda:12.0-base nvidia-smi
# Verify NVIDIA Container Toolkit
nvidia-ctk --version Start PeerTube
cd /opt/peertube
docker-compose up -d Monitor Startup
# Watch logs
docker logs -f peertube
# Look for successful startup
# "HTTP server listening on port 9000"
# "Database ready" First startup takes several minutes as PeerTube initializes the database.
Create Admin Account
# Create initial admin user
docker exec -it peertube npm run reset-password -- -u root
# Set admin email and password when prompted Access Web Interface
Access https://peertube.yourdomain.com (after setting up reverse proxy) or http://YOUR-SERVER-IP:9000
Login:
- Username: root
- Password: The one you just set
Reverse Proxy Setup with Caddy
PeerTube requires a reverse proxy for production use. Caddy is recommended for automatic SSL.
Install Caddy
Create /opt/caddy/docker-compose.yml:
version: '3.8'
services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /opt/caddy/Caddyfile:/etc/caddy/Caddyfile
- /opt/caddy/data:/data
- /opt/caddy/config:/config Create Caddyfile
Create /opt/caddy/Caddyfile:
peertube.yourdomain.com {
reverse_proxy peertube:9000
# Increase timeouts for large video uploads
request_body {
max_size 8GB
}
# WebSocket support for live streaming
@websocket {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websocket peertube:9000
} Start Caddy
cd /opt/caddy
docker-compose up -d Caddy automatically obtains SSL certificate from Let’s Encrypt.
Configure DNS
Create DNS A record:
- Name: peertube
- Type: A
- Value: YOUR-PUBLIC-IP
- TTL: 3600
Wait for DNS propagation (5-30 minutes).
Initial Configuration
Admin Setup
Access https://peertube.yourdomain.com and log in as root.
Step 1: Instance Information
- Navigate to Administration → Configuration → Instance
- Instance Details:
- Instance name: Your PeerTube Name
- Short description: Brief tagline
- Description: Detailed about your instance
- Terms of service: Your TOS
- Code of conduct: Community guidelines
- Moderation information: Your moderation policy
Step 2: Instance Settings
- Administration → Configuration → Basic
- Categories: Enable video categories you’ll use
- Languages: Select supported languages
- Default NSFW policy: Blur, Hide, or Display
- Instance default theme: Dark or Light
Step 3: Contact Information
- Administrator email: [email protected]
- Contact form: Enable if desired
- Services section: Link your other platforms
Transcoding Configuration
Enable Hardware Transcoding:
- Administration → Configuration → Transcoding
- Enable transcoding: Yes
- Enable HLS transcoding: Yes (recommended)
- Enable WebTorrent transcoding: Yes
- Transcoding threads: 0 (automatic) or number of cores
Video Resolutions: Select which resolutions to transcode:
- 240p: Mobile/very slow connections
- 360p: Low quality
- 480p: Standard definition
- 720p: HD (recommended minimum)
- 1080p: Full HD (recommended)
- 1440p: 2K (optional)
- 2160p: 4K (if storage permits)
Profile Configuration:
Transcoding profile: vod_profile
For Intel Quick Sync:
- Video codec: h264_qsv
- Additional parameters:
-preset medium
For NVIDIA NVENC:
- Video codec: h264_nvenc
- Additional parameters:
-preset p4 -tune hq
For CPU:
- Video codec: libx264
- Additional parameters:
-preset veryfast
Live Streaming Transcoding:
- Enable live streaming: Yes
- Allow live streaming: Yes
- Live transcoding: Yes
- Maximum live instances running: 10 (adjust based on resources)
- Maximum live duration: 3 hours (adjust as needed)
Storage Configuration
Video Storage:
Administration → Configuration → Storage
Object Storage (optional but recommended):
- Enable: For scalability
- S3-compatible endpoint: For MinIO or AWS S3
- Bucket name: peertube-videos
- Prefix: videos/
- Access key and secret key
Local Storage (default):
- Videos directory: /data/videos
- Streaming playlists: /data/streaming-playlists
Storage Quotas:
- Administration → Configuration → Users
- Default video quota per user: 5 GB (adjust)
- Default daily upload limit: 2 GB (adjust)
Federation Configuration
Enable Federation:
- Administration → Configuration → Federation
- Enable federation: Yes
- Federate unlisted videos: No (recommended)
- Follow instance: Automatically follow back: No (manual control)
Following Other Instances:
- Administration → Federation → Following
- Add instances to follow:
- Enter instance URL:
https://other-peertube.com - Click Follow
- Enter instance URL:
- Followed instances share their videos in your federated feed
Instance Blocklist:
- Administration → Federation → Blocklist
- Block unwanted instances:
- Add instance domain to block
- Prevents federation with that instance
Public Instance List:
- Administration → Configuration → Instance
- List your instance on public directory: Yes (optional)
- Helps others discover your instance
User Management
Creating Users
Manual User Creation:
- Administration → Users → Create user
- Username: newuser
- Email: [email protected]
- Password: Auto-generate or set
- Video quota: 5 GB
- Role: User or Moderator
User Registration:
- Administration → Configuration → Signup
- Enable signup: Yes or No
- Signup limit: Maximum users allowed
- Require email verification: Yes (recommended)
- User default video quota: 5 GB
User Roles
Role Types:
- User: Upload videos, create channels
- Moderator: Manage content, moderate comments
- Administrator: Full system access
Moderator Permissions:
- Select user → Edit
- Role: Moderator
- Grant permissions:
- Remove any video
- Block/unblock users
- Manage comments
- Access abuse reports
Channel Management
Channels are how users organize content:
- Users create channels for different topics
- Each channel has its own branding
- Channels can be followed independently
Admin Channel Management:
- Administration → Video Channels
- View all channels
- Remove inappropriate channels
- Feature quality channels
Video Upload and Management
Upload Interface
Manual Upload:
- Click “Upload” icon (top right)
- Select video file
- Video Details:
- Title: Descriptive title
- Description: Detailed information
- Channel: Select channel
- Category: Choose category
- License: Select appropriate license
- Language: Video language
- Tags: Relevant keywords
- Privacy: Public, Unlisted, Private, Internal
Advanced Options:
- Enable comments: Yes/No
- Enable download: Yes/No
- Wait for transcoding: Process before publishing
- Schedule publication: Publish at specific time
Video Processing
Transcoding Queue:
- Administration → Jobs
- View transcoding jobs
- Monitor progress
- Retry failed jobs
Processing Priority:
- Live streams: Highest priority
- Recently uploaded: High priority
- Older content: Background processing
Playlist Management
Create Playlists:
- My Library → Playlists → Create
- Name: Playlist title
- Description: What the playlist contains
- Privacy: Public, Unlisted, Private
- Add videos to playlist
Featured Playlists: Admins can feature playlists on homepage:
- Administration → Homepage
- Add playlist to featured section
Live Streaming Setup
Enable Live Streaming
System Configuration:
- Administration → Configuration → Live Streaming
- Enable live streaming: Yes
- Max live streaming instances: 10
- Max duration per live: 3 hours
- Allow replay: Yes (save stream as VOD)
User Live Permissions:
- Administration → Configuration → Live Streaming
- Allow users to create live streams: Yes
- Live transcoding: Yes (multiple qualities)
Create Live Stream
As User:
Click “Upload” → “Go Live”
Live Settings:
- Title: Stream title
- Description: What you’ll stream
- Category: Gaming, Education, etc.
- Privacy: Public, Unlisted, Private
- Save replay: Yes (converts to VOD after)
Get Stream Key:
- RTMP URL:
rtmp://peertube.yourdomain.com/live - Stream Key: Generated unique key
- Copy both for OBS
- RTMP URL:
OBS Configuration for PeerTube
Stream Settings:
- Settings → Stream
- Service: Custom
- Server:
rtmp://peertube.yourdomain.com/live - Stream Key: Your PeerTube live stream key
Output Settings:
- Settings → Output → Streaming
- Encoder: Hardware encoder (NVENC/QuickSync) or x264
- Rate Control: CBR
- Bitrate: 4500 kbps (1080p) or 2500 kbps (720p)
- Keyframe Interval: 2
- Preset: Quality or High Quality
Video Settings:
- Settings → Video
- Base Resolution: 1920x1080
- Output Resolution: 1920x1080 or 1280x720
- FPS: 30 or 60
Start Streaming:
- Configure scenes in OBS
- Click “Start Streaming”
- Stream appears live on PeerTube
- Monitor viewer count in PeerTube
Stream Replay: After stream ends:
- Automatically saved as video (if enabled)
- Appears in your channel
- Transcoded to multiple qualities
Federation in Detail
How Federation Works
ActivityPub Protocol:
- PeerTube uses ActivityPub for federation
- Compatible with Mastodon, Pixelfed, etc.
- Users can follow channels from their Mastodon account
- Video posts appear in Fediverse feeds
Following Other Instances:
- Your instance can follow other PeerTube instances
- Videos from followed instances appear in federated feed
- Users can follow channels across instances
- Comments and likes federate across instances
Setting Up Federation
Follow an Instance:
- Administration → Federation → Following
- Enter instance URL:
https://other-peertube.com - Click “Follow”
- Other instance may require approval
Instance Discovery: Browse PeerTube instances:
- instances.joinpeertube.org
- Find instances by topic, language, size
- Follow instances aligned with your content
Cross-Instance Following: Users from other instances can follow your channels:
- Share channel URL:
https://peertube.yourdomain.com/c/channel-name - Users paste in their instance search
- Click follow
- Updates federate automatically
Moderating Federated Content
Block Instances:
- Administration → Federation → Muted Instances
- Add instance domain to block
- Prevents all interaction with that instance
Mute Accounts:
- Administration → Moderation → Muted Accounts
- Mute problematic accounts from other instances
- Hides their comments and interactions
Advanced Features
Plugins and Themes
Install Plugins:
- Administration → Plugins/Themes
- Search available plugins
- Popular plugins:
- Auto Block Videos: Automatically moderate content
- YouTube Import: Import videos from YouTube
- RSS Feed: Generate RSS feeds
- OpenID Connect: SSO authentication
Install Custom Plugin:
docker exec -it peertube npm run plugin:install -- --path /path/to/plugin Custom Themes:
- Administration → Plugins/Themes → Themes
- Install community themes
- Set as default or user-selectable
Video Import
Import from URL:
- Upload → Import
- Enter video URL (YouTube, Vimeo, etc.)
- Video downloads and transcodes
- Appears in your channel
Bulk Import: For migrating large libraries:
# Use PeerTube CLI
docker exec -it peertube npm run import-videos -- --target-url https://peertube.yourdomain.com --channel-name your-channel --import-url https://youtube.com/playlist?list=PLAYLIST_ID Search and Discovery
Configure Search:
- Administration → Configuration → Search
- Enable search index: Yes
- Search in descriptions: Yes
- Search in tags: Yes
External Search Engines: PeerTube instances can be indexed:
- sepiasearch.org: PeerTube-specific search
- Standard search engines via sitemap
P2P and WebTorrent
P2P Video Distribution:
- Viewers help distribute video via WebTorrent
- Reduces server bandwidth significantly
- More viewers = more distributed bandwidth
Configure P2P:
- Administration → Configuration → P2P
- Enable P2P: Yes
- Viewers share video while watching
- Disable per-video if needed
Privacy Considerations:
- P2P reveals viewer IP addresses
- Can be disabled per-video
- Users can disable in their settings
Performance Optimization
Transcoding Optimization
Hardware Transcoding Benefits:
- Intel Quick Sync: 5-10x faster than CPU
- NVIDIA NVENC: 10-15x faster than CPU
- Lower CPU usage and power consumption
- Handle more concurrent transcodes
Optimize Transcoding Queue:
- Administration → Jobs
- Monitor job queue
- Increase concurrent jobs if resources allow
- Schedule heavy transcoding during off-peak
Storage Optimization
Object Storage (S3): For large deployments, use object storage:
MinIO Setup:
# Add to docker-compose.yml
minio:
image: minio/minio:latest
container_name: peertube-minio
command: server /data --console-address ":9001"
ports:
- "9100:9000"
- "9101:9001"
volumes:
- /opt/minio/data:/data
environment:
- MINIO_ROOT_USER=peertube
- MINIO_ROOT_PASSWORD=minio_secure_password Configure PeerTube for MinIO:
- Create bucket in MinIO console
- Administration → Configuration → Object Storage
- Enable object storage: Yes
- Endpoint: http://minio:9000
- Access key: peertube
- Secret key: minio_secure_password
- Bucket: peertube-videos
Database Optimization
PostgreSQL Tuning:
Edit /opt/peertube/postgresql/postgresql.conf:
# Memory settings
shared_buffers = 2GB
effective_cache_size = 6GB
work_mem = 64MB
# Performance
max_connections = 200
random_page_cost = 1.1
# Logging
log_min_duration_statement = 1000 Database Maintenance:
# Vacuum database monthly
docker exec peertube-postgres vacuumdb -U peertube -d peertube --analyze
# Reindex if needed
docker exec peertube-postgres reindexdb -U peertube -d peertube Monitoring and Analytics
Built-in Statistics
Instance Statistics:
- Administration → Stats
- View metrics:
- Total videos
- Total users
- Total local comments
- Total video views
Video Analytics:
- My Library → Videos
- Select video → Stats
- View:
- Total views
- Views per day
- Watch time
- Retention graph
External Monitoring
Prometheus Metrics: Enable in production.yaml:
metrics:
enabled: true
prometheus:
endpoint: /metrics Add to Prometheus configuration:
scrape_configs:
- job_name: 'peertube'
static_configs:
- targets: ['peertube:9000']
metrics_path: '/metrics' Grafana Dashboard: Import PeerTube dashboard for Grafana:
- Visualization of video views
- Transcoding queue length
- Federation activity
- Storage usage
Troubleshooting
Common Issues
Issue: Videos Not Transcoding
Diagnostics:
# Check transcoding jobs
docker exec peertube npm run jobs:list
# Check FFmpeg
docker exec peertube ffmpeg -version
# View logs
docker logs peertube | grep -i transcode Solutions:
- Verify hardware device mapping
- Check transcoding enabled in settings
- Ensure sufficient disk space
- Review job queue for errors
Issue: Federation Not Working
Diagnostics:
# Test ActivityPub endpoint
curl https://peertube.yourdomain.com/.well-known/webfinger
# Check federation logs
docker logs peertube | grep -i federation Solutions:
- Verify HTTPS is working correctly
- Check firewall allows outbound connections
- Ensure domain is publicly accessible
- Verify WebFinger endpoint responds
Issue: High Database Load
Solutions:
- Run VACUUM ANALYZE on database
- Increase PostgreSQL shared_buffers
- Add database indexes if needed
- Enable connection pooling
Issue: Upload Failures
Solutions:
- Check disk space:
df -h - Verify user quota hasn’t been exceeded
- Increase max upload size in Caddy
- Check file permissions on data directory
Issue: SMTP Not Sending Emails
Diagnostics:
# Test SMTP configuration
docker logs peertube | grep -i smtp Solutions:
- Verify SMTP credentials
- Check SMTP port is correct (587 for TLS)
- Enable “less secure apps” if using Gmail
- Use app-specific password for Gmail
- Test with different SMTP provider
Security Best Practices
Access Control
Admin Account Security:
- Use strong password (20+ characters)
- Enable 2FA via plugin if available
- Limit admin accounts to necessary personnel
- Regular password rotation
User Registration:
- Require email verification
- Enable manual approval if desired
- Set reasonable upload quotas
- Monitor new user activity
Network Security
Firewall Configuration:
# Allow HTTP/HTTPS
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Allow RTMP for live streaming
sudo ufw allow 1935/tcp
# Restrict direct access to PeerTube port
sudo ufw deny 9000/tcp SSL/TLS:
- Use strong cipher suites
- Keep SSL certificates updated
- Use HSTS headers
- Disable old TLS versions
Content Moderation
Abuse Reports:
- Administration → Moderation → Abuse Reports
- Review reported content
- Take action: Remove, warn, ban user
Auto-Moderation:
- Install auto-moderation plugins
- Configure word filters
- Block known spam accounts
- Enable CAPTCHA for signup
DMCA Compliance:
- Create clear DMCA policy
- Respond promptly to takedown requests
- Keep logs of requests and actions
- Consider DMCA agent registration
Backup and Recovery
Database Backup
Automated Backup Script:
#!/bin/bash
# /opt/scripts/backup-peertube.sh
BACKUP_DIR="/backups/peertube"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
# Backup PostgreSQL database
docker exec peertube-postgres pg_dump -U peertube peertube | gzip > $BACKUP_DIR/peertube-db-$DATE.sql.gz
# Backup configuration
tar -czf $BACKUP_DIR/peertube-config-$DATE.tar.gz /opt/peertube/config
# Keep last 14 backups
ls -t $BACKUP_DIR/peertube-db-*.sql.gz | tail -n +15 | xargs -r rm
ls -t $BACKUP_DIR/peertube-config-*.tar.gz | tail -n +15 | xargs -r rm
echo "Backup completed: $BACKUP_DIR/peertube-db-$DATE.sql.gz" Schedule with Cron:
# Daily at 2 AM
0 2 * * * /opt/scripts/backup-peertube.sh Video Backup
Backup Strategy:
- Videos stored in
/opt/peertube/data/videos - Large storage requirements
- Consider incremental backups
Using Restic:
# Install restic
restic init --repo /backups/peertube-videos
# Backup videos
restic backup /opt/peertube/data/videos --repo /backups/peertube-videos
# Restore specific file
restic restore latest --repo /backups/peertube-videos --target /restore/location Disaster Recovery
Full Restore:
# Stop containers
cd /opt/peertube
docker-compose down
# Restore database
gunzip < peertube-db-20250115.sql.gz | docker exec -i peertube-postgres psql -U peertube -d peertube
# Restore configuration
tar -xzf peertube-config-20250115.tar.gz -C /
# Restore videos (if needed)
restic restore latest --repo /backups/peertube-videos --target /opt/peertube/data
# Restart containers
docker-compose up -d Next Steps
Immediate Actions
After completing basic setup:
- Create your first channel and upload test video
- Configure transcoding with hardware acceleration
- Set up federation by following other instances
- Enable live streaming and test with OBS
- Configure SMTP for email notifications
- Set up automated backups
Growing Your Instance
Content Strategy:
- Define your niche or focus
- Create content calendar
- Cross-post to build audience
- Engage with federated community
Community Building:
- Welcome other users if allowing signups
- Create featured playlists
- Highlight quality content
- Moderate actively and fairly
Advanced Configurations
Full Media Platform:
- PeerTube for video hosting
- Mastodon for social interaction
- Pixelfed for image sharing
- Unified Fediverse presence
Professional Features:
- Custom plugins for unique features
- Advanced analytics and insights
- CDN integration for global delivery
- Multi-server deployment
Resources
Official Documentation:
- joinpeertube.org: Official website
- docs.joinpeertube.org: Complete documentation
- github.com/Chocobozzz/PeerTube: Source code
Community Support:
- Fediverse: @[email protected]
- Forum: framacolibri.org
- Chat: chat.framsoft.org
Related Guides:
- Federation and ActivityPub
- Hardware transcoding setup
- Object storage configuration
- Mastodon integration
Build your independent video platform and join the federated future of content sharing!