# see https://github.com/xtdb/xtdb/pkgs/container/xtdb/versions for tags
# `latest`: latest tagged release
# `nightly`: built every night from `main` branch
# `edge`: latest nightly plus urgent fixes
docker run -it --pull=always \
-p 5432:5432 \
-p 8080:8080 \
-p 3000:3000 \
ghcr.io/xtdb/xtdb
# 5432: Postgres wire-compatible server (primary API)
# 8080: Monitoring/healthz HTTP endpoints
# 3000: HTTP query/tx API
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 a Clojure API.
You can start a 'standalone' (i.e. non-production, non-distributed) XTDB server using the following command:
This command starts a Postgres wire-compatible endpoint on port 5432 and an HTTP server available at http://localhost:3000
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:8080/healthz/alive
# Alive.
Connect with psql
# if you have Postgres installed, psql is already available
psql -h localhost -U xtdb xtdb
Run your first query
psql (16.2, server 16)
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!