Docs
Configuration
Authentication
Password Reset

Email and Password Reset

For a quick overview, refer to the user guide provided here: Password Reset

General setup

Basic Configuration

If you want to use one of the predefined services, configure only these variables: For more info about supported email services: https://community.nodemailer.com/2-0-0-beta/setup-smtp/well-known-services/

KeyTypeDescriptionExample
EMAIL_SERVICEstringEmail service (e.g., Gmail, Outlook).EMAIL_SERVICE=
EMAIL_USERNAMEstringUsername for authentication.EMAIL_USERNAME=
EMAIL_PASSWORDstringPassword for authentication.EMAIL_PASSWORD=
EMAIL_FROM_NAMEstringFrom name.EMAIL_FROM_NAME=
EMAIL_FROMstringFrom email address. Required.[email protected]

Advanced Configuration

If you want to use a generic SMTP service or need advanced configuration for one of the predefined providers, configure these variables as well:

KeyTypeDescriptionExample
EMAIL_HOSTstringMail server host.EMAIL_HOST=
EMAIL_PORTnumberMail server port.EMAIL_PORT=25
EMAIL_ENCRYPTIONstringEncryption method (starttls, tls, etc.).EMAIL_ENCRYPTION=
EMAIL_ENCRYPTION_HOSTNAMEstringHostname for encryption.EMAIL_ENCRYPTION_HOSTNAME=
EMAIL_ALLOW_SELFSIGNEDbooleanAllow self-signed certificates.EMAIL_ALLOW_SELFSIGNED=
⚠️
Warning

Failing to perform either of the below setups will result in LibreChat using the unsecured password reset! This allows anyone to reset any password on your server immediately, without mail being sent at all!

Setup with Gmail

To set up Gmail, follow these steps:

  1. Create a Google Account and enable 2-step verification.
  2. In the Google Account settings, click on the “Security” tab and open “2-step verification.”
  3. Scroll down and open “App passwords.” Choose “Mail” for the app and select “Other” for the device, then give it a random name.
  4. Click on “Generate” to create a password, and copy the generated password.
  5. In the .env file, modify the variables as follows:
KeyTypeDescriptionExample
EMAIL_SERVICEstringgmailEMAIL_SERVICE=gmail
EMAIL_USERNAMEstringyour-emailEMAIL_USERNAME=your-email
EMAIL_PASSWORDstringyour-email-passwordEMAIL_PASSWORD=your-email-password
EMAIL_FROMstringemail address for the from field, e.g., [email protected][email protected]
EMAIL_FROM_NAMEstringMy LibreChat ServerEMAIL_FROM_NAME=LibreChat

Setup with custom mail server

To set up a custom mail server, follow these steps:

  1. Gather your SMTP login data from your provider. The steps are different for each, but they will usually list values for all variables.
  2. In the .env file, modify the variables as follows, assuming some sensible example values:
KeyTypeDescriptionExample
EMAIL_HOSTstringHostname to connect toEMAIL_HOST=mail.example.com
EMAIL_PORTintegerPort to connect toEMAIL_PORT=25
EMAIL_ENCRYPTIONstringEncryption typeEMAIL_ENCRYPTION=starttls
EMAIL_USERNAMEstringYour email username[email protected]
EMAIL_PASSWORDstringYour app passwordEMAIL_PASSWORD=password
EMAIL_FROMstringEmail address for the from field[email protected]
EMAIL_FROM_NAMEstringName that will appear in the "from" fieldEMAIL_FROM_NAME=LibreChat