Mylar3 is an open-source, self-hosted application designed specifically for comic book enthusiasts who want to manage their digital collections with precision and control. With features like automated downloads, metadata fetching, and full customization, Mylar3 gives users complete autonomy over their libraries. This guide provides a hands-on walkthrough for deploying, configuring, and managing Mylar3, covering everything from installation to leveraging its advanced features.
Installing Mylar3
π¦ Docker/Docker Compose Setup
Docker is the easiest way to deploy Mylar3, offering portability and simple updates. Below is a docker-compose.yml
file tailored for Mylar3.
version: "3.9"
services:
mylar3:
image: linuxserver/mylar3:latest
container_name: mylar3
ports:
- "8090:8090" # Map Mylar3's default port
environment:
- PUID=1000 # Replace with your system's user ID
- PGID=1000 # Replace with your system's group ID
- TZ=America/New_York # Set your timezone
volumes:
- /path/to/config:/config # Config directory
- /path/to/comics:/comics # Comic book library directory
- /path/to/downloads:/downloads # Directory for downloaded files
restart: unless-stopped
Save this file as docker-compose.yml
and run the following commands to deploy Mylar3:
cd /path/to/docker-compose
## Start the Mylar3 container
docker-compose up -d
## Verify the container is running
docker ps
π Manual Installation
If you prefer a manual setup, follow these steps to install Mylar3 on a Linux server:
## Update and install dependencies
sudo apt update && sudo apt install -y git python3 python3-pip
## Clone the Mylar3 repository
git clone https://github.com/mylar3/mylar3.git /opt/mylar3
## Navigate to the Mylar3 directory
cd /opt/mylar3
## Install Python dependencies
pip3 install -r requirements.txt
## Start Mylar3 (use a process manager like systemd for persistence)
python3 Mylar.py
Access Mylar3 via http://<your-server-ip>:8090
.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
A reverse proxy improves accessibility by routing traffic to Mylar3. Create an Nginx server block as follows:
server {
listen 80;
server_name mylar3.example.com;
location / {
proxy_pass http://127.0.0.1:8090;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Place this configuration in /etc/nginx/sites-available/mylar3
and enable it with:
sudo ln -s /etc/nginx/sites-available/mylar3 /etc/nginx/sites-enabled/
sudo nginx -t # Test the configuration
sudo systemctl reload nginx
π SSL/TLS Setup
Secure your Mylar3 instance with Let's Encrypt:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d mylar3.example.com
Automate SSL renewals by verifying certbot
's cron job:
sudo systemctl list-timers | grep certbot
Logging and Debugging Mylar3
ποΈ Enabling Debug Logs
Enable debug logging by editing Mylar3βs configuration file (config.ini
):
[General]
log_level = DEBUG
Restart Mylar3 after saving changes:
## Docker
docker restart mylar3
## Manual
python3 Mylar.py
π Viewing Logs
Access Mylar3 logs depending on your setup:
-
Docker:
docker logs mylar3
-
Manual:
tail -f /opt/mylar3/logs/mylar.log
π οΈ Troubleshooting Common Issues
Look for common issues like permission errors (PermissionError
) or connectivity issues (ConnectionError
) in the logs. Adjust file permissions or network settings as needed:
sudo chown -R youruser:yourgroup /path/to/config /path/to/comics /path/to/downloads
Backup and Restore
ποΈ File-Based Backups
Backup configuration and data directories:
tar -czvf mylar3_backup.tar.gz /path/to/config /path/to/comics
π Database Backups
If Mylar3 uses an internal database, export it for backups:
sqlite3 /path/to/config/mylar3.db .dump > mylar3_backup.sql
Restore the database with:
sqlite3 /path/to/config/mylar3.db < mylar3_backup.sql
π Automated Backup Scripts
Automate backups with a cron job. Create a script backup_mylar3.sh
:
#!/bin/bash
tar -czvf /path/to/backup/mylar3_$(date +%F).tar.gz /path/to/config /path/to/comics
Schedule it with crontab -e
:
0 2 * * * /path/to/backup_mylar3.sh
Updating and Upgrading Mylar3
β¬οΈ Updating Docker Images
To update Mylar3 via Docker, use the following commands:
docker-compose pull
docker-compose down
docker-compose up -d
π οΈ Manual Updates
Pull the latest changes if using a manual setup:
cd /opt/mylar3
git pull
pip3 install -r requirements.txt
python3 Mylar.py
π Checking for Updates
Mylar3βs web interface often provides update notifications. Navigate to the settings page to check for updates.
Leveraging Mylar3βs Unique Features
π§ Enabling APIs
Enable the API in config.ini
:
[General]
api_enabled = True
api_key = your_unique_api_key
Test the API with curl
:
curl -X GET "http://<your-server-ip>:8090/api?apikey=your_unique_api_key&cmd=getVersion"
π Advanced Configurations
Integrate Mylar3 with third-party downloaders like SABnzbd by configuring downloader settings under the web interface's "Downloaders" section.
Wrapping Up
This guide provided a step-by-step approach to deploying, securing, and managing Mylar3. From installation to advanced configurations, users can now fully utilize Mylar3βs flexible and powerful features for managing their comic book collections. Begin implementing these steps today to take full control of your library!