Skip to content

Calibre Server #5270

Description

@Skinn0r

Creating a software request

Formal software information

Are there similar/alternative software titles available with DietPi-Software?

no

What makes your requested software better than the above solutions, if available?

How can DietPi make the installation easier or compatible, than following the install instructions or do APT installation, if available?

https://www.pradoshkharel.com/2020/07/18/setting-up-a-calibre-server-on-the-raspberry-pi.html

  • ...

Can you provide the installation steps that you would suggest DietPi-Software to do?

Setting up calibre
Install calibre. The newest version of calibre doesn’t seem to be available in the repos. TODO should try building newer version from source

sudo apt install calibre

Create a calibre library.

mkdir /mnt/elements/media/ebooks/
cd /mnt/elements/media/ebooks/
wget http://www.gutenberg.org/ebooks/1342.kindle.noimages -O pride.mobi
calibredb add /mnt/elements/media/ebooks/* --library-path /mnt/elements/media/ebooks/

Make sure everything works

calibre-server /mnt/elements/media/ebooks/

Try loading up http://127.0.0.1:8080

(Optional) Create a systemd service unit file to manage the server. Create file at /etc/systemd/system/calibre-server.service with the following

[Unit]
Description=calibre content server
After=network.target

[Service]
Type=simple
User=pi
Group=pi
ExecStart=/usr/bin/calibre-server "/mnt/elements/media/ebooks/"

[Install]
WantedBy=multi-user.target

Try starting up the server

systemctl enable calibre-server
systemctl start calibre-server

Nginx configuration
We want to be able to access the Calibre server via something like http://ebooks.myserver.com. Assuming DNS is already set up properly. TODO maybe a separate post on Google Domains + Nginx + LetsEncrypt

Add a new site to Nginx by creating a new file at /etc/nginx/sites-available/ebooks.myserver.com

upstream calibre_backend {
  server    127.0.0.1:8080;
  keepalive 32;
}

server {
  listen 80;
  server_name         ebooks.myserver.com;
  location / {
    proxy_pass http://calibre_backend;
  }
}

Enable site

cd /etc/nginx/sites-enabled/
ln -s ../sites-available/ebooks.myserver.com
systemctl restart nginx

Enable HTTPS
Get certs from LetsEncrypt. The app should ask you if you want to change the configuration to force HTTPS. That’ll update the Nginx config and enable HTTPS.

sudo certbot --nginx -d ebooks.myserver.com

Are you willing to help maintaining the software installation, e.g. in case of needed setup changes due to updates etc.? This is not needed, but could speed up our decision to implement it, as man power is always a topic 😉.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions