View Single Post
Old 07-08-2017, 06:40 AM   #1
khyox
Junior Member
khyox began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2017
Device: kindle paperwhite
installing Calibre content server 3 on ubuntu server 16_04

The following guide is a result of my google search to install calibre 3 on a server running ubuntu:

the environment:

a pc running ubuntu server 16_04 lts connected to the internet
a sudo users
a public ip to reach the server from the internet
a port open on linux firewall and router
a kindle paperwhite connected to the internet

install calibre:

Code:
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda x:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main('/opt')"

I used the /opt folder

Ignore all the warnings

Update your package lists:

Code:
sudo apt-get update
Install xvfb:

Code:
sudo apt-get install xvfb
or install X server library


create calibre log file:

Code:
sudo nano  /opt/calibre/calibre.log
digit some spaces and save the file


Let suppose that the linux user is "myuser"

create calibre users:

I discovered that my calibre user database is in ~/.config/calibre/server-users.sqlite

Code:
sudo calibre-server --userdb /home/myuser/.config/calibre/server-users.sqlite --manage-users
follow the instruction on the screen
I created two user:
- one with write permissions
- one with only read permissions

create the calibre.service:

Code:
sudo nano /lib/systemd/system/calibre.service
insert:


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

[Service]
Type=simple
User=mylinuxuser
Group=mylinuxgroup

ExecStart=/usr/bin/calibre-server\
--daemonize\
--max-opds-items=30\
--max-opds-ungrouped-items=100\
--port YOUR_PORT_NUMBER \
--log=/opt/calibre/calibre.log \
--enable-auth \
/PATH_TO_LIBRARY_1 \
/PATH_TO_LIBRARY_2 \
/PATH_TO_LIBRARY_3 \
/................. \
/PATH_TO_LIBRARY_n


[Install]
WantedBy=multi-user.target



please notice that:
- I use a path without spaces and I set an empty space before \
- there is no \ after the last path


Check that it is correctly configured by executing
Code:
sudo systemctl start calibre.service
Calibre Server should start up correctly and you can check by using

Code:
sudo systemctl status calibre.service
2. To enable the service to run on every start up simply execute

Code:
sudo systemctl enable calibre.service
and that will create a symbolic link to the /etc/systemd/system/multi-user.target.wants directory so it will start every time you boot into multi-user mode

to check that everythings are ok open your browser and navigate to \\your ip:your port
insert user and pwd

please consider to allow port in ufw and in your router...

some tricks:

after any changes in file: /lib/systemd/system/calibre.service
please run:


Code:
sudo systemctl daemon-reload
Code:
sudo systemctl start calibre.service
I use the gui CALIBRE interface under windows to manage my libraries and I refresh the content server with the command:

Code:
sudo systemctl stop calibre.service
sudo systemctl start calibre.service
probably there is a better method but I don't know it.......

I actually have 3 libraries, I don't know how many you can have...

I have a kindle paperwhite so I created a book with a link (I created it in word, converted to AZW3 in Calibre and downloaded in my kindle) :

http://caliberuser:calibrepassword@y...ourport/mobile

I use the mobile version because kindle browser probably don't support java script or is extremely slow...

sources:

https://www.digitalocean.com/communi...n-ubuntu-14-04
https://manual.calibre-ebook.com/ser...mand-line-only
https://manual.calibre-ebook.com/gen...re-server.html
http://thanosk.net/content/running-c...-under-systemd
https://manual.calibre-ebook.com/ser...n-linux-system

please consider that I'm not a guru and all this stuff is a result of google search and some night lost...
I hope this can help


many thanks to Kovid and all the calibre guys , peace and love
,

khyox

Last edited by khyox; 07-13-2017 at 03:24 AM.
khyox is offline   Reply With Quote