docs/docs/cn/get-started/installation/git.mdx
:::tip 前提条件
$ yarn config set disable-self-update-check true
$ yarn config set registry https://registry.npmmirror.com/
:::
选择 NocoBase 版本(版本对比),执行相应的命令。
<Tabs> <Tab label="Latest 版本">git clone https://github.com/nocobase/nocobase.git -b main --depth=1 my-nocobase
git clone https://github.com/nocobase/nocobase.git -b next --depth=1 my-nocobase
git clone https://github.com/nocobase/nocobase.git -b develop --depth=1 my-nocobase
cd my-nocobase
📢 由于网络环境、系统配置等因素影响,接下来这一步骤可能需要十几分钟时间。
yarn install --frozen-lockfile
NocoBase 所需的环境变量储存在根目录 .env 文件里,根据实际情况修改环境变量。
TZ=Asia/Shanghai
APP_KEY=your-secret-key
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=postgres
DB_USER=nocobase
DB_PASSWORD=nocobase
:::warning 环境变量说明
TZ 用于设置应用的时区,默认为操作系统时区;APP_KEY 是应用的密钥,用于生成用户 token 等(如果 APP_KEY 修改了,旧的 token 也会随之失效)。它可以是任意随机字符串。请修改为自己的秘钥,并确保不对外泄露;DB_* 为数据库相关,如果不是例子默认的数据库服务,请根据实际情况修改。:::
yarn nocobase install --lang=zh-CN
开发环境
yarn dev
生产环境(不推荐)
不建议直接在生产环境中使用源码部署,生产环境请参考 生产环境部署。
yarn build
yarn start
使用浏览器打开 http://localhost:13000,初始化账号和密码是 [email protected] 和 admin123。
:::warning 账号安全提示
首次登录后,请及时修改默认密码以确保系统安全。
:::