LibreChat

Overview

How to set up a productive LibreChat development workflow.

Docker is the preferred install path for most users, but local LibreChat development should use npm. Running the app directly on your machine gives faster feedback, clearer debugging, and direct access to the monorepo workspaces without rebuilding containers after each change.

Use this toolchain for npm-based development:

ToolVersion
Node.jsv24.16.0
npmv11.16.0
MongoDBAtlas or Community Server

Node 24 satisfies LibreChat's runtime needs for CommonJS interop with ESM-only packages, WebCrypto, and the Fetch API. If your shell still reports an older Node version, run nvm use 24.16.0 from the LibreChat repository before installing dependencies.

Work In The Right Workspace

LibreChat is a monorepo. Pick the smallest workspace that owns the behavior you are changing:

WorkspaceUse it for
/packages/apiNew backend TypeScript services, controllers, and shared server logic
/apiLegacy Express server integration; keep changes thin
/packages/data-schemasDatabase models, schemas, and database-specific shared logic
/packages/data-providerShared API types, endpoints, query keys, and data-service functions
/clientReact application code
/packages/clientShared frontend utilities

Daily Commands

CommandPurpose
npm run smart-reinstallInstall dependencies when needed and build compiled workspaces
npm run reinstallClean install after changing Node/npm versions or when dependency state is suspect
npm run backend:devStart the backend with file watching
npm run frontend:devStart the frontend dev server on port 3090
npm run build:data-providerRebuild shared data-provider code after API/type changes
npm run buildBuild all compiled workspaces through Turborepo

Development Resources

Development Resources

How is this guide?