====== Calibre ======
The Calibre library server allows you to:
* Share your books with others.
* Easily transfer your books between devices and access them from anywhere.
--------
==== Installation ====
Install the Calibre package. You might also want rsync to upload books.
apt install -y calibre rsync
mkdir /opt/calibre
Upload your local library (using rsync) to ''%%/opt/calibre/%%'' and save the command somewhere.
rsync -avuP --delete-after ~/local_library/ root@example.org:/opt/calibre/server_library/
Then add a new user to protect your server:
calibre-server adduser name
==== Creating a service =====
Create a new file ''%%/etc/systemd/system/calibre-server.service%%'' and add the following:
[Unit]
Description=Calibre library server
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibre/library --listen-on 127.0.0.1
[Install]
WantedBy=multi-user.target
to apply the change:
systemctl daemon-reload
Enable and start the service.
systemctl enable calibre-server
systemctl start calibre-server
==== Creating the Server with Nginx ====
Create a new file /etc/nginx/sites-available/library and enter the following:
server {
listen 80;
client_max_body_size 64M; # to upload large books
server_name library.example.org ;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
Then symlink to sites-enabled:
ln -s /etc/nginx/sites-available/library /etc/nginx/sites-enabled
Then issue a Let's Encrypt certificate.
certbot --nginx
Now add the DNS Records to point the calibre-sever to your name-server.
| **Type** | **Name** | **Points to** | **TTL** |
| CNAME | library | example.xyz | 1m |
------
Now just go to library.example.org, the server will request the username and password you've set above.
ENJOY!