How do I add Calibre Web to Ubuntu Server running Nextcloud AIO?

I’d like to sync my ebooks. Anyone here successfully installed Calibre Web alongside Nextcloud AIO?

I don’t know how safe it would be to expose Calibre Web to the WAN, even though my domain is behind Cloudflare.
The setup would ideally allow Calibre to access the ebook files I store in a particular Nextcloud folder.

Any ideas?

Calibre Web is totally separate from Nextcloud.
You’ll need to learn how to use Docker to manage multiple containers since you’ve mentioned using AIO.
Also, use Calibre web documentation.

Requires a little networking understanding.

You’ll need to learn a bit about how DNS and your domain work. Cloudflare would be the place to seek assistance on that.

Once you have:

  • deployed Nextcloud AIO
  • deployed CalibreWeb in Docker
    • docker-compose will be critical in helping you manage multiple containers. See their documentation.
  • setup DNS and your Domain details through Cloudflare
    • See their documentation for how to manage multiple services.
    • Might require additional reverse proxy configuration, but I don’t use cloudflare so see their documentation.

then you should be in a nice position to:

  • share a directory between Nextcloud and Calibre as www-user permissions.
    • You’ll want to learn about how Unix permissions work for users and groups using chown chgrp and similar. Many guides online.
    • docker-compose will simplify this process. Go back to that step if you skipped it.

^^ If you get stuck on this final step we can help with it.

There is no way around the technical difficulty of setting this up. Welcome to selfhosting. It is an eventful and complex world, which can include a steep learning curve. :heart: Your question is outside of what we can actually support here, which is all specific to Nextcloud itself as opposed to other projects.

I think this could be doable with a bit of getting grease on your hands. In other words, if you are not afraid to swing at coding.

But I do see one issue… you would have to run a no-login/public instance of Calibre and/or Calibre-Web. This would be an issue because of the fact that Calibre and Calibre-Web both use two SQLite databases, one for users and one for books. If the user database file does not exist, then the installation assumes that the library(s) is/are public.

If you would like to tackle the above, then please feel free to look me up on Reddit at u/thisiszeev. I would be happy to work with them to at least get Calibre-Web running in Nextcloud as an “external site” from the menu. But bear in mind, the “external site” would be 100% open to the public. This is risky. But as a nice weekend project, you are sure to learn a bit.

In order to really make this work, one would need to really get covered in grease, head to toe, and develop something a bit more substantial. I would say, for now, have the SQLite library databases on the server in a folder within Nextcloud, but I would try and avoid it from being in the www path structure. Like you should be doing for your user folders.

I would then create a “share” either SMB or NFS or SSH to your local machine and setup your Calibre instance on your local machine to use those SQLite libraries and store the various books in the relative folders of each library.

This would allow you to easily manage the libraries from a very powerful GUI that works 1000x better than Calibre-Web and 10000000x than Calibre-Server.

The added advantage is that your plugin can then be used in “admin mode” to afford access to each library on a per-user/group basis. Simple SQLite code for PHP would allow you to read the data from the respective SQLite databases as per the user/group permissions. Thus allowing the user to access the book(s) of his or her choice.

This, however, would be a read-only solution, but it’s a solution for now… Once you are at this point then you would start porting features across.

Again, hit me up on Reddit if you want to discuss the concept in depth. I am currently snowed in with dev work but am happy to guide/assist/point in the right direction, for anyone who wants to do this as a “I-taught-myself-to-code” project.

My resume: Linux Desktop/Server (full range - though I suck at docker), BASH, PHP, MySQL, HTML5, CSS3, enough JS to start Armagedon, and recently added some JQuery to my belt, since I started making extensive use of APIs and JSON. Currently learning Vue.JS and loving it. Next on my bucket list is Rust.

1 Like

In researching further, I found this insightful tutorial:

1 Like

I’m trying to do the same thing. I need to setup a private document library where I can store all my PDFs and documents so I can login and access them from any device. Maybe we can collaborate and come up with a solution.

I found this article:

Which describes it, I don’t know if solves the problem of it being publicly accessible though.