Lidarr is an open-source music collection manager that allows users to automatically download, organize, and manage their music libraries. Designed for self-hosting, it integrates seamlessly with download clients and indexers, making it an excellent choice for music enthusiasts who want complete control over their data and environment. In this guide, weβll walk through installing Lidarr, configuring it for secure, efficient access, managing logs, setting up backups, and leveraging its advanced features.
Installing Lidarr
π¦ Docker/Docker Compose Setup
Docker is the preferred method for deploying Lidarr due to its ease of use and isolation. Below is a docker-compose.yml
file configured for Lidarr:
version: '3.8'
services:
lidarr:
image: linuxserver/lidarr:latest
container_name: lidarr
environment:
- PUID=1000 # Adjust to your user ID
- PGID=1000 # Adjust to your group ID
- TZ=America/New_York # Set your timezone
volumes:
- /path/to/config:/config # Configuration data
- /path/to/music:/music # Music library
- /path/to/downloads:/downloads # Downloads directory
ports:
- 8686:8686 # Lidarr web UI
restart: unless-stopped
To deploy Lidarr using Docker Compose, follow these steps:
mkdir lidarr && cd lidarr
nano docker-compose.yml
## Start the container
docker-compose up -d
## Verify the container is running
docker ps
Access Lidarr via http://<your-server-ip>:8686
.
π Manual Installation
For those not using Docker, install Lidarr manually on a Linux server:
## Update system and install dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install curl mediainfo sqlite3 -y
## Download the latest Lidarr release
curl -L -o Lidarr.tar.gz "https://github.com/Lidarr/Lidarr/releases/latest/download/linux.tar.gz"
## Extract and move to /opt
tar -xvzf Lidarr.tar.gz
sudo mv Lidarr /opt/lidarr
## Create a systemd service file
sudo nano /etc/systemd/system/lidarr.service
Add the following content to the service file:
[Unit]
Description=Lidarr Daemon
After=syslog.target network.target
[Service]
User=<your-user>
Group=<your-group>
UMask=002
ExecStart=/opt/lidarr/Lidarr -nobrowser -data=/opt/lidarr/config
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl enable lidarr
sudo systemctl start lidarr
Access Lidarr at http://<your-server-ip>:8686
.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To expose Lidarr via a domain and route traffic securely, create an Nginx server block:
sudo nano /etc/nginx/sites-available/lidarr
Add the following configuration:
server {
listen 80;
server_name lidarr.example.com;
location / {
proxy_pass http://localhost:8686;
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;
proxy_redirect off;
}
}
Enable the configuration and reload Nginx:
sudo ln -s /etc/nginx/sites-available/lidarr /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
Secure the reverse proxy with Let's Encrypt:
## Install Certbot
sudo apt install certbot python3-certbot-nginx -y
## Obtain and apply SSL certificate
sudo certbot --nginx -d lidarr.example.com
## Test auto-renewal
sudo certbot renew --dry-run
Logging and Debugging Lidarr
ποΈ Enabling Debug Logs
To enable debug logs in Lidarr, navigate to Settings > General > Logging
in the web UI and set the log level to Debug
.
π Viewing Logs
For Docker installations, view logs using:
docker logs lidarr
For manual installations, check the log file:
tail -f /opt/lidarr/config/logs/lidarr.txt
π οΈ Troubleshooting Common Issues
If Lidarr fails to start, look for errors in the logs. For example:
-
Port conflicts: Ensure no other service uses port 8686.
-
Permission issues: Ensure Lidarr has access to its directories.
π€ Exporting Logs
To send logs to an external ELK Stack:
## Install Filebeat
sudo apt install filebeat -y
## Configure Filebeat to monitor Lidarr logs
sudo nano /etc/filebeat/filebeat.yml
Add Lidarr's log path under filebeat.inputs
:
- type: log
paths:
- /opt/lidarr/config/logs/*.txt
Restart Filebeat:
sudo systemctl restart filebeat
Backup and Restore
ποΈ File-Based Backups
Backup Lidarrβs configuration files and database:
tar -czvf lidarr-backup.tar.gz /path/to/config
π Database Backups
If Lidarr uses SQLite for its database, back it up specifically:
cp /path/to/config/lidarr.db /path/to/backup/lidarr.db.bak
π Automated Backup Scripts
Create a cron job for periodic backups:
crontab -e
Add the following line:
0 2 * * * tar -czvf /path/to/backup/lidarr-$(date +\%F).tar.gz /path/to/config
Updating and Upgrading Lidarr
β¬οΈ Updating Docker Images
For Docker installations:
docker-compose pull lidarr
docker-compose up -d
π οΈ Manual Updates
For manual installations:
## Stop the service
sudo systemctl stop lidarr
## Download and replace the binaries
curl -L -o Lidarr.tar.gz "https://github.com/Lidarr/Lidarr/releases/latest/download/linux.tar.gz"
tar -xvzf Lidarr.tar.gz
sudo mv Lidarr /opt/lidarr
## Start the service
sudo systemctl start lidarr
π Checking for Updates
Visit Lidarrβs GitHub releases page or check the update section in the web UI.
Leveraging Lidarrβs Unique Features
π§ Enabling APIs
Activate Lidarrβs API under Settings > General > Security
. To test the API:
curl -H "X-Api-Key: <your-api-key>" http://localhost:8686/api/v1/system/status
π Advanced Configurations
Integrate Lidarr with third-party tools like Sonarr or Radarr by setting up download clients and indexers under Settings > Download Clients
and Settings > Indexers
.
Wrapping Up
This guide covered the essential aspects of deploying, configuring, and managing Lidarr. By following these steps, you can create a powerful, self-hosted music management solution tailored to your needs. With its robust features and APIs, Lidarr empowers you to automate and optimize your music collection effortlessly. Start exploring today!