Skip to content

Installation via Docker

Try Online

If you want to avoid running your own XTDB server locally, you can instantly play with inserting data and querying right now using the XT Play web-based console. The interactive SQL Quickstart uses this console to showcase XTDB’s SQL dialect and bitemporal capabilities.

Otherwise, let’s get XTDB downloaded and running on your own machine…​

Docker Install

XTDB supports production usage via the Postgres wire protocol (so that you can work with various Postgres-compatible tools, drivers etc.) and also has an HTTP API.

You can start a 'standalone' (i.e. non-production, non-distributed) XTDB server using the following command:

docker run -it --pull=always -p 6543:3000 -p 5432:5432 ghcr.io/xtdb/xtdb

This command starts a Postgres wire-compatible endpoint on port 5432 and an HTTP server available at http://localhost:6543

By default your data will only be stored transiently using a local directory within the Docker container, but you can attach a host volume to preserve your data across container restarts, e.g. by adding -v /tmp/xtdb-data-dir:/var/lib/xtdb.

After seeing a 'Node started' log message (e.g. 09:00:00 | INFO xtdb.cli | Node started) you are able to confirm your XTDB server is running using cURL:

curl http://localhost:6543/status

If everything is running you will see this response {"latestCompletedTx":null,"latestSubmittedTx":null}

Connect with psql

# if you have Postgres installed, psql is already available
psql -h localhost -p 5432

You can similarly connect with other Postgres-compatible tools like VSCode’s SQLTools extension, but not everything is guaranteed to work as expected if you are referring to Postgres' own documentation (XTDB is not attempting to be 100% compatible with Postgres). For guidance on tools we’ve tested, see Postgres drivers & compatability.

Run your first query

psql (16.2, server 14)
Type "help" for help.

user=> SELECT 'foo' AS bar;

 bar
-----
 foo
(1 row)

Next up, if you haven’t already run through the Quickstart already, you probably want to start there with inserting data, running your first queries, and learning about XTDB’s novel capabilities: Let’s INSERT some data!