Back to Questdb

Quick start

documentation/getting-started/quick-start.mdx

latest7.8 KB
Original Source

import Screenshot from "@theme/Screenshot";

import Button from "@theme/Button";

import InterpolateReleaseData from "../../src/components/InterpolateReleaseData";

import NoJrePrerequisite from "./quick-start-utils/_no-jre-prerequisites.partial.mdx";

import CodeBlock from "@theme/CodeBlock";

import { TabsPlatforms } from "../../src/modules/TabsPlatforms";

import RunWindows from "./quick-start-utils/_run-windows.partial.mdx";

import OptionsNotWindows from "./quick-start-utils/_options-not-windows.partial.mdx";

import OptionsWindows from "./quick-start-utils/_options-windows.partial.mdx";

import Tabs from "@theme/Tabs";

import TabItem from "@theme/TabItem";

import { Clients } from "../../src/components/Clients"

This guide will get your first QuestDB instance running.

As the goal is to, well, start quickly, we'll presume defaults.

Once running, we'll provide guides for inserting data, configuration and production hosting.

QuestDB already running? Jump ahead! Select a first-party client or ingest method.

Install QuestDB

Choose from the following options:

Docker

To use Docker, one must have Docker. You can find installation guides for your platform on the official documentation.

Once Docker is installed, pull and run QuestDB:

<InterpolateReleaseData renderText={(release) => ( <CodeBlock className="language-shell"> {docker run -p 9000:9000 -p 8812:8812 -p 9003:9003 questdb/questdb:${release.name}} </CodeBlock> )} />

This exposes the Web Console (9000), PostgreSQL wire (8812), and health endpoint (9003).

For deeper instructions, see the Docker deployment guide.

Homebrew

To install QuestDB via Homebrew, run the following command:

shell
brew install questdb

On macOS, the location of the root directory of QuestDB and server configuration files depend on the chip:

  • Apple Silicon (M1/M2/M*) chip: /opt/homebrew/var/questdb

  • Intel chip: /usr/local/var/questdb

Binaries

export const platforms = [ { label: "Linux", value: "linux" }, { label: "Windows", value: "windows" }, { label: "Any (no JVM)", value: "noJre" }, ];

Download and run QuestDB via binaries.

Select your platform of choice:

<!-- prettier-ignore-start -->

<TabsPlatforms platforms={platforms} render={({ platform, href }) => { const filename = href.split("/").reverse()[0]; switch (platform) { case "noJre": return <NoJrePrerequisite href={href} label={filename} />; case "windows": return ( <> Download the executable: {" "}

          <Button href={href} uppercase={false} variant="plain">
            {filename}
          </Button>
        

        

        The default root directory becomes:
        

        

        <CodeBlock className="language-shell">
          {`C:\\Windows\\System32\\qdbroot`}
        </CodeBlock>
      </>
    );
  default:
    return (
      <>
        Download the binary:{" "}
        

        

        <Button href={href} uppercase={false} variant="plain">
         {filename}
        </Button>
        

        

        Next, unpack it:{" "}
        

        

        <CodeBlock className="language-shell">
          {`tar -xvf ${filename}`}
        </CodeBlock>
        The default directory becomes:
        

        

        <CodeBlock className="language-shell">
          {`$HOME/.questdb`}
        </CodeBlock>
      </>
    );
}

}} />

<!-- prettier-ignore-end -->

Run QuestDB

<Tabs defaultValue="nix" values={[ { label: "Linux/No JVM", value: "nix" }, { label: "macOS (Homebrew)", value: "macos" }, { label: "Windows", value: "windows" }, ]}>

<!-- prettier-ignore-end --> <TabItem value="nix">
shell
./questdb.sh start

To stop: ./questdb.sh stop | To check status: ./questdb.sh status

<details> <summary>All options</summary>
shell
./questdb.sh [start|stop|status] [-d dir] [-f] [-n] [-t tag]
<OptionsNotWindows /> </details> </TabItem> <TabItem value="macos">
shell
questdb start

To stop: questdb stop | To check status: questdb status

<details> <summary>All options</summary>
shell
questdb [start|stop|status] [-d dir] [-f] [-n] [-t tag]
<OptionsNotWindows /> </details> </TabItem> <TabItem value="windows">
shell
questdb.exe start

To stop: questdb.exe stop | To check status: questdb.exe status

<details> <summary>All options</summary>
shell
questdb.exe [start|stop|status|install|remove] \
  [-d dir] [-f] [-j JAVA_HOME] [-t tag]
<OptionsWindows /> </details> </TabItem> </Tabs> <!-- prettier-ignore-start -->

Verify installation

Open http://localhost:9000 in your browser.

You should see the QuestDB Web Console.

Try running your first query in the SQL editor:

questdb-sql
CREATE TABLE test (ts TIMESTAMP, val DOUBLE) TIMESTAMP(ts);
INSERT INTO test VALUES (now(), 42.5);
SELECT * FROM test;

The TIMESTAMP(ts) clause makes this a time-series table — it's what enables QuestDB's sub-millisecond time-range queries. See Schema design to understand this and other key concepts.

It works? You're ready to bring your data.

Default ports:

PortService
9000REST API and Web Console
9009InfluxDB Line Protocol (ILP) - Legacy TCP, use HTTP instead
8812PostgreSQL Wire Protocol
9003Health endpoint

Bring your data

Now... Time to really blast-off. 🚀

Next up: Bring your data - the life blood of any database.

Choose from one of our premium ingest-only language clients:

<Clients />

Want more options? See the ingestion overview.

Create new data

No data yet and still want to trial QuestDB?

There are several quick options:

  1. QuestDB demo instance: Hosted, fully loaded and ready to go. Quickly explore the Web Console and SQL syntax.
  2. Create my first data set guide: create tables, use rnd_ functions and make your own data.
  3. Sample dataset repos: IoT, e-commerce, finance or git logs? Check them out!
  4. Quick start repos: Code-based quick starts that cover ingestion, querying and data visualization using common programming languages and use cases. Also, a cat in a tracksuit.
  5. Time series streaming analytics template: A handy template for near real-time analytics using open source technologies.

Learn QuestDB

New to QuestDB? Start here:

  • Schema design — Understand designated timestamps, partitions, and SYMBOL types. These are the foundations of fast time-series queries.

For production deployments: