Skip to main content

LibreChat is joining ClickHouse. Learn more

LibreChat

npm

How to install LibreChat locally using npm

For most scenarios, Docker Compose is the recommended installation method due to its simplicity, ease of use, and reliability. If you prefer using npm, you can follow these instructions.

Prerequisites

  • Node.js v24.22.1: https://nodejs.org/en/download
  • npm v11.13.0
    • LibreChat uses CommonJS (CJS) and openid-client v6; Node 24 satisfies the required CJS/ESM interop, WebCrypto, and Fetch API runtime support.
  • Git: https://git-scm.com/download/
  • MongoDB (Atlas or Community Server)
  • At least 1 GiB RAM and 1 vCPU to run LibreChat. See System Requirements for what to plan for when you add more services or run models locally.
    • Building the frontend from source (npm run frontend, which npm run reinstall also runs) needs much more memory than running it: the client build allows Node.js up to 8 GB of heap. On a low-memory machine, use the prebuilt Docker images instead.

If you use nvm, install and select the recommended Node.js version, then update npm:

nvm install 24.22.1
nvm use 24.22.1
npm install -g [email protected]
node -v
npm -v

You should see v24.22.1 for Node.js and 11.13.0 for npm before installing LibreChat dependencies. The .nvmrc file in the LibreChat repository is the source of truth for the Node.js version, so nvm use run from the repository root selects the right one.

Installation Steps

Preparation

Run the following commands in your terminal:

git clone https://github.com/LibreChat-AI/LibreChat.git
cd LibreChat
cp .env.example .env

Note: If you're using Windows 10, you might need to use copy instead of cp.

Update the MONGO_URI

Edit the newly created .env file and set MONGO_URI to the connection string of your own MongoDB instance.

Build and Start

Once you've completed the preparation steps, run the following commands:

npm run reinstall

npm run reinstall performs a clean dependency install and builds LibreChat. Use it after changing Node.js or npm versions so native packages are rebuilt against the active runtime.

npm run backend

Access LibreChat!

Register an account, then follow Your First Chat to add a model API key and send your first message.

Tip

  • Next time you want to start LibreChat, you only need to execute npm run backend

Update LibreChat

To update LibreChat to the latest version, run the following commands:

First, stop LibreChat (if you haven't already).

git pull
npm run smart-reinstall

If you changed Node.js or npm versions during the update, run npm run reinstall instead.

npm run backend

Additional Setup

Unlock additional features by exploring our configuration guides to learn how to set up:

  • Meilisearch integration
  • RAG API connectivity
  • Custom endpoints
  • Other advanced configuration options
  • And more

This will enable you to customize your LibreChat experience with optional features.

see also:

How is this guide?