PHPackages                             mikespub/seblucas-cops - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. mikespub/seblucas-cops

ActiveProject[File &amp; Storage](/categories/file-storage)

mikespub/seblucas-cops
======================

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)

4.5.2(1w ago)127219GPL-2.0-or-laterPHPPHP &gt;=8.4

Since Dec 31Pushed 2w ago11 watchersCompare

[ Source](https://github.com/mikespub-org/seblucas-cops)[ Packagist](https://packagist.org/packages/mikespub/seblucas-cops)[ RSS](/packages/mikespub-seblucas-cops/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (92)Versions (148)Used By (0)

COPS for PHP 8.x
================

[](#cops-for-php-8x)

Breaking changes for 4.x release (PHP &gt;= 8.4)
------------------------------------------------

[](#breaking-changes-for-4x-release-php--84)

None if you upgrade from 3.x, besides the PHP version

Breaking changes for 3.x release (PHP &gt;= 8.2)
------------------------------------------------

[](#breaking-changes-for-3x-release-php--82)

### For everyone

[](#for-everyone)

- move your customized *config\_local.php* file to *config/local.php* on the web server/container
- replace any *feed.php* links with *index.php/feed* for OPDS feeds in your e-reader

### Less common

[](#less-common)

- if you map the *lib/* or *test/* directory somewhere, like a docker compose file, web server config etc. you'll need to replace that with *src/* or *tests/* respectively
- if you use other endpoints for links elsewhere, like the REST API for a widget, you'll need to use route URLs and replace *restapi.php* with *index.php/restapi* etc.

Prerequisites for this fork
---------------------------

[](#prerequisites-for-this-fork)

- PHP 8.x with DOM, GD, Intl, Json, PDO SQLite, SQLite3, XML, Zip and ZLib support (PHP 8.4 or later recommended)
- Release 4.x.x will only work with PHP &gt;= 8.4 - typical for most source code &amp; docker image installs in 2025 and later. *Note: updating .epub files for metadata or cover requires a 64-bit platform*
- Release 3.x.x will only work with PHP &gt;= 8.2 - typical for most source code &amp; docker image installs in 2024 and later. *Note: updating .epub files for metadata or cover requires a 64-bit platform*
- Release 2.x.x will only work with PHP &gt;= 8.1 - typical for most source code &amp; docker image installs in 2023 and later. *Note: updating .epub files for metadata or cover requires a 64-bit platform*
- Release 1.x.x still works with PHP 7.4 if necessary - earlier PHP 7.x (or 5.x) versions are *not* supported with this fork

User support issues remain available at  - please use it if you need help with COPS in general. For the 2.x, 3.x and 4.x versions please report any new issues at

Pull requests should be against the latest source code at  - thanks for any contributions :-)

See [CHANGELOG](CHANGELOG.md) for changes compared to upstream repository  from @seblucas

Installation of this fork
-------------------------

[](#installation-of-this-fork)

Same options as original:

1. Release package

- get latest cops-3.x.x-php8x.zip file from

Note: the release packages `cops-3.x.x-php8x.zip` include the vendor/ packages for a particular PHP version. If you have an older or newer (supported) PHP version, you can download the `Source code (zip)` for that release, and run *composer* to update the dependencies:

```
$ wget -O cops-3.x.x.zip https://github.com/mikespub-org/seblucas-cops/archive/refs/tags/3.x.x.zip
$ unzip cops-3.x.x.zip
$ cd seblucas-cops-3.x.x
$ composer update --no-dev -o

```

2. Source code

- git clone  # or download [latest main as zip](https://github.com/mikespub-org/seblucas-cops/archive/refs/heads/main.zip)
- run *composer* to install project dependencies

```
$ cd seblucas-cops
$ composer install --no-dev -o

```

3. Docker image

- use latest [linuxserver/cops](https://hub.docker.com/r/linuxserver/cops) image from [linuxserver.io](https://github.com/linuxserver/docker-cops) - see setup and usage there
- or use [docker/Dockerfile.alpine](docker/Dockerfile.alpine) and [docker-compose.yaml](docker-compose.yaml) (or [docker-compose-dev.yaml](docker-compose-dev.yaml)) as starting point - **not** optimized for size/performance

4. Home Assistant Add-on

- see [HA COPS](https://github.com/dunxd/HomeAssistantAddons/tree/main/COPS) from [dunxd](https://github.com/dunxd/HomeAssistantAddons)

The rest of the installation process is very similar to the original below. But if you install from source, just use your regular composer 2.x - you don't need to download an old composer 1.x version or install global asset plugins anymore :-)

Notice: for a first-time installation, you need to copy *[config/local.php.example](config/local.php.example)* to *config/local.php* and customize the calibre directory etc. as needed. Afterwards, if you get an error or blank page the first time you browse to COPS, you can check for common issues by browsing to http://.../index.php/check or http://.../checkconfig.php

---

COPS (original)
===============

[](#cops-original)

COPS stands for Calibre OPDS (and HTML) Php Server.

See : [COPS's home](https://blog.slucas.fr/en/oss/calibre-opds-php-server) for more details.

Don't forget to check the [Wiki](https://github.com/seblucas/cops/wiki).

Why ?
=====

[](#why-)

In my opinion Calibre is a marvelous tool but is too big and has too much dependencies to be used for its content server.

That's the main reason why I coded this OPDS server. I needed a simple tool to be installed on a small server (Seagate Dockstar in my case).

I initially thought of Calibre2OPDS but as it generate static file no search was possible.

Later I added an simple HTML catalog that should be usable on my Kobo.

So COPS's main advantages are :

- No need for many dependencies.
- No need for a lot of CPU or RAM.
- Not much code.
- Search is available.
- It was fun to code.

If you want to use the OPDS feed don't forget to specify feed.php at the end of your URL.

You just have to sync your Calibre directory to your COPS server the way you prefer (Dropbox, Bt Sync, Syncthing, use a directory shared with Nextcloud, ...).

Prerequisites (outdated)
========================

[](#prerequisites-outdated)

1. PHP 5.3, 5.4, 5.5, 5.6, 7.X or hhvm with GD image processing, Libxml, Intl, Json &amp; SQLite3 support (PHP 5.6 or later recommended).
2. A web server with PHP support. I tested with various version of Nginx and Apache. Other people reported it working with Apache and Cherokee. You can also use PHP embedded server ()
3. The path to a calibre library (metadata.db, format, &amp; cover files).

On any Debian based Linux you can use : `apt-get install php5-gd php5-sqlite php5-json php5-intl`

If you use Debian Stretch : `apt-get install php7.0-gd php7.0-sqlite3 php7.0-json php7.0-intl php7.0-xml php7.0-mbstring php7.0-zip`

On Centos you may have to add : yum install php-xml

Install a release (Easiest way)
===============================

[](#install-a-release-easiest-way)

1. Extract the zip file you got from [the release page](https://github.com/seblucas/cops/releases) to a folder in web space (visible to the web server).
2. If you're doing a first-time install, copy *[config/local.php.example](config/local.php.example)* to *config/local.php* (this differs from the original project)
3. Edit config/local.php to match your config.
4. If needed add other configuration item from config/default.php

If you like Docker, you can also try this multiarch docker container from [linuxserver.io](https://hub.docker.com/r/linuxserver/cops/) It has builds for x64 and arm64.

Install from sources
====================

[](#install-from-sources)

```
git clone https://github.com/seblucas/cops.git # or download lastest zip see below
cd cops
# use standard composer 2.x now, no need to install older 1.x version and plugin for PHP 8.x version
#wget https://getcomposer.org/composer.phar
#php composer.phar global require "fxp/composer-asset-plugin:~1.1"
#php composer.phar install --no-dev --optimize-autoloader
composer install --no-dev --optimize-autoloader
```

After that you can use the previous how-to starting at the second step.

Note that instead of cloning you can also get [latest master as zip](https://github.com/seblucas/cops/archive/master.zip)

Note that if your PHP version is lower that 5.6, then you may have to remove `composer.lock` before starting the last line.

Where to put my Calibre directory ?
===================================

[](#where-to-put-my-calibre-directory-)

Long story short : ALWAYS outside of COPS's directory especially if COPS is installed on a VPS / Server. If you follow my advice then your data will be safe.

If you choose to put your Calibre directory inside your web directory and use Nginx then you will have to edit /etc/nginx/mime.types to add these lines :

```
application/epub+zip epub;
application/x-mobipocket-ebook mobi prc azw;

```

Known problems
==============

[](#known-problems)

Not a lot, except for the bad quality of the code (first PHP project ever) ;)

Please see  for open issues

Need help
=========

[](#need-help)

Please read  and check the FAQ.

Contributing
============

[](#contributing)

As you could see [here](https://github.com/seblucas/cops/graphs/contributors), I appreciate every contributions and there were a lot over time. So don't be shy and submit your Pull Requests.

Note to translators : please prefer using [Transifex](https://github.com/seblucas/cops/wiki/Update-translations) instead of doing a PR.

I only have one limit (I may have more but that one is the worse) : COPS' goal is to provide an alternative to Calibre's content server and not to replace Calibre entirely. So I will refuse any PR making changes to the database content.

Credits
=======

[](#credits)

- Locale message handling is inspired of
- str\_format function come from
- All icons come from Font Awesome :
- The unofficial OPDS validator :
- Thanks to all testers, translators and contributors.
- Feed icons made by Freepik from Flaticon website licensed under Creative Commons BY 3.0  and
- A huge thanks to Jetbrains for supporting COPS by providing a set of free licenses to their products for several years now!

External libraries used :

- JQuery :
- Magnific Popup :
- Php-epub-meta :  with some modification by me ()
- TbsZip : [https://www.tinybutstrong.com/apps/tbszip/tbszip\_help.html](https://www.tinybutstrong.com/apps/tbszip/tbszip_help.html)
- DoT.js :
- PHPMailer :
- js-lru :

Copyright &amp; License
=======================

[](#copyright--license)

COPS - 2012-2019 (c) Sébastien Lucas

See LICENSE and file headers for license info

###  Health Score

66

↑

FairBetter than 99% of packages

Maintenance98

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community27

Small or concentrated contributor base

Maturity99

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~0 days

Total

145

Last Release

9d ago

Major Versions

0.9.0 → 1.0.0RC12014-04-03

1.x-dev → 2.0.02023-09-10

2.x-dev → 3.0.02024-09-05

3.x-dev → 4.0.02025-11-27

PHP version history (4 changes)1.4.2PHP &gt;=7.4

2.0.2PHP &gt;=8.1

3.0.0PHP &gt;=8.2

4.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1447115?v=4)[Mike's Pub](/maintainers/mikespub)[@mikespub](https://github.com/mikespub)

---

Top Contributors

[![seblucas](https://avatars.githubusercontent.com/u/437682?v=4)](https://github.com/seblucas "seblucas (1250 commits)")[![mikespub](https://avatars.githubusercontent.com/u/1447115?v=4)](https://github.com/mikespub "mikespub (956 commits)")[![dunxd](https://avatars.githubusercontent.com/u/16608541?v=4)](https://github.com/dunxd "dunxd (177 commits)")[![mbirth](https://avatars.githubusercontent.com/u/130302?v=4)](https://github.com/mbirth "mbirth (53 commits)")[![SenorSmartyPants](https://avatars.githubusercontent.com/u/991618?v=4)](https://github.com/SenorSmartyPants "SenorSmartyPants (46 commits)")[![horus68](https://avatars.githubusercontent.com/u/3055443?v=4)](https://github.com/horus68 "horus68 (44 commits)")[![Mikescher](https://avatars.githubusercontent.com/u/175731?v=4)](https://github.com/Mikescher "Mikescher (33 commits)")[![wogong](https://avatars.githubusercontent.com/u/1542499?v=4)](https://github.com/wogong "wogong (12 commits)")[![glls](https://avatars.githubusercontent.com/u/392030?v=4)](https://github.com/glls "glls (12 commits)")[![sbdomo](https://avatars.githubusercontent.com/u/2596665?v=4)](https://github.com/sbdomo "sbdomo (10 commits)")[![miicha](https://avatars.githubusercontent.com/u/3731697?v=4)](https://github.com/miicha "miicha (10 commits)")[![At-Libitum](https://avatars.githubusercontent.com/u/5471779?v=4)](https://github.com/At-Libitum "At-Libitum (9 commits)")[![cadric](https://avatars.githubusercontent.com/u/964797?v=4)](https://github.com/cadric "cadric (9 commits)")[![scorphus](https://avatars.githubusercontent.com/u/2112697?v=4)](https://github.com/scorphus "scorphus (9 commits)")[![marsender](https://avatars.githubusercontent.com/u/279979?v=4)](https://github.com/marsender "marsender (6 commits)")[![Tolaris](https://avatars.githubusercontent.com/u/743052?v=4)](https://github.com/Tolaris "Tolaris (6 commits)")[![bitjungle](https://avatars.githubusercontent.com/u/207008?v=4)](https://github.com/bitjungle "bitjungle (6 commits)")[![Northguy](https://avatars.githubusercontent.com/u/1189058?v=4)](https://github.com/Northguy "Northguy (5 commits)")[![HaoSs07](https://avatars.githubusercontent.com/u/3189195?v=4)](https://github.com/HaoSs07 "HaoSs07 (4 commits)")[![ipuiu](https://avatars.githubusercontent.com/u/2444972?v=4)](https://github.com/ipuiu "ipuiu (3 commits)")

---

Tags

calibreebookebook-managerepubopds

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mikespub-seblucas-cops/health.svg)

```
[![Health](https://phpackages.com/badges/mikespub-seblucas-cops/health.svg)](https://phpackages.com/packages/mikespub-seblucas-cops)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M570](/packages/shopware-core)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M734](/packages/sylius-sylius)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k13.0M217](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
