Skip to main content

Command Palette

Search for a command to run...

Deploying LibreChat Open-Source AI Chat Platform on Ubuntu 24.04

Step-by-step guide to deploy LibreChat on Ubuntu 24.04 using Docker Compose with a Traefik override for automatic HTTPS in front of the multi-provider AI chat UI.

Updated
3 min read
Deploying LibreChat Open-Source AI Chat Platform on Ubuntu 24.04
S
A Developer Advocate with a focus on improving the developer experience through clear communication, technical enablement, and community engagement.
A
DevOps Engineer with experience in Kubernetes, automation, cloud infrastructure, and observability. I work in Developer Relations, contribute to technical documentation, and collaborate on engineering-focused projects.

LibreChat is an open-source, ChatGPT-style web UI that supports OpenAI, Anthropic, Azure OpenAI, Gemini, OpenRouter, local OpenAI-compatible endpoints, and more — with MongoDB-backed conversation history and Meilisearch-powered search. This guide deploys LibreChat using its official Compose manifest plus a Traefik override for automatic HTTPS, following self-hosted AI chat platform deployment practices documented in Vultr Docs.


Clone LibreChat and Prepare the Environment

1. Clone the LibreChat repository and check out a stable tag:

git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat
git checkout tags/v0.8.3

2. Find the Meilisearch data directory name pinned by this release:

grep -o 'meili_data_v[0-9.]*' docker-compose.yml | head -1

3. Create the required data directories (replace meili_data_v1.35.1 if the previous command printed a different name):

mkdir -p data-node images logs meili_data_v1.35.1 uploads
sudo chown -R 1000:1000 meili_data_v1.35.1

4. Copy the env template and uncomment the UID/GID lines:

cp .env.example .env
nano .env
UID=1000
GID=1000

Override the Compose Stack with Traefik

1. Create a Compose override that adds Traefik and wires the API to it:

nano docker-compose.override.yml
services:
  api:
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.librechat.rule=Host(`librechat.example.com`)"
      - "traefik.http.routers.librechat.entrypoints=websecure"
      - "traefik.http.routers.librechat.tls.certresolver=leresolver"
      - "traefik.http.services.librechat.loadbalancer.server.port=3080"
    volumes:
      - ./librechat.yaml:/app/librechat.yaml

  traefik:
    image: traefik:v3.6.10
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./letsencrypt:/letsencrypt"
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.web.http.redirections.entrypoint.permanent=true"
      - "--certificatesresolvers.leresolver.acme.httpchallenge=true"
      - "--certificatesresolvers.leresolver.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.leresolver.acme.email=admin@example.com"
      - "--certificatesresolvers.leresolver.acme.storage=/letsencrypt/acme.json"

2. Create an empty LibreChat configuration file (mounted by the override):

touch librechat.yaml

Start the Stack

1. Bring everything up:

docker compose up -d

Compose starts the LibreChat API, MongoDB, Meilisearch, and Traefik. Traefik requests a TLS certificate from Let's Encrypt over the HTTP-01 challenge and routes HTTPS to LibreChat on port 3080.

2. Verify the containers are running:

docker compose ps

3. Tail the logs:

docker compose logs --tail=50

You should see MongoDB initialize, Meilisearch start, Traefik register the route, and the LibreChat API listening on port 3080.


Register and Sign In

1. Open the registration page in a browser:

https://librechat.example.com/register

2. Fill in your name, username, email, and password and click Continue.

3. Sign in with the new credentials — the dashboard loads with the model selector and conversation interface.

To enable Google / GitHub / Discord / OpenID Connect sign-up, set ALLOW_SOCIAL_LOGIN=true and ALLOW_SOCIAL_REGISTRATION=true in .env and restart the stack.


Next Steps

LibreChat is running and served securely over HTTPS. From here you can:

  • Plug in API keys for OpenAI, Anthropic, Azure, Gemini, or OpenRouter in .env

  • Point LibreChat at a local OpenAI-compatible endpoint (Ollama, LocalAI) via librechat.yaml

  • Enable file uploads, RAG, and image generation through the dashboard settings

For the full guide with additional tips, visit the original article on Vultr Docs.

The Self-Hosted Stack

Part 1 of 50

The Self-Hosted Stack is a developer-focused series exploring open-source tools you can deploy, run, and manage on your own infrastructure. From AI platforms and databases to developer tools, observability stacks, and authentication systems, each guide walks through deploying production-ready open-source software on Vultr cloud infrastructure.

More from this blog

V

Vultr

81 posts

Vultr is a global cloud infrastructure provider trusted by developers and businesses in 185+ countries. We publishe hands-on guides spanning Linux administration, server configuration, DevOps, networking, open source stacks, AI code agents, and Vultr product walkthroughs, all tested against real cloud environments and built for engineers who ship.