Copy .env.example, set your secrets and library path, then run
docker compose up -d. A setup wizard opens on first launch.
This is the multi-page printable view of this section. .
Get Started
- 1: Installation
Stashix is a self-hosted library for comics and ebooks. You point it at the folders where your files already live, and it builds a browsable, searchable shelf you can read from any browser on your network.
What you get
- A reader in the browser. Open a comic or manga and start reading. Your place is saved per user, so you can pick up on another device.
- A library that keeps itself up to date. Stashix watches your folders and imports new files a few seconds after they land.
- Metadata from your files. Series, issue numbers, creators and publishers
come from
ComicInfo.xml,MetronInfo.xml, sidecar files and filenames. See how to organise your folders. - Full-text search across titles, series and publishers.
- Accounts for the household. Admin and user roles, per-library permissions and age-gates for younger readers.
- Installable on your phone as a progressive web app on Android.
Stashix reads .cbz, .cbr, .cb7, .pdf and .epub files. Anything else
in a library folder is ignored. EPUBs are shown as their images, so they work
for manga and comics but not yet for text ebooks such as novels; see
supported formats.
How it fits together
Stashix runs as two containers: the Stashix server and a PostgreSQL database. The default Compose file mounts your library folder read-write, so metadata you edit can be saved back into your files. Covers, thumbnails and caches go into a separate data volume.
Before you install
| You need | Details |
|---|---|
| Docker with Compose | Any host that runs Linux containers: a home server, a NAS or a VPS. |
| Your library on disk | One folder (or a parent of several) that holds your comics and ebooks. |
| A user ID that can use it | Stashix runs as PUID/PGID (default 1000) and must be able to read the library folder, and write to it to save metadata. |
| Three random secrets | Generated with openssl during setup. See Installation. |
| A modern browser | Any current desktop or mobile browser. |
PostgreSQL ships in the Compose file, so you don’t need to install a database yourself.
Choose how to install
For development. Needs Elixir 1.18+, Erlang/OTP 27+, PostgreSQL and a few
system tools (vips, p7zip, unrar, pdfinfo, pdftoppm).
Once Stashix is running, open http://<your-server>:4000, create the admin
account, and add your first library.
1 - Installation
This guide runs Stashix and its PostgreSQL database with Docker Compose. Check what you need before installing first.
Install
Download the Compose files
Make a folder for Stashix and fetch the Compose file and the example settings into it:
Fill in the secrets
Stashix needs three random secrets and a database password. Paste these lines into your terminal, in the
stashixfolder, to generate them and write them into.env:Run them once, before the first start. On macOS, change
sed -itosed -i ''in the first line.WarningBack up
.env. IfSTASHIX_ENCRYPTION_KEYis lost or changed, the metadata source credentials Stashix has stored can’t be read anymore. Upgrading an install that ran without this key? See Adding the key to an older install.Prefer to fill them in by hand?
Open
.envand set each value to the output of its command:Setting Command SECRET_KEY_BASEopenssl rand -base64 48JWT_SECRETopenssl rand -base64 48(run it again for a different value)STASHIX_ENCRYPTION_KEYopenssl rand -base64 32POSTGRES_PASSWORDAny password made of letters and numbers DATABASE_URLecto://stashix:<password>@db/stashix, with the same passwordPoint Stashix at your library
Open
.envand set the values only you know:Setting Set it to LIBRARIES_PATHYour media folder on this machine (the host), such as /srv/media. Not a path inside the container or in Stashix.PHX_HOSTThe hostname you’ll use to reach Stashix, such as stashix.home.lan.PUID/PGIDA user and group that can read and write LIBRARIES_PATH.id -uandid -gprint yours.Compose makes
LIBRARIES_PATHappear inside the container as/libraries. Stashix only sees that side, so the folders you add as libraries later start with/libraries:Start Stashix
The first start pulls the images and creates the database, which can take a minute. The Stashix image comes from the GitHub Container Registry as
ghcr.io/aroy-art/stashix.Finish setup in the browser
Open
http://<your-server>:4000. A setup wizard asks you to create the admin account. Then add a library. Enter its folder as Stashix sees it, under/libraries(for example/libraries/comics), not the path on your machine.Stashix scans it straight away. Watch the progress under Admin → Libraries.
Confirm it’s running
Both the stashix and db containers should be up, and db should report
healthy. If the page doesn’t load, read the server log with
docker compose logs stashix.
Where your data lives
| What | Where |
|---|---|
| Your comics and ebooks | LIBRARIES_PATH on the host, mounted at /libraries |
| Covers, thumbnails and image caches | The stashix_data volume |
| Library, users and reading progress | The postgres_data volume |
Back up the postgres_data volume to keep users and reading progress. Covers
are extracted again on the next scan if stashix_data is lost.
Libraries on more than one disk
LIBRARIES_PATH mounts one host folder. For media in another place, add a
line under volumes: in docker-compose.yml that mounts it under
/libraries:
Run docker compose up -d, then add /libraries/manga as a library.
Metadata in your files
By default Stashix saves metadata you edit or match back to your files: CBZ
files get a MetronInfo.xml inside the archive, and other formats get a
<book name>.xml file next to them. Your edits then travel with the files and
survive a database reset.
To keep your library untouched, mount it read-only:
- In Stashix, open Admin → Metadata and turn off Write metadata to files. Metadata is then kept only in the database.
- In
docker-compose.yml, add:roto the library mount:${LIBRARIES_PATH:-${LIBRARY_PATH:-./libraries}}:/libraries:ro. - Run
docker compose up -d.
Turn the setting off first: with a read-only mount and the setting on, every metadata change still saves to the database, but each attempt to write the file fails and is logged as an error.
If something goes wrong
The library stays empty. The container user can’t read your files. Check
that PUID and PGID match an account with read access to LIBRARIES_PATH,
then run docker compose up -d again.
Metadata changes don’t show up in the files. Check that PUID and PGID
can write to LIBRARIES_PATH and that the library isn’t mounted with :ro. See
Metadata in your files.
Some files are missing. Only .cbz, .cbr, .cb7, .pdf and .epub
files are imported. See How the scanner works
and File structure.
docker compose up refuses to start. A required secret is empty. The
error names it, for example set STASHIX_ENCRYPTION_KEY in .env.
Stashix exits saying STASHIX_ENCRYPTION_KEY is not valid base64 or must
decode to 32 bytes. The key was mistyped or generated with the wrong length.
Generate it with openssl rand -base64 32 and paste the whole output.