An Alternative to Calibre Server, Build your own E-Book Library with Ubooquity & Calibre

Pedro Martins
5 min readMar 6, 2021

Calibre is for sure a great open-source tool to organize, transfer and read your favourite e-books directly to your Reader like Kobo, Kindle, Noble and such. Its available for Windows, Mac, and Mobile, and works great so far, but this past Christmas i was struggling really hard on how to have my own PDFs and Epubs directly into my e Reader without much effort, i understand why brands make it so hard to transfer books, but come on! let us have some freedom!

Calibre Software for Windows

The challenge

Sometimes you don’t have a USB cable on your pocket but you still want to transfer or access your e-book library anywhere quickly and easy.

While Calibre works most of the time for most of the users, I came up with the challenge to automatically add my books from GoogleDrive directly into my library, this can be a tedious work ( At least I found it boring ).

In Summary i wanted that all the e-books added into my Google Drive to be added into my e-book library.

Since the e-books browser is a bit buggy and slow ( In favor of saving battery and keep it fast & clean ), we could not rely on Dropbox or Google Drive to do it.

Calibre Server & BicBucStriim

So I went searching how I could set up a Calibre Server, I found the process a bit long for a simple task, how hard could it be to have an online e-book server? For the Calibre server, we could use a Raspberry PI, a Ubuntu VPS or even a NAS.

So i started reading this tutorial to setup Calibre on Ubuntu Server, but it was too boring to setup a VPS to simply have my book library, since i own a Synology NAS, iv started looking how can i add Calibre Server package into my Sinology device.

Found then this nice Package called BicBucStriim, quickly installed it on my NAS and had it up & running in less than 10 minutes.

The Instructions to Install BicBucStriim can be found on the Github repository but they are simple as :

  • Login to your Synology NAS
  • Enable Web Server, PHP & Apache
  • Copy the Folder of the software to a directory like : /bbs on your “web” folder
  • Visit your NAS at https://xxx.xxx.xxx.xxx/bbs
Admin interface for BicBucStriim

Ubooquity — Simple & Easy

I already had BicBucStriim Installed, but I didn’t like it a lot, the interface was pretty old, the code was messy and, was still locked to Calibre Library. 👻

Found then this awesome software called Ubooquity, downloaded and simply ran the jar file and the server was up & running! How simple and easy can this be? Found also a very nice and pre-built docker image that can save you tons of time setting up this software on Linux!

Quickly started to have a look at how to set up this on my current Synology NAS and the couldn’t be easier, a tutorial was right there! Found easier to setup with the following steps :

  • Create a folder on your NAS for the Software/Binaries & Configs
  • Copy the Ubooquity.jar into that directory ( Download here )
  • Copy the SH file ( script ) into the same directory
  • Create a folder named .ubooquity
  • Setup a scheduled task to execute your Ubooquity on startup

The screenshots bellow shows the examples of the setup :

Setup for JAR file and SH file on Synology NAS file system
Setting up the scheduled command to automatic scan for new books

The script file used is bellow, feel free to change to match your environment variables. Remember that Java 8 is required, installed it threw Synology Package Manager. If you are not sure where is your Java 8 Binary SSH into your NAS/Server and type: “which java”

#!/bin/sh
#title : ubooquity.sh
#description : Launch ubooquity server

### JAVA VARIABLES ###
# Java installation directory
JAVA_DIR=/var/packages/Java8/target/j2sdk-image/bin
# Maximum size of the Java runtime memory allocation pool. Default: 64MB
MEM=512m
### UBOOQUITY VARIABLES ###
# Ubooquity binary location
UBOOQUITY_BIN=/volume1/Books/bin/Ubooquity.jar
# Ubooquity working directory
WORK_DIR=/volume1/Books/bin/.ubooquity
# Ubooquity process ID file location
PID_FILE=$WORK_DIR/ubooquity.pid
# Ubooquity library port
LIB_PORT=2202
# Ubooquity administration port
ADMIN_PORT=2203
### ENVIRONMENT VARIABLES ###
# Character encoding
ENCO=UTF-8
# Locale selection
LANG=en_US.$ENCO
### SCRIPT ###
# Workaround to read special characters properly
export LANG
# Kill previous process
if [ -f $PID_FILE ]; then
pkill -F $PID_FILE > /dev/null 2>&1
fi
# Launch ubooquity
printf "Starting Ubooquity server...\n"
$JAVA_DIR/java -jar -Dfile.encoding=$ENCO -Xmx$MEM $UBOOQUITY_BIN \
--adminport $ADMIN_PORT --libraryport $LIB_PORT \
--workdir $WORK_DIR \
--remoteadmin --headless & UBOOQUITY_PID=$!
echo $UBOOQUITY_PID > $PID_FILE
printf "Ubooquity is now running (pid: %d).\n" $UBOOQUITY_PID
exit 0

After the script is saved you can hit “Run Now” on the Task Scheduler, your e-Book Server should now be up and running on the port 2202 and 2203, you can go forward and set up any port forward of your choice to access this service outside of your network. Ex: https://mynasaddress.com:2202

If you are not sure how to set up a domain to your NAS please follow this tutorial.

Pros and Cons

Not sure what to pick? Lets summarize the pros and cons of each one:

Calibre

  • Lots of options to convert, format and create e-books, fetch news online, etc.
  • Mobile, Windows & Mac Apps
  • Great Community Support
  • Heavy and Complicated
  • Cannot be easily synced with Dropbox or Google Drive
  • Extensive Server setup for newbie users
  • Client and Server Software is available

Ubooquity

  • Server Only
  • Simple and Clean Interface
  • Cross Platform ( Java )
  • Server can be easily fetch with Dropbox and Google Drive on a NAS
  • Docker Images and easy setup for newbies
  • Still has few bugs here and there.
  • Lacking Advanced Options

Firmware to the Rescue

If you don’t want o handle all the server setup, you can also have more freedom by flashing some custom firmware/launcher, please keep in mind this operation is risk and is not recommend for basic users, but it brings so many niceee features!

Summary

Calibre offers the best of both worlds by having a simple client and a server, ready to go & free of use, but i found it hard and overpowered to simply have a e-book directory online. Ubooquity did his job with a quick and easy setup. We hope you enjoy and happy e-book reading 👋

--

--

Pedro Martins

👋 Hey, Im Pedro a Full stack developer. Love to research about online security, reverse engineer, mobile apps security, automation & complex stuff.