Unmanic is a self-hosted, open-source application designed to optimize your media library by converting and normalizing video and audio files. With its focus on automation and customization, Unmanic empowers users to tailor their media workflows while maintaining full data control. In this guide, weβll cover everything from installing and configuring Unmanic to managing its unique features, so you can seamlessly deploy and integrate it into your self-hosted environment.
Installing Unmanic
π¦ Docker/Docker Compose Setup
The recommended way to install Unmanic is via Docker for simplicity and ease of updates. Below is an example docker-compose.yml
tailored for Unmanic:
version: "3.8"
services:
unmanic:
image: josh5/unmanic:latest
container_name: unmanic
ports:
- 8888:8888 # Map Unmanic's web interface to localhost:8888
volumes:
- /path/to/config:/config # Persistent configuration storage
- /path/to/media:/library # Media library to process
environment:
- TZ=Etc/UTC # Set the timezone
restart: unless-stopped
To deploy Unmanic using the above file:
mkdir unmanic && cd unmanic
nano docker-compose.yml # Copy and paste the above YAML
docker-compose up -d
This will launch Unmanic on http://<your-server-ip>:8888
. Adjust the volumes
paths to match your directory structure.
π Manual Installation (Linux)
For those who prefer a manual setup, use the following commands to install Unmanic:
- Install required dependencies:
sudo apt update && sudo apt install -y python3 python3-pip ffmpeg
- Clone the Unmanic repository:
git clone https://github.com/Unmanic/unmanic.git
cd unmanic
- Install Python dependencies:
pip3 install -r requirements.txt
- Run the application:
python3 unmanic.py
Unmanic will now be accessible at http://<your-server-ip>:8888
.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To serve Unmanic behind Nginx, create a server block configuration file:
server {
listen 80;
server_name unmanic.example.com;
location / {
proxy_pass http://127.0.0.1:8888/; # Forward traffic to Unmanic
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 to /etc/nginx/sites-available/unmanic
and enable it:
ln -s /etc/nginx/sites-available/unmanic /etc/nginx/sites-enabled/
nginx -t # Test configuration
sudo systemctl reload nginx
π SSL/TLS Setup
Add SSL/TLS encryption with Letβs Encrypt:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d unmanic.example.com
Set up automatic certificate renewal:
sudo systemctl enable certbot.timer
π οΈ Testing and Reloading Nginx
Ensure your Nginx configuration works:
nginx -t
sudo systemctl reload nginx
Now you can access Unmanic securely at https://unmanic.example.com
.
Logging and Debugging Unmanic
ποΈ Enabling Debug Logs
To enable debug-level logging, modify the Unmanic configuration by editing its config.json
file:
{
"log_level": "DEBUG"
}
Restart Unmanic after making changes.
π Viewing Logs
For Docker installations:
docker logs -f unmanic
For manual installations:
tail -f /path/to/unmanic/logs/unmanic.log
π οΈ Troubleshooting Common Issues
Check logs for errors such as missing dependencies or incorrect file permissions. For example:
grep "ERROR" /path/to/unmanic/logs/unmanic.log
π€ Exporting Logs
Integrate logs with the ELK Stack by forwarding logs via Filebeat:
filebeat.inputs:
- type: log
paths:
- /path/to/unmanic/logs/unmanic.log
Configure Filebeat to ship logs to your Elasticsearch instance.
Backup and Restore
ποΈ File-Based Backups
Backup Unmanic configuration and database:
tar -cvzf unmanic_backup_$(date +%Y%m%d).tar.gz /path/to/config
π Database Backups
If Unmanic uses SQLite, back up the database:
cp /path/to/config/unmanic.db /path/to/backups/unmanic.db.bak
π Automated Backup Scripts
Automate backups with a cron job:
crontab -e
0 2 * * * tar -cvzf /path/to/backups/unmanic_backup_$(date +\%Y\%m\%d).tar.gz /path/to/config
Updating and Upgrading Unmanic
β¬οΈ Updating Docker Images
To update Unmanic when using Docker:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
For manual installations:
cd /path/to/unmanic
git pull
pip3 install --upgrade -r requirements.txt
π Checking for Updates
Visit the Unmanic GitHub repository to monitor releases.
Leveraging Unmanicβs Unique Features
π§ Enabling APIs
Unmanic exposes APIs for integration. Enable the API in config.json
:
{
"api_enabled": true,
"api_bind_address": "0.0.0.0",
"api_port": 8889
}
Access the API with curl
:
curl http://<your-server-ip>:8889/api/status
π Advanced Configurations
Unmanic supports custom plugins. To enable a plugin:
-
Navigate to
Settings > Plugins
in the web UI. -
Select and configure the desired plugin for your workflow.
Alternatively, configure plugins in config.json
:
{
"plugin_enabled": true,
"plugin_settings": {
"plugin_name": "CustomPlugin",
"plugin_option": "value"
}
}
Wrapping Up
In this guide, weβve walked through deploying, configuring, and managing Unmanic for a self-hosted media optimization workflow. By following these steps, you can take full advantage of Unmanicβs flexibility and automation capabilities. Start implementing these code-driven workflows today to organize and enhance your media library like never before!