Get started with QuestDB via Docker

QuestDB has images for both Linux/macOS and Windows on Docker Hub.

Install Docker#

Before we start, you will need to install Docker. You can find guides for your platform on the official documentation.

QuestDB image#

Once Docker is installed, you will need to pull QuestDB's image from Docker Hub and create a container. You can do both in one command using docker run:

docker run -p 9000:9000 -p 8812:8812 questdb/questdb

Options#

ArgumentDescription
-pPort to publish to the host
-vTo bind mount a volume

-p parameter#

This parameter will publish a port to the host, you can specify:

-v volumes#

The QuestDB root_directory will be in the following location:

/root/.questdb

Container status#

You can check the status of your container with docker ps. It also lists the ports we published:

docker ps
Result
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dd363939f261 questdb/questdb "/app/bin/java -m io…" 3 seconds ago Up 2 seconds 8812/tcp, 9000/tcp frosty_gauss

Importing data and sending queries#

Now that QuestDB is running, you can start interacting with it:

  • If you published the port 9000, you can follow our REST page
  • If you published the port 8812, follow our Postgres page
  • If you published the port 9009, follow our InfluxDB page

Data persistence#

Mounting a volume#

Volumes can be mounted to the QuestDB Docker container so that data may be persisted or server configuration settings may be passed to an instance. The following example demonstrated how to mount the current directory to a QuestDB container using the -v flag in a Docker run command:

docker run -p 9000:9000 -p 8812:8812 -v "$(pwd):/root/.questdb/" questdb/questdb

The current directory will then have data persisted to disk for convenient migration or backups:

Current directory contents
├── conf
│   └── server.conf
├── db
└── public

For details on passing QuestDB server settings to a Docker container, see the Docker section of the server configuration documentation.

Restart an existing container#

When you stop the container, it will not be removed by Docker. This means that you can restart it anytime and your data will be accessible:

Start container from the ID obtained with 'docker ps'
docker start dd363939f261

Re-run docker run#

If you re-run the command:

docker run -p 9000:9000 -p 8812:8812 questdb/questdb

A new container will be created for the QuestDB image. This means that the container will be fresh, any data you may have created previously won't be accessible.