Skip to content

Quickstart/template for a Clojure/Ring webserver with Datomic

Notifications You must be signed in to change notification settings


Folders and files

Last commit message
Last commit date

Latest commit



5 Commits

Repository files navigation


Quickstart/template for a Clojure/Ring webserver with Datomic.

Datomic is a novel database with unique advantages. Read about it on


Datomic Setup

  1. Get Datomic license

Register on

We're using Datomic Pro Starter. The website variously shortens it to "Datomic Starter", and it also has a "Datomic Free". Navigate this maze with confidence: Datomic Pro Starter is free, and is exactly what we want.

  1. Download

Go to and download the exact same version as our Datomic dependency in project.clj: Unzip it somewhere. The download includes:

  • transactor server
  • peer library for use in our app process

Unzip and navigate to the resulting folder:

cd <unzipped folder>
  1. Make peer library available

The peer library is the dependency com.datomic/datomic-pro in project.clj. It's what our app uses to connect to Datomic and run queries. It's not in a public repository, and comes with the Datomic download. Assuming you have Maven installed, run this command:


This makes it locally available to Leiningen.

Note: you can connect to Datomic as a client or a peer. A client runs every request over the network, while a peer caches data locally. Being a peer costs memory, but gives you better read performance and negates network latency between app and database. Peer are also fantastic for horizontal scaling. Unfortunately the official Datomic tutorial focuses on a client, while being a peer is what you really want, and that's what we're doing.

  1. Setup config

We'll be using the self-sufficient "dev" configuration. Copy the template:

cp config/samples/ config/
  1. Add license keys

You need to add the Datomic license key to two property files:

  • config/ in the unzipped Datomic folder
  • config/ in the app repository

Open the files and fill the license-key= field. To get the key, go to and click "Send License Key" to receive it in an email. This is not the short download key immediately visible on the page.

  1. Run transactor
bin/transactor config/

This is the core database process. Keep it running forever.

In the "dev" configuration, this process is self-sufficient and manages storage by itself, using local files. In other configurations, you also need to manage the storage database the transactor connects to.

  1. Create database

The app will do this automatically. See src/app/dat.cljDatstart.

  1. Transact schema

The app will do this automatically. See src/app/dat.cljDatstart.

Env Secrets

Copy or rename


Unless you did something weird in your Datomic setup, you can leave the values as-is.


Now you can run the app:

lein repl


lein repl :headless
# another tab
lein repl :connect

If you have completed all previous steps, this should launch the app and report a localhost URL to open. It should display a webpage with the database status, a comment form, and a comment list.


If you have question or suggestions, open an issue, reach me on skype:mitranim.web, or email to


Quickstart/template for a Clojure/Ring webserver with Datomic







No releases published