How to get a persisting local datomic database?

The getting started guide talks about using free storage protocol

Running the transactor with the free storage protocol

The free storage protocol uses local disk files for storage.

You can start a local transactor with free storage as follows:

bin/transactor config/samples/free-transactor-template.properties

This script will print a few lines of output, including the base URI you will use to connect, e.g.

datomic:free://localhost:4334/<DB-NAME>

To create a connection string, simply replace with a database name of your choice, e.g. "hello":

datomic:free://localhost:4334/hello

Using this URI, you should now be able to repeat the steps from the previous section, this time making your connection to the transactor.


As of 2020, while datomic free does still exist, it lags a bit in features. Cognitect introduced a new Pro Starter edition which they intend as a better way to get started. That is also free and gives a perpetual license. The limitation is just on the duration of free updates you get, limited to one year.

Here's the latest install guide: https://docs.datomic.com/on-prem/dev-setup.html

If you only want to try it out though, you're probably better off using in-memory first: https://docs.datomic.com/on-prem/getting-started/connect-to-a-database.html

Note also datomic cloud is an even newer product. But even if considering cloud, exploring on-prem first seems not unreasonable. If so just be aware though to focus on learning the client api, rather than the peer, because peers don't exist in datomic cloud (actually, they do, as the peer server... which is what the light weight clients then connect to, to run queries).