Getting Started with Cube using Docker
This guide will help you get Cube 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 -p 3000:3000 \
-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 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 modeling your data. You can learn more about Cube Data Schema for complex data modeling techniques.
Learn how to query Cube with REST API, SQL API or use our Javascript client library and integrations with frontend frameworks.
Did you find this page useful?