streamflow/DOCKER_INSTALLATION.md

229 lines
5.3 KiB
Markdown
Raw Normal View History

# StreamFlow - Easy Docker Installation
StreamFlow is a powerful IPTV streaming platform with VPN support, recording capabilities, and more.
## 🚀 Quick Start (3 Steps)
### 1. Download the Docker Compose file
```bash
wget https://raw.githubusercontent.com/aiulian25/streamflow/main/docker-compose.yml
```
Or manually create a file named `docker-compose.yml` with the content from [here](https://github.com/aiulian25/streamflow/blob/main/docker-compose.yml).
### 2. (Optional) Create environment file
Generate secure secrets:
```bash
cat > .env <<EOF
JWT_SECRET=$(openssl rand -base64 32)
SESSION_SECRET=$(openssl rand -base64 32)
ENABLE_GPU=false
EOF
```
### 3. Start the application
```bash
docker compose up -d
```
That's it! 🎉
## 📍 Access the Application
- **Web Interface**: http://localhost:12345
- **Update Server**: http://localhost:9000
### 🔑 Default Credentials
On first run, a default admin account is automatically created:
```
Username: admin
Password: admin
```
**⚠️ IMPORTANT**: You will be prompted to change this password on first login!
## 🔧 Configuration Options
### Environment Variables
Edit the `.env` file or set in `docker-compose.yml`:
| Variable | Default | Description |
|----------|---------|-------------|
| `PORT` | 12345 | Main application port |
| `JWT_SECRET` | (required) | JWT token secret |
| `SESSION_SECRET` | (required) | Session encryption secret |
| `DISABLE_SIGNUPS` | true | Disable new user registration |
| `ENABLE_GPU` | false | Enable GPU hardware acceleration |
| `MAX_RECORDING_SIZE` | 100GB | Maximum recording storage |
### Enable GPU Acceleration
For Intel Quick Sync (already configured in compose file):
```yaml
devices:
- /dev/dri:/dev/dri
```
For NVIDIA GPU, uncomment the deploy section in `docker-compose.yml`:
```yaml
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu, video]
```
## 📊 Management Commands
### View Logs
```bash
docker compose logs -f streamflow
```
### Stop the Application
```bash
docker compose down
```
### Update to Latest Version
```bash
docker compose pull
docker compose up -d
```
### Restart the Application
```bash
docker compose restart
```
### Backup Data
```bash
docker compose down
tar -czf streamflow-backup-$(date +%Y%m%d).tar.gz \
$(docker volume inspect streamflow_streamflow-data -f '{{.Mountpoint}}')
docker compose up -d
```
### Restore from Backup
```bash
docker compose down
tar -xzf streamflow-backup-YYYYMMDD.tar.gz -C /var/lib/docker/volumes/streamflow_streamflow-data/_data/
docker compose up -d
```
## 🔒 Security Recommendations
1. **Change Default Secrets**: Always set unique `JWT_SECRET` and `SESSION_SECRET`
2. **Firewall**: Configure firewall to restrict access if exposed to internet
3. **HTTPS**: Use reverse proxy (nginx, traefik) with SSL for production
4. **Backups**: Regularly backup the `streamflow-data` volume
### Example Nginx Reverse Proxy
```nginx
server {
listen 80;
server_name streamflow.yourdomain.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name streamflow.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/streamflow.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/streamflow.yourdomain.com/privkey.pem;
location / {
proxy_pass http://localhost:12345;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
}
}
```
## 🐛 Troubleshooting
### Container won't start
```bash
# Check logs
docker compose logs streamflow
# Check if ports are already in use
sudo netstat -tulpn | grep -E '12345|9000'
```
### Permission issues
```bash
# Fix volume permissions
docker compose down
docker volume rm streamflow_streamflow-data
docker compose up -d
```
### GPU not working
```bash
# Verify device access
ls -la /dev/dri/
# Check if user has access to render group
groups $(whoami)
# Add user to render group if needed
sudo usermod -a -G render $(whoami)
```
### VPN not working
- Ensure the container runs with `privileged: true` (already set)
- Check VPN configuration files are properly uploaded through the web interface
- Verify sysctls are properly set in docker-compose.yml
## 📦 System Requirements
### Minimum
- 2 CPU cores
- 2GB RAM
- 10GB disk space
- Docker 20.10+ and Docker Compose V2
### Recommended
- 4+ CPU cores
- 4GB+ RAM
- 50GB+ disk space (for recordings)
- GPU for hardware acceleration (Intel Quick Sync, NVIDIA)
## 🌐 Supported Platforms
- Linux (x86_64, arm64)
- Windows (via Docker Desktop)
- macOS (via Docker Desktop)
## 📚 More Information
- [Full Documentation](https://github.com/aiulian25/streamflow/blob/main/README.md)
- [Report Issues](https://github.com/aiulian25/streamflow/issues)
- [Contributing Guide](https://github.com/aiulian25/streamflow/blob/main/CONTRIBUTING.md)
## 📄 License
See the [LICENSE](https://github.com/aiulian25/streamflow/blob/main/LICENSE) file for details.
---
**Need Help?** Open an issue on [GitHub](https://github.com/aiulian25/streamflow/issues)