A lightweight, container-ready wrapper around Datahike that turns the in-process database into a standalone HTTP server.
The project provides:
- 📦 Pre-built Docker images published to GHCR.
- ⚡️ A tiny
start.bbBabashka script that bootstraps the server anywhere Java17+is available. - 🛠️ GitHub Workflow to automatically build and publish new versions.
If you want to embed Datahike directly inside your own Clojure/JVM project you probably want the core Datahike library. This repository is only about running it as a service.
# Pull the latest image
docker pull ghcr.io/alekcz/datahike-server:latest
# Start the server on port 4444
# (change the environment variables to fit your needs)
docker run \
-p 4444:4444 \
-e DATAHIKE_TOKEN="s3cr3t" \
ghcr.io/alekcz/datahike-server:latestYou can now send requests to http://localhost:4444.
# Prerequisites: Java 17+ and Babashka ≥ 1.3
# Clone the repository
$ git clone https://github.com/alekcz/datahike-server.git
$ cd datahike-server
# Clone and build the Datahike HTTP server JAR
$ git clone --depth 1 https://github.com/alekcz/datahike.git
$ cd datahike && bb http-server-uber && cd ..
# Copy the JAR to the expected location
$ mkdir -p /opt/datahike
$ cp datahike/target-http-server/datahike-http-server.jar /opt/datahike/
# Start the server (defaults to port 4444)
$ bb start.bbThe script will:
- Generate a default configuration file (or read the one you provide via
DATAHIKE_CONFIG_EDN). - Download any extra dependencies you specify.
- Launch
datahike.http.serverwith the computed classpath using the pre-built JAR.
Configuration is passed to the server as an EDN file. You have three options:
- Let the script generate the file from environment variables (default).
- Mount an existing file and point to it via
DATAHIKE_CONFIG_EDN(inline EDN string). - Build a custom Docker image on top of this one and copy your file into the container.
| Variable | Default | Description |
|---|---|---|
DATAHIKE_PORT / PORT |
4444 |
Port the server will bind to |
DATAHIKE_LEVEL |
info |
Log level (trace/debug/info/warn/error) |
DATAHIKE_DEV_MODE |
false |
Enable dev-mode conveniences |
DATAHIKE_TOKEN |
securerandompassword |
Shared bearer token used for authentication |
DATAHIKE_STORES |
"[]" |
Namespaces of other datahike backends to load at runtime ["datahike-jdbc.core" "datahike-redis.core"] |
DATAHIKE_CONFIG_EDN |
– | Full EDN config string. Overrides all other vars if set (doesn't include the extra deps) |
DATAHIKE_EXTRA_DEPS |
– | The extra dependencies for the stores required at runtime |
DATAHIKE_EXTRA_DEPS accepts both leinigen style dependencies.
[[io.replikativ/datahike-jdbc "0.3.50"]
[org.postgresql/postgresql "42.7.5"]
[io.replikativ/datahike-redis "0.1.7"]]Or deps.edn style dependencies if you prefer.
{io.replikativ/datahike-jdbc {:mvn/version "0.3.50"}
org.postgresql/postgresql {:mvn/version "42.7.5"}
io.replikativ/datahike-redis {:mvn/version "0.1.7"}}-e.
# Clone the datahike-server repository
$ git clone https://github.com/alekcz/datahike-server.git && cd datahike-server
# Clone the Datahike repository (contains modifications for runtime backend loading)
$ git clone --depth 1 https://github.com/alekcz/datahike.git
# Build the Datahike HTTP-server uber-jar
$ cd datahike && bb http-server-uber && cd ..
# Copy the built JAR into the build context
# The JAR is renamed to datahike-http-server.jar for consistency
$ mkdir -p build && cp datahike/target-http-server/*.jar build/datahike-http-server.jar
# Build the Docker container
$ docker build -t datahike-server .Pull requests are welcome! If you spot an issue or have an enhancement in mind, please open an issue first to discuss.
- Fork & clone the repo
- Create your branch:
git checkout -b feature/my-amazing-idea - Commit your changes
- Push and open a PR
Please make sure your code passes clj-kondo/cljfmt/zprint linters (the same ones configured in CI).
This project is distributed under the terms of the EPL License – see LICENSE for details.