Install and upgrade
Requirements
- Docker Engine with the Docker Compose plugin
- A few minutes for the application and its supporting services to download and start
Docker Compose creates and starts the application, PostgreSQL, and Redis. New installations use PostgreSQL automatically. Existing Kuzu installations require the migration wizard described below.
New installation with Docker Compose
git clone https://github.com/pickles4evaaaa/mybibliotheca.git
cd mybibliotheca
python3 scripts/setup_docker.py
docker compose up -d
That is all the configuration needed for a basic installation. The setup command creates a private .env file with the secure values the application and PostgreSQL need. You do not need to open or edit it. Keep it beside docker-compose.yml and do not share or commit it.
Your application files are stored in ./data; PostgreSQL stores its data in the postgres_data Docker volume. Keep both for backups and future upgrades.
What happens next
After docker compose up -d, open http://<your-server>:5054. The first visit takes you to setup, where you create the admin account.
Onboarding step 2 then asks for a Google Books API key. Without one, metadata lookup is slow and unstable. See Get a Google Books API key.
To confirm that the services started, run docker compose ps. For startup help, see Troubleshooting.
For a server exposed to the internet, put the app behind a reverse proxy with HTTPS. HTTPS is required for browser camera access.
The production Compose file pulls the published pickles4evaaaa/mybibliotheca:latest image, which always points at the newest stable release (currently 3.0.4). To stay on one version, replace latest with a release tag such as 3.0.4. Images are multi-arch (linux/amd64 and linux/arm64) and are published as 3.0.4 and latest.
Upgrade from Kuzu to PostgreSQL
Version 3.0.0 changes the primary database to PostgreSQL. An existing Kuzu database is preserved and remains active after the application upgrade. The upgrade does not migrate the library by itself. An administrator must complete the database migration wizard.
- Schedule a maintenance window and stop normal use. Back up the full
data/directory and PostgreSQL storage. Keep separate copies outside the server if possible. - Update your Compose file to the 3.0.0 version. The new file adds PostgreSQL and the
postgres_datavolume. Keep your existing./data:/app/datamount,.envsecrets, and custom ports/proxy settings. Runpython3 scripts/setup_docker.pyto fill in missing required settings; it preserves existing non-empty values. If you already have an initialized PostgreSQL data volume, keep its originalPOSTGRES_PASSWORDbecause changing.envdoes not change the password stored in that database. Do not usedocker compose down -vor remove any data. See the Compose update notes. - Update the app to version 3.0.0 and start PostgreSQL and the app. Keep the original Kuzu files in
data/kuzu:
git pull
docker compose pull
docker compose up -d
docker compose ps
- Sign in as an administrator and open Admin → Database Migration.
- Complete the wizard in order: create and verify the Kuzu backup, check PostgreSQL, then start the migration and verification. The PostgreSQL target must be empty of application data. If the wizard reports a problem, follow its instructions; do not manually truncate the database.
- Wait for the wizard to report PostgreSQL as active. Check users, books, reading history, covers, and integrations before normal use resumes.
- Keep the original Kuzu database and verified backups until you are satisfied with the migration.
After PostgreSQL accepts new writes, the retained Kuzu database is no longer a current rollback copy. Recover using a PostgreSQL backup. See Backups & restore and the detailed migration guide.
Environment essentials
The Docker setup command creates the required security and database settings automatically. For optional application settings, see .env.example; basic installations do not need any changes. Keep .env private. The Compose file connects to its bundled PostgreSQL service by default; custom POSTGRES_HOST, POSTGRES_DB, POSTGRES_USER, or POSTGRES_DSN values are only needed for a custom database deployment.
Environment variables
Basic installations need no changes. These optional settings control metadata lookups; add them to .env. Details are in Administration.
| Variable | Default | Purpose |
|---|---|---|
GOOGLE_BOOKS_API_KEY |
none | Google Books API key. GOOGLE_API_KEY is also read. A key saved in the app (Settings) takes precedence over both. See Google Books API key. |
GOOGLE_BOOKS_DAILY_LIMIT |
1000 |
Google Books requests counted per day before calls pause. 0 means no limit. If you raised your Google quota, raise or zero this. |
OPENLIBRARY_MAX_REQUESTS |
3 |
OpenLibrary requests allowed per 2-second window. For example, OPENLIBRARY_MAX_REQUESTS=1 allows 1 request per 2 seconds. |
OPENLIBRARY_MAX_WAIT_SECONDS |
8 |
Longest a lookup waits for an OpenLibrary slot before it is skipped. |
API_LIMITS_ENABLED |
true |
Set to false to disable the counters and throttling. |
Routine upgrades
For an existing PostgreSQL installation, pull and restart. The Compose file uses the latest tag, so pulling gets the newest stable release; if you pinned a release tag, change it to the release you want first:
git pull
docker compose pull
docker compose up -d
docker compose ps
docker compose logs --tail=100 bibliotheca
Read release notes before each upgrade and keep current backups. Do not remove the postgres_data volume or data/ directory when replacing containers.
Upgrading from 3.0.3 to 3.0.4
Back up your installation. If you pin the image version, set the app image to pickles4evaaaa/mybibliotheca:3.0.4. Installations using latest can use their existing Compose file.
docker compose pull && docker compose up -d
Existing PostgreSQL installations can resume normal use. For an installation still using Kuzu, sign in as an administrator and complete the migration wizard.
Upgrading from 3.0.2 to 3.0.3
No database migration is needed. Back up first, then:
docker compose pull && docker compose up -d
If your Compose file pins pickles4evaaaa/mybibliotheca:3.0.2, change the tag to 3.0.3 before pulling. No settings change.
Upgrading from 3.0.1 to 3.0.2
No database migration is needed. Back up first, then:
docker compose pull && docker compose up -d
If your Compose file pins pickles4evaaaa/mybibliotheca:3.0.1, change the tag to 3.0.2 before pulling. Existing environment variables keep working unchanged, including an existing GOOGLE_BOOKS_API_KEY. After upgrading, add a Google Books API key in Settings → Server → Metadata; see Google Books API key. Metadata results and covers may differ from 3.0.1 because Google Books is now queried first.
Upgrade from 3.0.0 to 3.0.1
No migration is needed. Back up first, then:
docker compose pull && docker compose up -d
If your Compose file pins pickles4evaaaa/mybibliotheca:3.0.0, change the tag to 3.0.1 before pulling.
Run from source
For development only, use the supplied development Compose file, which includes PostgreSQL and Redis:
docker compose -f docker-compose.dev.yml up -d --build
Verify the installation
- The application and PostgreSQL containers are healthy/running.
- The setup or login page loads and an administrator can sign in.
- A test book can be added by title or ISBN.
- The book remains after
docker compose restart. - A backup can be created and downloaded.