Streama is an open-source, self-hosted media streaming platform that enables users to create their own Netflix-like server for managing and streaming videos. Itβs an excellent choice for tech-savvy users who value data control, customization, and privacy when sharing media files with friends or family. In this guide, weβll walk you through installing, configuring, and managing Streama, covering everything from deployment to backups and advanced features.
Installing Streama
π¦ Docker/Docker Compose Setup
Docker simplifies deployment by packaging Streama and its dependencies into an isolated container. Follow these steps to set up Streama with Docker Compose:
- Create a
docker-compose.yml
file for Streama:
version: "3.9"
services:
streama:
image: ghcr.io/dularion/streama:latest
container_name: streama
ports:
- "8080:8080"
volumes:
- ./data:/app/data
- ./logs:/app/logs
environment:
SPRING_PROFILES_ACTIVE: production
SERVER_PORT: 8080
This configuration maps the appβs data and logs to your host filesystem for persistence and sets the app to run in production mode.
- Deploy the containers with Docker Compose:
docker-compose up -d
This command will download the Streama image, create the container, and start the service.
- Verify that the Streama service is running:
docker ps | grep streama
Open your browser and navigate to http://<server-ip>:8080
to access the Streama UI.
π Manual Installation
For those who prefer not to use Docker, a manual installation on Linux is also possible:
- Install Java and other dependencies:
sudo apt update
sudo apt install openjdk-11-jre wget unzip -y
- Download and extract the latest Streama release:
wget https://github.com/streamaserver/streama/releases/latest/download/streama-*.jar -O streama.jar
- Run Streama:
java -jar streama.jar
By default, the application listens on port 8080
. You can customize the port using the --server.port=<port>
flag.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To expose Streama over the web with a custom domain, configure Nginx as a reverse proxy. Start by creating an Nginx configuration file:
server {
listen 80;
server_name streama.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
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;
}
}
Save this file as /etc/nginx/sites-available/streama
and symlink it:
sudo ln -s /etc/nginx/sites-available/streama /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
π SSL/TLS Setup
Secure your domain with Letβs Encrypt:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d streama.example.com
Certificates will automatically renew via a systemd timer installed with Certbot.
π οΈ Testing and Reloading Nginx
Verify Nginx configuration and reload the service:
sudo nginx -t
sudo systemctl reload nginx
Access your encrypted Streama instance at https://streama.example.com
.
Logging and Debugging Streama
ποΈ Enabling Debug Logs
To enable verbose logging, set the logging.level
configuration in the applicationβs settings:
java -Dlogging.level.root=DEBUG -jar streama.jar
π Viewing Logs
For Docker users:
docker logs -f streama
For manual installations:
tail -f logs/streama.log
π οΈ Troubleshooting Common Issues
-
Port not accessible: Ensure the port is open with
sudo ufw allow 8080
. -
Nginx misconfiguration: Check the proxy settings in
/etc/nginx/sites-available/streama
.
π€ Exporting Logs
Stream Streama logs to an external system like ELK by forwarding the logs:
docker logs streama 2>&1 | curl -XPOST "http://elk-server:9200/streama-logs/_doc" -H "Content-Type: application/json" -d @-
Backup and Restore
ποΈ File-Based Backups
Backup Streama data and logs:
tar -czvf streama-backup.tar.gz data logs
π Database Backups
If Streama uses an external database like PostgreSQL:
pg_dump -U streama_user streama_db > streama_db_backup.sql
π Automated Backup Scripts
Add the following cron job to automate backups:
0 2 * * * tar -czvf /backup/streama-$(date +\%F).tar.gz /path/to/data /path/to/logs
Updating and Upgrading Streama
β¬οΈ Updating Docker Images
Update to the latest image:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
Replace the old streama.jar
with the latest version:
wget https://github.com/streamaserver/streama/releases/latest/download/streama-*.jar -O streama.jar
java -jar streama.jar
π Checking for Updates
Monitor the Streama GitHub Releases page for new versions.
Leveraging Streamaβs Unique Features
π§ Enabling APIs
Streama supports RESTful APIs for external integrations. Enable the API in the configuration:
java -Dstreama.api.enabled=true -jar streama.jar
Example API request to retrieve media details:
curl -X GET http://streama.example.com/api/media -H "Authorization: Bearer <API_TOKEN>"
π Advanced Configurations
- Configure email notifications:
email.host=smtp.example.com
email.port=587
[email protected]
email.password=your-email-password
Wrapping Up
With Streama, you have full control over your media streaming experience, from installation to advanced configurations. By leveraging the code examples provided in this guide, youβll be able to deploy, secure, and manage your own media server with ease. Start streaming today and enjoy the flexibility and privacy of self-hosting!