Self-hosted PDF/EPUB library
6.6K
A self-hosted personal library for your ebook collection. Drop PDFs or EPUBs into a folder and Alex takes care of the rest — extracting metadata, generating covers, and making everything readable from a clean, fast web interface.
# 1. Create a docker-compose.yml
curl -o docker-compose.yml https://raw.githubusercontent.com/jamesacklin/alex/main/docker-compose.yml
# 2. Create .env file with a secure secret
echo "NEXTAUTH_SECRET=$(openssl rand -base64 32)" > .env
# 3. Edit docker-compose.yml to point to your books folder
# Change: - ./library:/app/data/library
# To: - /path/to/your/books:/app/data/library
# 4. Start the container
docker compose up -d
Open http://localhost:3000 and login with:
admin@localhostadmin123⚠️ Change the password immediately after first login
| Variable | Required | Default | Description |
|---|---|---|---|
NEXTAUTH_SECRET | ✅ Yes | - | Secret key for session encryption (generate with openssl rand -base64 32) |
NEXTAUTH_URL | No | http://localhost:3000 | Base URL of your installation |
DATABASE_PATH | No | /app/data/library.db | Path to SQLite database |
LIBRARY_PATH | No | /app/data/library | Path to your books folder |
/app/data - Persistent storage for database and generated covers (use a named volume)/app/data/library - Mount your local books folder here3000 - Web interfaceservices:
alex:
image: jamesacklin/alex:latest
ports:
- "3000:3000"
environment:
DATABASE_PATH: /app/data/library.db
LIBRARY_PATH: /app/data/library
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:?Create a .env file and set NEXTAUTH_SECRET}
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
volumes:
- alex-data:/app/data
- ./library:/app/data/library # Change to your books folder
restart: unless-stopped
volumes:
alex-data:
docker run -d \
--name alex \
-p 3000:3000 \
-e NEXTAUTH_SECRET="your-secret-here" \
-e NEXTAUTH_URL="http://localhost:3000" \
-v alex-data:/app/data \
-v /path/to/your/books:/app/data/library \
--restart unless-stopped \
jamesacklin/alex:latest
/admin/users page.Content type
Image
Digest
sha256:1a2eb6079…
Size
607.4 MB
Last updated
3 months ago
docker pull jamesacklin/alex