Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

ngrok

Use Ngrok to tunnel your local server to the internet.

To use ngrok for tunneling your local server to the internet, follow these steps:

Sign up

  1. Go to https://ngrok.com/ and sign up for an account.

Docker Installation

  1. Copy your auth token from: https://dashboard.ngrok.com/get-started/your-authtoken
  2. Open a terminal and run the following command. Inside the ngrok container, localhost refers to the container itself, so the command points ngrok at the Docker host, where LibreChat publishes port 3080:
docker run -d -it --add-host=host.docker.internal:host-gateway -e NGROK_AUTHTOKEN=<your token> ngrok/ngrok http host.docker.internal:3080

The --add-host flag is needed on Linux; Docker Desktop on macOS and Windows already resolves host.docker.internal. If you run LibreChat with deploy-compose.yml, use host.docker.internal:80 instead.

Windows Installation

  1. Download the ZIP file from: https://ngrok.com/download
  2. Extract the contents of the ZIP file using 7zip or WinRar.
  3. Run ngrok.exe.
  4. Copy your auth token from: https://dashboard.ngrok.com/get-started/your-authtoken
  5. In the ngrok.exe terminal, run the following command: ngrok config add-authtoken <your token>
  6. If you haven't done so already, start LibreChat normally.
  7. In the ngrok.exe terminal, run the following command: ngrok http 3080

You will see a link that can be used to access LibreChat. ngrok-1

Linux Installation

  1. Copy the command from: https://ngrok.com/download choosing the correct architecture.
  2. Run the command in the terminal
  3. Copy your auth token from: https://dashboard.ngrok.com/get-started/your-authtoken
  4. run the following command: ngrok config add-authtoken <your token>
  5. If you haven't done so already, start LibreChat normally.
  6. run the following command: ngrok http 3080

Mac Installation

  1. Download the ZIP file from: https://ngrok.com/download
  2. Extract the contents of the ZIP file using a suitable Mac application like Unarchiver.
  3. Open Terminal.
  4. Navigate to the directory where you extracted ngrok using the cd command.
  5. Run ngrok by typing ./ngrok.
  6. Copy your auth token from: https://dashboard.ngrok.com/get-started/your-authtoken
  7. In the terminal where you ran ngrok, enter the following command: ngrok authtoken <your token>
  8. If you haven't done so already, start LibreChat normally.
  9. In the terminal where you ran ngrok, enter the following command: ./ngrok http 3080

Update your .env

Once ngrok shows your public URL, set DOMAIN_CLIENT and DOMAIN_SERVER in LibreChat's .env file to that URL (for example https://example.ngrok-free.app), then restart LibreChat so links, cookies, and OAuth callbacks use the public address.

How is this guide?