Skip to content
Berth

Install Berth with Docker

Updated October 27, 2026

Berth is one container, ghcr.io/joveptesg/berth, built for amd64 and arm64. It runs on a Linux server or VPS, a NAS or a Raspberry Pi and keeps everything in one data folder. Setup takes a few minutes.

What you need

Run with Docker Compose

./data holds the database, its backups, the local storage and secret.key.

mkdir berth && cd berth
curl -fsSLO https://raw.githubusercontent.com/joveptesg/berth/main/docker-compose.yml
docker compose up -d              # http://localhost:8080, data in ./data
docker compose logs berth         # the setup code is in the log

Keep a copy of secret.key apart from the backups: storage keys in the database cannot be read without it.

First setup in the browser

  1. Open the server address in a browser: http://<server>:8080, or the domain your hosting assigned.
  2. Find the setup code in the log, in the line server is not set up: … enter the setup code K7P2-9QXM. It changes on every restart until setup is done.
  3. Enter the code and create the administrator. The address you opened becomes the home or internet address in the phone QR codes; you can change it later under Settings → Server.
  4. Upload the first book: drag a folder or a file into the admin. Berth reads tags, chapters and the cover; check them and add the book to the library.

Plain Docker, NAS and Raspberry Pi

For plain Docker or a NAS interface that asks for an image name:

docker run -d --name berth --restart unless-stopped \
  -p 8080:8080 -v "$PWD/data:/data" ghcr.io/joveptesg/berth:1
docker logs berth                 # the setup code is in the log

Updating and rolling back

The 1 tag follows all 1.x releases; 1.0 follows fixes of 1.0, and an exact tag like 1.0.1 never changes. Avoid latest with auto-updaters such as Watchtower: it also follows new major versions.

Before a new version changes the database schema, it saves a copy to ./data/backups (the last 3 are kept). To roll back, pin the previous version in docker-compose.yml and restore that copy:

  1. docker compose stop berth
  2. docker compose run --rm berth admin restore /data/backups/auto-<time>.sqlite
  3. docker compose up -d
docker compose pull && docker compose up -d

Access from the internet

Berth serves plain HTTP, which is enough at home. For access from outside, put a reverse proxy with HTTPS in front, for example Caddy:

books.example.com {
	reverse_proxy localhost:8080
}

Then enter https://books.example.com in the admin under Settings → Internet address, so the QR codes for phones include it. The app switches between the home and internet addresses by itself.

Backups

Questions

Which port does Berth use?

8080 inside the container. Publish it on any host port you like, e.g. -p 9000:8080.

Where are my books stored?

By default in the local storage inside ./data. You can add S3-compatible storage later in the admin and make it the default for new books. See S3 storage.

Can I build Berth from source?

Yes: in a clone of the repository, uncomment build: . in docker-compose.yml and run docker compose up -d --build.