Getting Started with Cube.js using Docker

This guide will help you get Cube.js running using Docker.

Prefer using Docker Compose? Check out this page instead.

Using Windows? Remember to use PowerShell or WSL2 to run the command below.

In a new folder for your project, run the following command:

docker run -p 4000:4000 \
  -v ${PWD}:/cube/conf \
  -e CUBEJS_DEV_MODE=true \
  cubejs/cube

This step assumes you can connect to a database instance. If you're unable to connect to a remote instance, please use a Docker image to run one in your local development environment.

Head to http://localhost:4000 to open Developer Playground.

The Developer Playground has a database connection wizard that loads when Cube.js is first started up and no .env file is found. After database credentials have been set up, an .env file will automatically be created and populated with the same credentials.

Click on the type of database to connect to, and you'll be able to enter credentials:

After clicking Apply, you should see tables available to you from the configured database. Select one to generate a data schema. Once the schema is generated, you can execute queries on the Build tab.

Generating Data Schema files in the Developer Playground is a good first step to start modelling your data. You can learn more about Cube.js Data Schema for complex data modelling techniques.

Learn how to query Cube.js with REST API or use our Javascript client library and integrations with frontend frameworks.

Did you find this page useful?