Install Calibre eBook Manager on Arch Linux

Install Calibre ebook managment software on Arch Linux

Calibre is an eBook management application that can be used on multiple platforms. Calibre server on the other hand runs as a web service. It is not as feature rich and seems very outdated, buggy and clunky to use. It is however the only option currently available and does provide basic functionality that allows to browse and download eBooks from a web browser.

 

Install Calibre

Install Packer on Arch Linuxinstall Yaourt or use another package wrapper.

 

Install the package from AUR with packer.

packer -S calibre

 

Install poppler (Optional).

packer -S poppler

Required only for PDF to HTML conversion.

 

Create Credentials

Create a system account and group.

sudo useradd -r -s /bin/false calibre

 

Add the user to secondary groups (optional).

sudo usermod -a -G nzbget,utserver calibre

 

Configure Calibre

Create home directory.

mkdir /home/calibre

 

Change the home directory ownership.

sudo chown -R calibre:calibre /home/calibre

 

Create the download directory.

mkdir mnt/downloads/books

 

Set the ownership on the download directory.

sudo chown calibre:calibre /mnt/downloads/books

 

Set the permissions on the download directory.

sudo chmod 770 /mnt/downloads/books

 

Run Calibre

Create a systemd script.

sudo nano /etc/systemd/system/calibre.service

 

Copy the script and save.

[Unit]
Description=Calibre Service
After=network.target

[Service]
User=calibre
Group=calibre
Type=forking
PIDFile=/home/calibre/calibre-server.pid
ExecStart=/usr/bin/calibre-server \
          --daemonize \
          --max-cover=600x800 \
          --max-opds-items=30 \
          --max-opds-ungrouped-items=100 \
          --username=dom \
          --password=*********** \
          --port=8010 \
          --pidfile=/home/calibre/calibre-server.pid \
          --with-library=/mnt/virtual/books/

[Install]
WantedBy=multi-user.target

 

Start the service.

sudo systemctl start calibre

 

Enable the service to run on boot.

sudo systemctl enable calibre

 

Import Books

Import books with calibredb command line tool manually.

calibredb add /mnt/downloads/books --library-path /mnt/virtual/books

 

Create a systemd script.

sudo nano /etc/systemd/system/calibre-import.service

 

Copy the script and save.

[Unit]
Description=Calibre Import Service
After=network.target

[Service]
User=calibre
Group=calibre
ExecStart=/usr/bin/calibredb add /mnt/downloads/books --library-path /mnt/virtual/books

[Install]
WantedBy=calibre-import.timer

 

Run the import script.

sudo systemctl start calibre-import

 

Enable import script to run on boot.

sudo systemctl enable calibre-import

 

Import Books Automatically

Create a systemd timer.

sudo nano /etc/systemd/system/calibre-import.timer

 

Copy the systemd timer script and save.

[Unit]
Description=Calibre Import Service Timer (runs every minute)

[Timer]
OnUnitActiveSec=1min
Persistent=true
Unit=calibre-import.service

[Install]
WantedBy=multi-user.target

 

Start the the import timer.

sudo systemctl start calibre-import.timer

 

Enable import timer to run on boot.

sudo systemctl enable calibre-import.timer