Prerequisites
Before you begin, ensure you have:- Docker and Docker Compose installed
- At least 2GB of available RAM (for Elasticsearch)
- A directory containing your ebook files (EPUB or other supported formats)
Installation steps
Configure environment variables
Copy the example environment file and edit it with your values:Open
.env in your text editor and configure the required variables:.env
You can generate secure random values using:
uuidgenfor UUIDsopenssl rand -hex 32for secrets
Configure book library volumes
Edit Replace the example paths with your actual book directories. The
docker-compose.yml to mount your book directories. Locate the server service and add your book paths under volumes:docker-compose.yml
:ro flag mounts them as read-only for safety.Start the services
Launch all services with Docker Compose:This command will:
- Build the server and web containers
- Start PostgreSQL, Redis, and Elasticsearch
- Run database migrations automatically
- Start background workers for scanning and indexing
Access Nanahoshi
Once the containers are running, you can access:
- Web interface: http://localhost:3001
- Server API: http://localhost:3000
- API reference: http://localhost:3000/api-reference
If you customized
SERVER_PORT or WEB_PORT in your .env file, use those ports instead.Create your first library
After logging in to the web interface:
- Navigate to the admin section
- Create a new library
- Set the library path to match the container mount point (e.g.,
/books/manga) - Enable automatic scanning if desired
- Save the library
Verify installation
To verify that all services are running correctly:nanahoshi-v2-server- Backend API and workersnanahoshi-v2-web- Frontend applicationnanahoshi-v2-postgres- PostgreSQL databasenanahoshi-v2-redis- Redis for job queuesnanahoshi-v2-elasticsearch- Search indexing
View logs
If you encounter issues, check the logs:Stop and restart
To stop Nanahoshi:Update Nanahoshi
To update to the latest version:Data persistence
Nanahoshi stores persistent data in Docker volumes:postgres_data- Database tables and user dataes_data- Elasticsearch search indicesserver_data- Book covers, metadata cache, and application files
Troubleshooting
Elasticsearch fails to start
Elasticsearch requires at least 2GB of RAM. If you’re on Linux, you may also need to increase thevm.max_map_count setting:
/etc/sysctl.conf.
Books aren’t showing up
Verify that:- Your book directories are correctly mounted in
docker-compose.yml - The library path in the admin UI matches the container mount point (e.g.,
/books/manga) - The scanner worker is running (check logs:
docker compose logs -f server) - Your book files are in a supported format (EPUB, etc.)
Can’t log in
Check that:BETTER_AUTH_SECRETis set in your.envfileSMTP_*variables are configured correctly for sending email- The database migrations completed successfully (check logs)
What’s next?
Installation
Set up a development environment to contribute to Nanahoshi
Configuration
Learn about advanced configuration options