LazyLibrarian is a self-hosted tool for managing your eBook and audiobook library. It automates the discovery, downloading, and organization of books through various providers, offering seamless integration with other services like Calibre. As an open-source solution, LazyLibrarian gives you complete control over your media and is highly customizable, making it ideal for developers and tech-savvy users. In this guide, youβll learn how to deploy, configure, and manage LazyLibrarian with actionable steps, from installation to advanced configurations.
Installing LazyLibrarian
π¦ Docker/Docker Compose Setup
Docker is a popular and efficient method to deploy LazyLibrarian. Hereβs how to set it up:
- Create a
docker-compose.yml
file:
This file defines the LazyLibrarian container, including port mappings, volume configurations, and environment variables.
version: "3.8"
services:
lazylibrarian:
image: linuxserver/lazylibrarian:latest
container_name: lazylibrarian
environment:
- PUID=1000 # Replace with your user ID
- PGID=1000 # Replace with your group ID
- TZ=America/New_York # Replace with your timezone
volumes:
- ./config:/config # Configuration files
- ./downloads:/downloads # Downloaded books
- ./books:/books # Final book directory
ports:
- 5299:5299 # LazyLibrarian web UI
restart: unless-stopped
- Deploy the container using Docker Compose:
Run the following commands to start LazyLibrarian.
mkdir -p ~/lazylibrarian/{config,downloads,books}
cd ~/lazylibrarian
nano docker-compose.yml # Paste the configuration above
docker-compose up -d
The LazyLibrarian web UI will now be accessible at http://<your-server-ip>:5299
.
π Manual Installation
For those not using Docker, follow these steps to install LazyLibrarian manually on Ubuntu:
- Install dependencies:
sudo apt update
sudo apt install -y git python3 python3-pip
- Download LazyLibrarian:
git clone https://gitlab.com/LazyLibrarian/LazyLibrarian.git ~/LazyLibrarian
cd ~/LazyLibrarian
- Install Python dependencies:
pip3 install -r requirements.txt
- Run LazyLibrarian:
python3 LazyLibrarian.py
To access the web UI, open http://<your-server-ip>:5299
. For production use, consider running it as a systemd service.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
Use Nginx as a reverse proxy to route HTTP traffic to LazyLibrarian for better security and easier access.
- Create an Nginx server block:
sudo nano /etc/nginx/sites-available/lazylibrarian
Add the following configuration:
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://127.0.0.1:5299;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- Enable the configuration and reload Nginx:
sudo ln -s /etc/nginx/sites-available/lazylibrarian /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
Secure your setup using Letβs Encrypt for free SSL certificates.
- Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
- Obtain and configure an SSL certificate:
sudo certbot --nginx -d yourdomain.com
- Automate SSL certificate renewal:
sudo systemctl enable certbot.timer
Logging and Debugging LazyLibrarian
ποΈ Enabling Debug Logs
Enable debug-level logging to troubleshoot issues during setup or operation.
- Access LazyLibrarian's configuration:
-
Navigate to
http://<your-server-ip>:5299
. -
Go to
Config > Logging
and enable debug logging.
- Save the configuration and restart the app.
π Viewing Logs
Access logs directly on the host system or via Docker.
- For Docker:
docker logs lazylibrarian
- For manual installation:
tail -f ~/LazyLibrarian/Logs/lazylibrarian.log
π οΈ Troubleshooting Common Issues
If LazyLibrarian fails to start, check for errors in the logs. Common issues include:
- Permission errors: Ensure directories have the correct user and group ownership.
sudo chown -R 1000:1000 ~/lazylibrarian
- Port conflicts: Verify no other service is using port 5299.
sudo netstat -tuln | grep 5299
Backup and Restore
ποΈ File-Based Backups
Backup LazyLibrarianβs configuration and data directories.
tar -czvf lazylibrarian-backup.tar.gz ~/lazylibrarian/config ~/lazylibrarian/books
π Database Backups
If LazyLibrarian uses a database, back it up separately:
sqlite3 ~/lazylibrarian/config/lazylibrarian.db .dump > lazylibrarian-db-backup.sql
π Automated Backup Scripts
Automate backups using cron:
crontab -e
Add the following line:
0 2 * * * tar -czvf ~/lazylibrarian-backup-$(date +\%F).tar.gz ~/lazylibrarian/config ~/lazylibrarian/books
Updating and Upgrading LazyLibrarian
β¬οΈ Updating Docker Images
Update LazyLibrarian by pulling the latest Docker image:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
If installed manually, update LazyLibrarian by pulling the latest code:
cd ~/LazyLibrarian
git pull
Restart the application:
python3 LazyLibrarian.py
π Checking for Updates
Check for updates within the LazyLibrarian web UI under Config > Updates
.
Leveraging LazyLibrarianβs Unique Features
π§ Enabling APIs
LazyLibrarian supports API access for integration with other tools.
- Enable the API:
-
Navigate to
Config > Interface
. -
Enable the API and generate an API key.
- Test the API with
curl
:
curl -X GET "http://<your-server-ip>:5299/api?cmd=author&apikey=YOUR_API_KEY"
π Advanced Configurations
Customize LazyLibrarian for advanced use cases:
-
Add custom download providers under
Config > Downloaders
. -
Integrate with Calibre to organize your library automatically.
Wrapping Up
This guide covered all the essential steps to deploy, configure, and manage LazyLibrarian, from Docker-based installation to configuring Nginx and troubleshooting. By self-hosting LazyLibrarian, you gain full control over your book library while leveraging its powerful features and automation capabilities. Start implementing these steps and take full advantage of this robust application!