# npm (https://www.librechat.ai/docs/local/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.16.0`: [https://nodejs.org/en/download](https://nodejs.org/en/download)
- npm `v11.16.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)
  - [MongoDB Atlas](/docs/configuration/mongodb/mongodb_atlas)
  - [MongoDB Community Server](/docs/configuration/mongodb/mongodb_community)

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

```bash filename="Use Node.js 24 and npm 11"
nvm install 24.16.0
nvm use 24.16.0
npm install -g npm@11.16.0
node -v
npm -v
```

You should see `v24.16.0` for Node.js and `11.16.0` for npm before installing LibreChat
dependencies.

## Installation Steps

### Preparation

Run the following commands in your terminal:

```bash filename="Clone the Repository"
git clone https://github.com/danny-avila/LibreChat.git
```

```bash filename="Navigate to the LibreChat Directory"
cd LibreChat
```

```bash filename="Create a .env File from .env.example"
cp .env.example .env
```

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

```bash filename="Update the MONGO_URI"
Important: Edit the newly created `.env` file to update the `MONGO_URI` with your own MongoDB instance URI.
```

<Callout title="Update the MONGO_URI" emoji="❗">
  Edit the newly created `.env` file to update the `MONGO_URI` with your own
</Callout>

### Build and Start

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

```bash filename="Install dependencies"
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.

```bash filename="Start LibreChat!"
npm run backend
```

<Callout type="success" title="Access LibreChat!" emoji="🎉">
  **Visit [http://localhost:3080/](http://localhost:3080/)**
</Callout>

<Callout type="example" title="Tip" emoji="🔥">
  - Next time you want to start LibreChat, you only need to execute `npm run backend`
</Callout>

## Update LibreChat

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

<Callout type="warning" emoji="">
  First, stop LibreChat (if you haven't already).
</Callout>

```bash filename="Pull latest project changes"
git pull
```

```bash filename="Update dependencies"
npm run smart-reinstall
```

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

```bash filename="Start LibreChat!"
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:**
- [User Authentication System Setup](/docs/configuration/authentication)
- [AI Setup](/docs/configuration/pre_configured_ai)
- [Custom Endpoints & Configuration](/docs/configuration/librechat_yaml)
