{"id":29675124,"url":"https://github.com/streamplace/selfhosting","last_synced_at":"2026-02-05T07:32:29.773Z","repository":{"id":305212343,"uuid":"1021067233","full_name":"streamplace/selfhosting","owner":"streamplace","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-21T22:59:50.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T07:54:30.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streamplace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T20:36:38.000Z","updated_at":"2025-07-21T22:59:53.000Z","dependencies_parsed_at":"2025-07-22T01:28:15.139Z","dependency_job_id":null,"html_url":"https://github.com/streamplace/selfhosting","commit_stats":null,"previous_names":["espeon/sp-selfhost","streamplace/selfhosting"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/streamplace/selfhosting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamplace%2Fselfhosting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamplace%2Fselfhosting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamplace%2Fselfhosting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamplace%2Fselfhosting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamplace","download_url":"https://codeload.github.com/streamplace/selfhosting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamplace%2Fselfhosting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29115550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-22T23:06:00.441Z","updated_at":"2026-02-05T07:32:29.751Z","avatar_url":"https://github.com/streamplace.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Streamplace Server Setup\n\nThis directory contains configuration files for running your own Streamplace server with a hybrid Docker + systemd approach.\n\n\u003e [!NOTE]\n\u003e This setup is designed for personal/small-scale use.\n\n## Overview\n\nThis setup runs:\n- **Streamplace** as a systemd service on the host (for simplicity and performance)\n  - In Docker, you'd need to passthrough a lot of ports for WebRTC\n- **Caddy** in Docker for reverse proxy and automatic TLS certificates\n- **MistServer** in Docker for RTMP streaming support\n\n## Prerequisites\n\n- Docker and Docker Compose\n- systemd (Linux)\n- A domain name pointed to your server\n- Cloudflare DNS (for automatic certificate management)\n\n## Quick Start\n\n1. **Clone/copy these files** to your server\n2. **Edit configuration files** (see Configuration section below)\n3. **Install Streamplace binary** on your host system\n4. **Start the services:**\n   ```bash\n   # Start Docker services\n   docker-compose up -d\n\n   # Install and start Streamplace systemd service\n   sudo cp streamplace.service /etc/systemd/system/\n   sudo systemctl daemon-reload\n   sudo systemctl enable streamplace\n   sudo systemctl start streamplace\n   ```\n\n## Configuration\n\n### 1. Environment Variables\n\nEdit `docker-compose.yml` and update:\n- `DOMAIN`: Your domain name\n- `EMAIL`: Your email for Let's Encrypt certificates\n- `CLOUDFLARE_API_TOKEN`: Your Cloudflare API token with DNS edit permissions\n\n### 2. Streamplace Service\n\nEdit `streamplace.service` and update:\n- `--public-host`: Your domain name\n- `--app-bundle-id`: Your app bundle ID (optional)\n\n### 3. Caddy Configuration\n\nEdit `Caddyfile` and update:\n- `stream.example.com`: Replace with your actual domain\n- `email youremail@domain.co.uk`: Replace with your email\n\n## TLS Certificate Management\n\nThe setup handles TLS certificates automatically, but you have options for how Streamplace accesses them:\n\n### Option 1: Use Caddy-generated certificates (Recommended)\n\nCaddy will automatically generate and manage certificates. To use them with Streamplace:\n\n```bash\n# Create the TLS directory in Streamplace data directory\nsudo mkdir -p /var/lib/streamplace/tls\n\n# Copy certificates from Caddy (you may need to set up a script to do this automatically)\nsudo cp ./caddy_data/certificates/acme-v02.api.letsencrypt.org-directory/your-domain/your-domain.crt /var/lib/streamplace/tls/tls.crt\nsudo cp ./caddy_data/certificates/acme-v02.api.letsencrypt.org-directory/your-domain/your-domain.key /var/lib/streamplace/tls/tls.key\n```\n\n```bash\n# In your streamplace.service file, add:\n--tls-cert /path/to/your/caddy_data/certificates/acme-v02.api.letsencrypt.org-directory/your-domain/your-domain.crt \\\n--tls-key /path/to/your/caddy_data/certificates/acme-v02.api.letsencrypt.org-directory/your-domain/your-domain.key \\\n```\n\n## Service Management\n\n### Docker Services\n\n```bash\n# Start all Docker services\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f caddy\ndocker-compose logs -f streamplace-mistserver\n\n# Stop services\ndocker-compose down\n```\n\n### Streamplace Service\n\n```bash\n# Start/stop/restart\nsudo systemctl start streamplace\nsudo systemctl stop streamplace\nsudo systemctl restart streamplace\n\n# View status and logs\nsudo systemctl status streamplace\nsudo journalctl -u streamplace -f\n```\n\n## Ports\n\n- **80/443**: HTTP/HTTPS (Caddy)\n- **31935**: RTMP (MistServer)\n- **38443**: Streamplace HTTPS (internal, proxied by Caddy)\n- **39090**: Streamplace internal API (localhost only)\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Certificates not working**: Check that your domain DNS points to your server and Cloudflare API token has correct permissions\n\n2. **RTMP not working**: Ensure MistServer is running and can reach the Streamplace internal API at `host.docker.internal:39090`\n\n3. **Service won't start**: Check logs with `journalctl -u streamplace -f` and ensure the Streamplace binary is installed at `/usr/bin/streamplace`\n\n### Logs\n\n- **Caddy logs**: `docker-compose logs caddy`\n- **MistServer logs**: `docker-compose logs streamplace-mistserver`\n- **Streamplace logs**: `sudo journalctl -u streamplace -f`\n\n### Testing\n\n1. **Web interface**: Visit `https://your-domain.com`\n2. **RTMP streaming**: Use OBS or similar with `rtmp://your-domain.com:31935/live/your-stream-key`\n3. **API health**: `curl http://localhost:39090/health` (from host)\n\n## File Structure\n\n```\nstreamplace/\n├── README.md                 # This file\n├── docker-compose.yml        # Docker services configuration\n├── Caddyfile                 # Caddy reverse proxy configuration\n├── streamplace.service       # systemd service file\n├── Dockerfile.caddy          # Custom Caddy build with Cloudflare DNS\n├── Dockerfile.mistserver     # MistServer container\n├── mistserver.json           # MistServer configuration\n└── caddy_data/              # Caddy data directory (created by Docker)\n    └── certificates/        # Let's Encrypt certificates\n```\n\n## Security Notes\n\n- The setup uses `tls_insecure_skip_verify` in Caddy config for the internal connection to Streamplace. This is acceptable for localhost connections but should be reviewed for production use.\n- Ensure your firewall only allows necessary ports (80, 443, 1935)\n  - Or at least restrict access to the RTMP port (31935) and internal API port (39090) to known IPs\n  - These known IPs (at least for the internal API port) should INCLUDE your Mistserver container IP\n- Consider using Tailscale or similar for remote management access\n- Regularly update all components (Streamplace, Caddy, MistServer)\n\n## Advanced Configuration\n\n### Custom Streamplace Flags\n\nCommon flags you might want to change in `streamplace.service`:\n\n- `--rate-limit-per-second 10`: Rate limiting\n- `--rate-limit-burst 20`: Burst rate limiting\n- `--secure`: Enable secure mode\n- `--app-bundle-id tv.your.app`: Custom app bundle ID\n- the `--tls-cert` and `--tls-key` flags for custom TLS certificates, mentioned above\n\n### MistServer Configuration\n\nEdit `mistserver.json` to customize:\n- RTMP port (currently 31935)\n- HTTP port (currently 28080)\n- Stream processing settings\n- Authentication settings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamplace%2Fselfhosting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamplace%2Fselfhosting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamplace%2Fselfhosting/lists"}