Note that we’re setting the CUBEJS_DEV_MODE environment variable to true to
enable development mode. This is
handy for local development but not suitable for
production.
Development mode is an authentication bypass. Cube is in development mode when
CUBEJS_DEV_MODE=true, and also under cubejs dev-server, the cubejs-dev-server bin
or the devServer option, which turn it on with the variable unset. It switches off
JWT verification on the
REST (JSON) and
GraphQL APIs: they then accept requests with
no token at all.Development mode also mounts Playground and its
supporting endpoints with no authentication whatsoever. Anyone who can reach the
instance is handed a ready-to-use API token, and can mint further ones carrying any
security context signed with your API secret — and so query every data API as any user,
bypassing member-level access
control and row-level
security. The same endpoints
read your data model files and the table schema of every connected data source, and
overwrite your data model and your .env. With CUBEJS_DEV_MODE=true and no
CUBEJS_SQL_PASSWORD
set, the SQL API accepts any credentials as well, allowing arbitrary SQL against
connected data sources.This is intentional. Development mode is designed to run on a developer’s local
machine for ease of use and debugging. Never run it where anyone else can reach it,
never expose it to the internet, and never use it in production. Using development
mode in the Cube cloud platform is highly discouraged — it bypasses the platform’s
security model.To keep it off, set CUBEJS_DEV_MODE=false. Leaving it unset is not enough on its own:
cubejs dev-server and the cubejs-dev-server bin turn development mode on for
themselves exactly when the variable is unset, and code that embeds
@cubejs-backend/server-core directly can do the same with the devServer option it
passes to CubejsServerCore. An explicit false overrides the two commands; for an
embedder, leave devServer unset as well. NODE_ENV has no effect either way.
If you’re using Linux as the Docker host OS, you’ll also need to add
network_mode: 'host' to your docker-compose.yml.
Head to http://localhost:4000 to open the Developer
Playground.The 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 credentials.
Want to use a sample database instead? Select PostgreSQL and use the
credentials below:
Field
Value
Host
demo-db.cube.dev
Port
5432
Database
ecom
Username
cube
Password
12345
After selecting the data source, enter valid credentials for it and
click Apply. Check the Connecting to Databases page
for more details on specific data sources.
You should see tables available to you from the configured database; select the
orders table. After selecting the table, click Generate Data Model
and pick either YAML (recommended) or JavaScript format:
Finally, click Build in the dialog, which should take you to
the Build page.You’re now ready for the next step, querying the
data.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cube Documentation","colors":{"primary":"#5339CF","light":"#A5A3FF","dark":"#716EEE"},"logo":{"light":"https://mintcdn.com/cubed3/wCTntgEXVYYYnx4l/logo/light.svg?fit=max\u0026auto=format\u0026n=wCTntgEXVYYYnx4l\u0026q=85\u0026s=8bbf45ba64eac6116629064fac55aad7","dark":"https://mintcdn.com/cubed3/wCTntgEXVYYYnx4l/logo/dark.svg?fit=max\u0026auto=format\u0026n=wCTntgEXVYYYnx4l\u0026q=85\u0026s=d8fa230950c8c63b3c2f88d2768694d0"},"favicon":"https://mintcdn.com/cubed3/wCTntgEXVYYYnx4l/favicon.svg?fit=max\u0026auto=format\u0026n=wCTntgEXVYYYnx4l\u0026q=85\u0026s=3b0cb7aa770d2abd546ef19463fbba8c","navbar":{"links":[{"href":"https://cube.dev/demos","label":"Demos"},{"href":"https://cube.dev/changelog","label":"Changelog"},{"href":"https://slack.cube.dev","label":"Community"}],"primary":{"type":"button","label":"Get Started","href":"https://cubecloud.dev/auth/signup"}},"footer":{"socials":{"x":"https://x.com/the_cube_dev","github":"https://github.com/cube-js/cube","linkedin":"https://www.linkedin.com/company/cube-dev"},"links":[{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://cube.dev/legal/privacy-policy"},{"label":"Cookie Preferences","href":"#cookie-preferences"}]}]},"seo":{"metatags":{"og:type":"website","og:site_name":"Cube Documentation"},"indexing":"navigable"},"icons":{"library":"tabler"},"styling":{"codeblocks":"dark","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cubed3","hasAudioNarration":false,"actualSubdomain":"cubed3","customDomains":["docs.cube.dev"],"gitSource":{"type":"github","owner":"cube-js","repo":"cube","deployBranch":"master","contentDirectory":"docs-mintlify","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aec8efa9c320f62bb698bb9","collectionId":"0f4d644e-e19c-4025-a931-b1bc5437cea2","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aec8efa9c320f62bb698bb9"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aedfcabcf5f3c82974f97ba","clientVersion":"0.0.4074","searchFilterCounts":[{"language":"default","tag":"API","count":233},{"language":"default","tag":"Platform Endpoints","count":226},{"language":"default","tag":"Documentation","count":101},{"language":"default","tag":"Admin","count":95},{"language":"default","tag":"Data Modeling","count":65},{"language":"default","tag":"Recipes","count":47},{"language":"default","tag":"Topics","count":47},{"language":"default","tag":"Reference","count":44},{"language":"default","tag":"Connect to data","count":31},{"language":"default","tag":"Explore \u0026 Analyze","count":30}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#content-area table,.mdx-content table{width:100%!important}.cube-consent{position:fixed;right:16px;bottom:16px;z-index:2147483000;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;width:min(440px, calc(100vw - 32px));padding:16px;background:#fff;color:#111827;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 24px rgb(0 0 0 / 12%);font-size:14px;line-height:1.5}html.dark .cube-consent{background:#111318;color:#f3f4f6;border-color:#2b2f38}.cube-consent__title{margin:0;padding-right:24px;font-size:16px;font-weight:600}.cube-consent__text,.cube-consent__status{margin:0;color:#4b5563}html.dark .cube-consent__text,html.dark .cube-consent__status{color:#b6bcc8}.cube-consent__link{color:inherit;text-decoration:underline}.cube-consent__actions{display:flex;gap:8px}.cube-consent__button{flex:1;padding:8px 16px;border:1px solid #111827;border-radius:6px;background:#111827;color:#fff;font:inherit;font-weight:500;cursor:pointer}html.dark .cube-consent__button{border-color:#f3f4f6;background:#f3f4f6;color:#111318}.cube-consent__button:hover{opacity:0.88}.cube-consent__button:focus-visible,.cube-consent__close:focus-visible,.cube-consent__link:focus-visible{outline:2px solid #111827;outline-offset:2px}html.dark .cube-consent :focus-visible{outline-color:#f3f4f6}.cube-consent__close{position:absolute;top:8px;right:8px;width:24px;height:24px;padding:0;border:0;background:transparent;color:inherit;font-size:20px;line-height:1;cursor:pointer}"}],"page":{"pagePath":"cube-core/getting-started/create-a-project","slug":"/cube-core/getting-started/create-a-project","pageMetadata":{"title":"Create a project","description":"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.","href":"/cube-core/getting-started/create-a-project"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Info,OptimizedImage,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`scaffold-a-project`,children:`Scaffold a project`}),`\n`,_jsxs(_components.p,{children:[`Start by opening your terminal to create a new folder for the project, then\ncreate a `,_jsx(_components.code,{children:`docker-compose.yml`}),` file within it:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` my-first-cube-project`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` my-first-cube-project`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`touch`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` docker-compose.yml`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Open the `,_jsx(_components.code,{children:`docker-compose.yml`}),` file and add the following content:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`services`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` cube`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` image`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`cubejs/cube:latest`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` ports`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`4000:4000`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`15432:15432`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` environment`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`CUBEJS_DEV_MODE=true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` volumes`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`.:/cube/conf`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Note that we’re setting the `,_jsx(_components.a,{href:`/reference/configuration/environment-variables#cubejs_dev_mode`,children:_jsx(_components.code,{children:`CUBEJS_DEV_MODE`})}),` environment variable to `,_jsx(_components.code,{children:`true`}),` to\nenable `,_jsx(_components.a,{href:`/reference/configuration/environment-variables#cubejs_dev_mode`,children:`development mode`}),`. This is\nhandy for local development but not suitable for\n`,_jsx(_components.a,{href:`/cube-core/running-in-production`,children:`production`}),`.`]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Development mode is an authentication bypass.`}),` Cube is in development mode when\n`,_jsx(_components.code,{children:`CUBEJS_DEV_MODE=true`}),`, and also under `,_jsx(_components.code,{children:`cubejs dev-server`}),`, the `,_jsx(_components.code,{children:`cubejs-dev-server`}),` bin\nor the `,_jsx(_components.code,{children:`devServer`}),` option, which turn it on with the variable unset. It switches off\nJWT verification on the\n`,_jsx(_components.a,{href:`/reference/core-data-apis/rest-api`,children:`REST (JSON)`}),` and\n`,_jsx(_components.a,{href:`/reference/core-data-apis/graphql-api`,children:`GraphQL`}),` APIs: they then accept requests with\nno token at all.`]}),_jsxs(_components.p,{children:[`Development mode also mounts `,_jsx(_components.a,{href:`/docs/explore-analyze/playground`,children:`Playground`}),` and its\nsupporting endpoints with no authentication whatsoever. Anyone who can reach the\ninstance is handed a ready-to-use API token, and can mint further ones carrying any\nsecurity context signed with your API secret — and so query every data API as any user,\nbypassing `,_jsx(_components.a,{href:`/docs/data-modeling/access-control/member-level-security`,children:`member-level access\ncontrol`}),` and `,_jsx(_components.a,{href:`/docs/data-modeling/access-control/row-level-security`,children:`row-level\nsecurity`}),`. The same endpoints\nread your data model files and the table schema of every connected data source, and\noverwrite your data model and your `,_jsx(_components.code,{children:`.env`}),`. With `,_jsx(_components.code,{children:`CUBEJS_DEV_MODE=true`}),` and no\n`,_jsx(_components.a,{href:`/reference/configuration/environment-variables#cubejs_sql_password`,children:_jsx(_components.code,{children:`CUBEJS_SQL_PASSWORD`})}),`\nset, the SQL API accepts any credentials as well, allowing arbitrary SQL against\nconnected data sources.`]}),_jsx(_components.p,{children:`This is intentional. Development mode is designed to run on a developer’s local\nmachine for ease of use and debugging. Never run it where anyone else can reach it,\nnever expose it to the internet, and never use it in production. Using development\nmode in the Cube cloud platform is highly discouraged — it bypasses the platform’s\nsecurity model.`}),_jsxs(_components.p,{children:[`To keep it off, set `,_jsx(_components.code,{children:`CUBEJS_DEV_MODE=false`}),`. Leaving it unset is not enough on its own:\n`,_jsx(_components.code,{children:`cubejs dev-server`}),` and the `,_jsx(_components.code,{children:`cubejs-dev-server`}),` bin turn development mode on for\nthemselves exactly when the variable is unset, and code that embeds\n`,_jsx(_components.code,{children:`@cubejs-backend/server-core`}),` directly can do the same with the `,_jsx(_components.code,{children:`devServer`}),` option it\npasses to `,_jsx(_components.code,{children:`CubejsServerCore`}),`. An explicit `,_jsx(_components.code,{children:`false`}),` overrides the two commands; for an\nembedder, leave `,_jsx(_components.code,{children:`devServer`}),` unset as well. `,_jsx(_components.code,{children:`NODE_ENV`}),` has no effect either way.`]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`If you’re using Linux as the Docker host OS, you’ll also need to add\n`,_jsx(_components.code,{children:`network_mode: 'host'`}),` to your `,_jsx(_components.code,{children:`docker-compose.yml`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`start-the-development-server`,children:`Start the development server`}),`\n`,_jsx(_components.p,{children:`From the newly-created project directory, run the following command to start\nCube:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` compose`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` up`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -d`})]}),`\n`]})})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Using Windows? Remember to use `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/powershell/`,children:`PowerShell`}),` or\n`,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/windows/wsl/install`,children:`WSL2`}),` to run the command below.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`connect-a-data-source`,children:`Connect a data source`}),`\n`,_jsxs(_components.p,{children:[`Head to `,_jsx(_components.a,{href:`http://localhost:4000`,children:`http://localhost:4000`}),` to open the `,_jsx(_components.a,{href:`/docs/explore-analyze/playground`,children:`Developer\nPlayground`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The Playground has a database connection wizard that loads when Cube is first\nstarted up and no `,_jsx(_components.code,{children:`.env`}),` file is found. After database credentials have been set\nup, an `,_jsx(_components.code,{children:`.env`}),` file will automatically be created and populated with credentials.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://ucarecdn.com/fb36b103-1102-488d-a4aa-f0a44cd0b8ea/`})}),`\n`,_jsxs(Info,{children:[_jsxs(_components.p,{children:[`Want to use a sample database instead? Select `,_jsx(_components.strong,{children:`PostgreSQL`}),` and use the\ncredentials below:`]}),_jsx(`br`,{}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Host`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`demo-db.cube.dev`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Port`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5432`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Database`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ecom`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Username`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cube`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Password`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`12345`})})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`After selecting the data source, enter valid credentials for it and\nclick\\xA0`,_jsx(_components.strong,{children:`Apply`}),`. Check the `,_jsx(_components.a,{href:`/admin/connect-to-data/data-sources`,children:`Connecting to Databases`}),` page\nfor more details on specific data sources.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://ucarecdn.com/ca898215-9d0a-4bae-ad2b-33fd89a525f8/`})}),`\n`,_jsxs(_components.p,{children:[`You should see tables available to you from the configured database; select the\n`,_jsx(_components.code,{children:`orders`}),` table. After selecting the table, click\\xA0`,_jsx(_components.strong,{children:`Generate Data Model`}),`\nand pick either\\xA0`,_jsx(_components.strong,{children:`YAML`}),` (recommended) or\\xA0`,_jsx(_components.strong,{children:`JavaScript`}),` format:`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://ucarecdn.com/c43d0904-d744-429b-96a8-af7a8db959e0/`})}),`\n`,_jsxs(_components.p,{children:[`Finally, click `,_jsx(_components.strong,{children:`Build`}),` in the dialog, which should take you to\nthe\\xA0`,_jsx(_components.strong,{children:`Build`}),` page.`]}),`\n`,_jsxs(_components.p,{children:[`You’re now ready for the next step, `,_jsx(_components.a,{href:`/cube-core/getting-started/query-data`,children:`querying the\ndata`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Create a project","description":"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.","href":"/cube-core/getting-started/create-a-project"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Scaffold a project","slug":"scaffold-a-project","depth":2,"children":[]},{"title":"Start the development server","slug":"start-the-development-server","depth":2,"children":[]},{"title":"Connect a data source","slug":"connect-a-data-source","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/cubed3/73c42f6b43b9b3b0/scripts/extract-chat.js","/_mintlify/custom/cubed3/19892615a6a53d32/scripts/extract-core-data.js","/_mintlify/custom/cubed3/476a9fa93e98d93b/consent.js"],"subdomain":"cubed3","siteName":"Cube Documentation","title":"Create a project - Cube Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-28T21:50:56.977Z","originalFileLocation":"cube-core/getting-started/create-a-project.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cube Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a project - Cube Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cube Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cube.dev/cube-core/getting-started/create-a-project\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cubed3.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Create+a+project\u0026amp;description=In+this+step%2C+we+will+create+a+Cube+Core+project+on+your+computer%2C+connect+a+data+source%2C+and+generate+data+models.\u0026amp;theme=784e8a91f0fc65e42d72e853\u0026amp;signature=96b146a4bee95126ca7e8fc987407bad9559d0c6d36c5010f30b895eae66e68d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a project - Cube Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cubed3.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Create+a+project\u0026amp;description=In+this+step%2C+we+will+create+a+Cube+Core+project+on+your+computer%2C+connect+a+data+source%2C+and+generate+data+models.\u0026amp;theme=784e8a91f0fc65e42d72e853\u0026amp;signature=96b146a4bee95126ca7e8fc987407bad9559d0c6d36c5010f30b895eae66e68d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cubed3/JtLYPWhDFrYGSK8W/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cube Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5339CF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cube.dev/cube-core/getting-started/create-a-project\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cube-core/getting-started/create-a-project.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cube.dev/#organization\",\"name\":\"Cube Documentation\",\"url\":\"https://docs.cube.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cubed3/wCTntgEXVYYYnx4l/logo/light.svg?fit=max\u0026auto=format\u0026n=wCTntgEXVYYYnx4l\u0026q=85\u0026s=8bbf45ba64eac6116629064fac55aad7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cube.dev#website\",\"name\":\"Cube Documentation\",\"url\":\"https://docs.cube.dev\",\"publisher\":{\"@id\":\"https://docs.cube.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project#webpage\",\"url\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project\",\"name\":\"Create a project\",\"description\":\"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.\",\"dateModified\":\"2026-09-28T21:50:56.977Z\",\"isPartOf\":{\"@id\":\"https://docs.cube.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://docs.cube.dev/cube-core/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a project\",\"item\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project#article\",\"headline\":\"Create a project\",\"name\":\"Create a project\",\"description\":\"In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.\",\"url\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cube.dev/cube-core/getting-started/create-a-project#webpage\"},\"dateModified\":\"2026-09-28T21:50:56.977Z\",\"publisher\":{\"@id\":\"https://docs.cube.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cube.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cube Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Cube Documentation","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/docs/introduction"}]},{"tab":"Admin","pages":[{"title":"Admin","href":"/admin/connect-to-data"}]},{"tab":"Embedding","pages":[{"title":"Embedding","href":"/embedding"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/data-modeling/cube"}]},{"tab":"Cube Core","groups":[{"group":"Getting Started","pages":[{"title":"Cube Core","href":"/cube-core"},{"title":"Getting started","href":"/cube-core/getting-started"},{"title":"Create a project","href":"/cube-core/getting-started/create-a-project"},{"title":"Query data","description":"Surveys ways to explore and consume modeled data—Playground, APIs, client SDKs, and BI or app integrations—after cubes are defined.","href":"/cube-core/getting-started/query-data"},{"title":"Add a pre-aggregation","href":"/cube-core/getting-started/add-a-pre-aggregation"},{"title":"Learn more","href":"/cube-core/getting-started/learn-more"}]},{"group":"Deployment","pages":[{"title":"Architecture","href":"/cube-core/architecture"},{"title":"Deploying Cube Core with Docker","href":"/cube-core/deployment"},{"title":"Running in production","href":"/cube-core/running-in-production"}]}]},{"tab":"Recipes","pages":[{"title":"Recipes","href":"/recipes"}]},{"tab":"API","pages":[{"title":"API","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Create a project - Cube Documentation","buildId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","deploymentId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-CK6QbnxT.js","DynamicMarkdown-BKiHAm_d.js","zoom-image-lightbox-CLQdF-Ar.js","lightbox-handle-r17bVUz3.js"]}