Back to Nocobase

create-nocobase-app Installation

docs/docs/en/get-started/installation/create-nocobase-app.mdx

2.1.24.2 KB
Original Source

create-nocobase-app Installation

:::tip Prerequisites

  • Node.js >= 22, Yarn 1.22.x installed
  • One of the following databases configured and running: MySQL 8.0.17+, MariaDB 10.9+, or PostgreSQL 10+

:::

1. Create a NocoBase Project

Select the NocoBase version (Version Comparison) and database type, then execute the corresponding command.

<Tabs> <Tab label="Latest Version"> <Tabs> <Tab label="PostgreSQL">
bash
yarn create nocobase-app my-nocobase-app -d postgres \
   -e DB_HOST=localhost \
   -e DB_PORT=5432 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> <Tab label="MySQL">
bash
yarn create nocobase-app my-nocobase-app -d mysql \
   -e DB_HOST=localhost \
   -e DB_PORT=3306 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> <Tab label="MariaDB">
bash
yarn create nocobase-app my-nocobase-app -d mariadb \
   -e DB_HOST=localhost \
   -e DB_PORT=3306 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> </Tabs> </Tab> <Tab label="Beta Version"> <Tabs> <Tab label="PostgreSQL">
bash
npx create-nocobase-app@beta my-nocobase-app -d postgres \
   -e DB_HOST=localhost \
   -e DB_PORT=5432 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> <Tab label="MySQL">
bash
npx create-nocobase-app@beta my-nocobase-app -d mysql \
   -e DB_HOST=localhost \
   -e DB_PORT=3306 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> <Tab label="MariaDB">
bash
npx create-nocobase-app@beta my-nocobase-app -d mariadb \
   -e DB_HOST=localhost \
   -e DB_PORT=3306 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> </Tabs> </Tab> <Tab label="Alpha Version"> <Tabs> <Tab label="PostgreSQL">
bash
npx create-nocobase-app@alpha my-nocobase-app -d postgres \
   -e DB_HOST=localhost \
   -e DB_PORT=5432 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> <Tab label="MySQL">
bash
npx create-nocobase-app@alpha my-nocobase-app -d mysql \
   -e DB_HOST=localhost \
   -e DB_PORT=3306 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> <Tab label="MariaDB">
bash
npx create-nocobase-app@alpha my-nocobase-app -d mariadb \
   -e DB_HOST=localhost \
   -e DB_PORT=3306 \
   -e DB_DATABASE=nocobase \
   -e DB_USER=nocobase \
   -e DB_PASSWORD=nocobase \
   -e TZ=UTC
</Tab> </Tabs> </Tab> </Tabs>

:::warning Environment Variable Description

  • TZ is used to set the application's time zone, defaulting to the operating system's time zone.
  • APP_KEY is the application's secret key, used for generating user tokens, etc. (If APP_KEY is modified, old tokens will become invalid). It can be any random string. Please change it to your own secret key and ensure it is not exposed.
  • DB_* are database-related configurations. Please modify them according to your actual database connection information.

:::

2. Switch Directory

bash
cd my-nocobase-app

3. Install Dependencies

šŸ“¢ This step may take several minutes depending on your network environment and system configuration.

bash
yarn install

:::tip Production Environment Tip

When deploying to a production environment, you can install only the necessary dependencies to reduce the size:

bash
yarn install --production

:::

4. Install NocoBase

bash
yarn nocobase install --lang=en-US

The installation process will automatically create the database table structure and initialize data.

5. Start NocoBase

Development Environment

bash
yarn dev

Production Environment

bash
yarn start

6. Log in to NocoBase

Open http://localhost:13000 in your browser. The initial account and password are [email protected] and admin123.

:::warning Account Security Tip

After your first login, please change the default password immediately to ensure system security.

:::