Docker is great to try new stuff and get started in minutes with just a few commands. Follow this guide to set up and start using QuestDB from scratch. By the end, you will be able to set up containers and be ready to send and query data using the HTTP API and Postgres Wire protocol.
Before we start, you will need to install Docker. You can find guides for your platform here. The linux page points to several guides depending on your distribution (Fedora, Debian, Ubuntu, etc). For Unix machines, this requires sudo rights.
Pull the QuestDB image
With Docker installed, you need to pull the QuestDB image. The below command will pull the latest image from our repository, which is updated with every release.
docker pull questdb/questdb
Create a container
docker create lets you create a container.
In this guide, we mostly look at the following two arguments. For a complete list, please refer to our Docker reference.
|--name||name for your container|
|-p||port to map. For the HTTP API and web console, open |
The below will use the image you just pulled to create a container called questdb with local port 9000 mapped to the container. This will open up the HTTP API.
docker create --name questdb -p 9000:9000 questdb/questdb
Start the container
Now that you have created a container.
docker start questdb
Here is what it looks like to start QuestDB on docker in just 3 commands
You can check the status of your container with docker ps. It also lists the ports we have mapped.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2cc042a64a73 questdb/questdb "/app/jre/bin/java -…" 14 seconds ago Up 3 seconds 8892/tcp, 0.0.0.0:9000->9000/tcp questdb
Importing data and sending queries
Congratulations, you have a running QuestDB server. You can now start to interact with it.
- If you opened port 9000, you can follow our HTTP REST API
- If you mapped port
8812, follow our psql Guide
Shut down and cleanup
As QuestDB is a persisted database, the data will remain after you shut down the container. If you would like to remove the data, you can run the following to drop the tables.
DROP TABLE trips; DROP TABLE weather;
You can run QuestDB in Sandbox mode which will delete all data when the container is stopped. Find out more in our Docker reference
You can then shut down and remove the container.
docker stop questdb docker rm questdb