- Java JDK version 21+
Komga uses Spring Profiles extensively:
dev: add more logging, disable periodic scanning, in-memory database, and enable CORS fromlocalhost:8081(the frontend dev server)localdb: a dev profile that stores the database in./localdb.noclaim: will create initial users at startup if none exist and output users and passwords in the standard output- if
devis active, will createadmin@example.orgwith passwordadmin, anduser@example.orgwith passworduser - if
devis not active, will createadmin@example.orgwith a random password that will be shown in the logs
- if
The backend project uses gradle to run all the necessary tasks. If your IDE does not have gradle integration, you can run the tasks from the root directory using ./gradlew <taskName>.
Here is a list of useful tasks:
bootRun: run the application locally, useful for testing your changes.test: run automated tests. Always run this before committing.jooq-codegen-primary: generates the jOOQ DSL.
bootRun needs to be run with a profile or list of profiles, usually:
dev,noclaim: when testing with a blank databasedev,localdb,noclaim: when testing with an existing database
There are few ways you can run the task with a profile:
./gradlew bootRun --args='--spring.profiles.active=dev'- On Linux:
SPRING_PROFILES_ACTIVE=dev ./gradlew bootRun - On Windows:
SET SPRING_PROFILES_ACTIVE=dev
./gradlew bootRun
- If you use IntelliJ, some Run Configurations are saved in the repository and available from the Gradle panel
To build the Docker image, you need to:
- have the webui built and copied to
/resources/public - prepare the docker image via JReleaser. To do so, run
./gradlew jreleaserPackage. - the
Dockerfilewill be available inkomga/build/jreleaser/package/docker/