Sep 29, 2024 3 min read

Readarr: The Ultimate Guide to Self-Hosting

Readarr: The Ultimate Guide to Self-Hosting
Table of Contents

Readarr is a self-hosted application designed for managing and tracking your eBook and audiobook libraries. By offering automation and integration with indexers and download clients, it simplifies acquiring and organizing your media collections. As an open-source app, Readarr is an excellent choice for those who value customization, data control, and seamless media management. In this guide, we’ll cover everything from installing Readarr to configuring it for secure and efficient use. Let’s dive into the details.

Installing Readarr

πŸ“¦ Docker/Docker Compose Setup

Using Docker ensures a clean and portable setup for Readarr. Below is a docker-compose.yml configuration tailored for Readarr:


version: '3.8'

services:

readarr:

image: lscr.io/linuxserver/readarr:latest

container_name: readarr

environment:

- PUID=1000                   # Set this to your user ID

- PGID=1000                   # Set this to your group ID

- TZ=America/New_York         # Replace with your timezone

volumes:

- /path/to/config:/config     # Path to store Readarr configuration

- /path/to/media:/books       # Path to your eBook/audiobook library

ports:

- 7878:7878                   # Expose Readarr's web UI

restart: unless-stopped

Save this configuration as docker-compose.yml, then deploy and manage your Readarr container using the following commands:


docker-compose up -d

## Check the container logs to confirm it is running

docker logs -f readarr

πŸš€ Manual Installation

For users preferring a manual installation on Linux, follow these steps:

  1. Install Required Dependencies (replace apt with your distro's package manager if needed):

sudo apt update

sudo apt install -y curl tar unzip

  1. Download and Extract Readarr:

curl -L -o readarr.tar.gz https://github.com/Readarr/Readarr/releases/latest/download/Readarr.master.linux.tar.gz

tar -xvf readarr.tar.gz -C /opt

  1. Create a Service File for Readarr:

sudo tee /etc/systemd/system/readarr.service > /dev/null <<EOF

[Unit]

Description=Readarr Service

After=network.target

[Service]

ExecStart=/opt/Readarr/Readarr

Restart=on-failure

User=$(whoami)

Group=$(whoami)

WorkingDirectory=/opt/Readarr

[Install]

WantedBy=multi-user.target

EOF

  1. Enable and Start the Service:

sudo systemctl enable readarr

sudo systemctl start readarr

Access Readarr’s web interface by visiting http://<your-server-ip>:7878.

Configuring Nginx as a Reverse Proxy

🌐 Nginx Configuration

A reverse proxy helps secure and manage access to Readarr. Below is an example Nginx configuration:


server {

listen 80;

server_name readarr.example.com;

location / {

proxy_pass http://127.0.0.1:7878;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

Save this file as /etc/nginx/sites-available/readarr and enable it:


sudo ln -s /etc/nginx/sites-available/readarr /etc/nginx/sites-enabled/

sudo nginx -t && sudo systemctl reload nginx

πŸ”’ SSL/TLS Setup

Secure your server with Let’s Encrypt SSL:


sudo apt install certbot python3-certbot-nginx

sudo certbot --nginx -d readarr.example.com

This command automatically configures SSL and sets up periodic renewals.

Logging and Debugging Readarr

πŸ—ƒοΈ Enabling Debug Logs

To enable debug logging in Readarr, navigate to Settings > General > Logging, and select Debug.

πŸ“„ Viewing Logs

For Docker installations:


docker logs -f readarr

For manual installations, logs are stored in /opt/Readarr/logs/. Use tail or less to view:


tail -f /opt/Readarr/logs/log.txt

πŸ› οΈ Troubleshooting Common Issues

If your logs show errors such as "cannot reach indexer," ensure your indexer credentials are correctly configured under Settings > Indexers.

πŸ“€ Exporting Logs

Send logs to an ELK Stack by configuring Filebeat:


filebeat.inputs:

- type: log

paths:

- /opt/Readarr/logs/*.txt

output.elasticsearch:

hosts: ["localhost:9200"]

Deploy Filebeat:


sudo systemctl start filebeat

sudo systemctl enable filebeat

Backup and Restore

πŸ—‚οΈ File-Based Backups

Backup your configuration directory:


tar -czvf readarr-backup.tar.gz /path/to/config

Restore it with:


tar -xzvf readarr-backup.tar.gz -C /path/to/config

πŸ”„ Database Backups

If using a database, export it with:


sqlite3 /path/to/config/readarr.db .dump > readarr-db-backup.sql

Restore it:


sqlite3 /path/to/config/readarr.db < readarr-db-backup.sql

πŸ“… Automated Backup Scripts

Set up a cron job to automate backups:


echo "0 2 * * * tar -czvf /backups/readarr-$(date +\%F).tar.gz /path/to/config" | crontab -

Updating and Upgrading Readarr

⬆️ Updating Docker Images

Pull the latest image and restart the container:


docker-compose pull

docker-compose up -d

πŸ› οΈ Manual Updates

Download the latest release and replace the binaries:


curl -L -o readarr.tar.gz https://github.com/Readarr/Readarr/releases/latest/download/Readarr.master.linux.tar.gz

tar -xvf readarr.tar.gz -C /opt

sudo systemctl restart readarr

πŸ” Checking for Updates

Navigate to System > Updates in the Readarr web UI to check for new versions.

Leveraging Readarr’s Unique Features

πŸ”§ Enabling APIs

To use Readarr’s API, generate an API key under Settings > General > Security. Use this key for API calls, e.g., to fetch all books:


curl -X GET "http://<your-server-ip>:7878/api/v1/book" -H "X-Api-Key: YOUR_API_KEY"

🌟 Advanced Configurations

Integrate with third-party tools like Radarr or Sonarr by enabling Custom Scripts under Settings > Connect, and add webhook endpoints to trigger actions upon book downloads.

Wrapping Up

By following this guide, you’ve installed, configured, and optimized Readarr to manage your media library efficiently. With its robust API, automation features, and seamless integration options, Readarr empowers you to take full control of your eBook and audiobook collections. Start implementing these steps today to unlock the full potential of Readarr!

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Selfhosted Ninja.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.