LibreChat
Overview
LibreChat is a popular open-source, self-hosted AI chat interface: a feature-rich, ChatGPT-style web front end for large language models. It brings many providers together in one place. You connect your own OpenAI, Anthropic, Google or Azure OpenAI keys, or point at any OpenAI-compatible endpoint, including a local model server, and switch between models inside a single conversation. It adds conversation search, prompt and preset management and multi-user accounts on top.
This SecureAnyCloud image ships LibreChat as a three-service Docker Compose project under /opt/librechat. The project has the LibreChat web app bound to loopback 127.0.0.1:3080, a MongoDB database for users and conversations, and Meilisearch for fast conversation search. nginx fronts all three on port 80. It is configured for the streamed, server-sent responses that the chat relies on and is ready for your TLS certificate.
Secure by default, no default login. The image ships with no administrator and no user rows. Registration is open, so your first visit lands on the sign-up screen and the first account you create is yours.
A librechat-firstboot.service oneshot runs on first boot and then disables itself. It generates the per-instance secrets, pulls the newest images, brings the stack up, resolves the instance URL and writes a root-only instance info note.
Per-instance secrets. The JWT signing keys and the credential encryption keys are generated uniquely on first boot into /opt/librechat/.env, which is readable only by root. No two instances share a signing key, and nothing secret ships inside the image.
Bring your own model. No provider key ships in the image. The app boots and serves the full interface with no external key required. After you sign up, you add a provider key or connect a local endpoint from the interface.
Always current. AI tooling moves fast, so the image does not pin a stale version. On first boot, the stack runs docker compose pull to fetch the newest LibreChat, MongoDB and Meilisearch images. Every launch therefore runs current software rather than the version frozen at build time.
What you get:
- LibreChat (rolling release) as
ghcr.io/danny-avila/librechat:latest - MongoDB (
mongo:8.0.20) and Meilisearch (getmeili/meilisearch:v1.35.1) on the private Docker network - Docker Engine with the Compose plugin from the official Docker repository
librechat.servicemanaging the Compose stack, the app bound to127.0.0.1:3080- An nginx reverse proxy on port 80, aware of streamed responses and ready for TLS
librechat-firstboot.service, which generates secrets, pulls images, starts the stack and writes the info note on first boot- Ubuntu 24.04 LTS base, patched at build time
- 24/7 SecureAnyCloud support with a 24-hour response SLA
Prerequisites
You need an active Azure subscription, an SSH key pair, and a VNet with a subnet.
LibreChat and its data stores are lightweight, so a general-purpose VM is plenty. Use Standard_D2s_v5 (2 vCPU, 8 GB RAM) for comfortable multi-user use. The models themselves run at your chosen provider or a separate endpoint, so this VM does not need a GPU.
Deploy from the Azure Portal
Search the Azure Marketplace for LibreChat on Ubuntu 24.04 and choose your VM size.
Attach a network security group (NSG) that allows TCP 22 (SSH) from your management network. Also allow TCP 80 / 443 (the interface) from the networks that need it. In production, front port 80 with TLS (see Step 10).
Deploy from the Azure CLI
RG="librechat-prod"; LOCATION="eastus"; VM_NAME="librechat-01" IMAGE_URN="sac1647283583153:librechat-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION" az network vnet create -g "$RG" --name lc-vnet --address-prefix 10.90.0.0/16 --subnet-name lc-subnet --subnet-prefix 10.90.1.0/24 az network nsg create -g "$RG" --name lc-nsg az network nsg rule create -g "$RG" --nsg-name lc-nsg --name allow-ssh --priority 100 \
--source-address-prefixes "<your-mgmt-cidr>" --destination-port-ranges 22 --access Allow --protocol Tcp az network nsg rule create -g "$RG" --nsg-name lc-nsg --name allow-web --priority 110 \
--source-address-prefixes "<your-mgmt-cidr>" --destination-port-ranges 80 443 --access Allow --protocol Tcp
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:librechat-ubuntu-24-04:default:latest
az vm create -g "$RG" --name "$VM_NAME" --image "$IMAGE_URN" \
--size Standard_D2s_v5 --storage-sku StandardSSD_LRS \
--admin-username azureuser --ssh-key-values "$SSH_KEY" \
--vnet-name lc-vnet --subnet lc-subnet --nsg lc-nsg --public-ip-sku StandardConnect via SSH
ssh azureuser@<vm-ip>Verify the services are running
Docker runs the Compose stack. LibreChat listens on loopback 127.0.0.1:3080, and nginx fronts the interface on port 80 and proxies its streamed responses.
sudo systemctl is-active docker librechat nginx
sudo ss -tln | grep -E ':80 |127.0.0.1:3080' curl -s -o /dev/null -w 'GET /health -> HTTP %{http_code}\n' http://127.0.0.1/healthAll three services report active, LibreChat is bound to 127.0.0.1:3080, nginx is bound to :80, and the health endpoint returns HTTP 200 through nginx.
Secure by default, no admin ships
Nothing sensitive ships in the image. MongoDB has zero users, so every instance starts at the sign-up screen. The per-instance info note in /root is root-only and holds no credential, only the resolved URL. The per-instance secrets file is also readable only by root.
echo "MongoDB user count: $(sudo docker exec librechat-mongodb mongosh LibreChat --quiet --eval 'db.users.countDocuments()')"
sudo grep -E '^LIBRECHAT_URL|^NOTE' /root/librechat-info.txt
sudo stat -c '%n perms=%a owner=%U:%G' /opt/librechat/.envThe user count is 0, so no admin exists. The note tells you to create your own account at the sign-up screen. The .env file that holds the per-instance secrets is 600 root:root.
Create your account
Open http://<vm-ip>/ in your browser. No administrator ships and registration is open, so LibreChat shows its sign-up screen.
Select Sign up, enter a Name, your Email and a strong Password, confirm the password, and submit. The first account you create is yours, so pick a real password.
After you sign up, LibreChat opens the chat workspace, with the model and endpoint selector at the top and the message box ready.
Connect a model provider and start chatting
LibreChat is provider-neutral, so you choose which models to use. Open the endpoint and model selector at the top of the chat. It lists providers such as OpenAI, Anthropic, Google and any custom OpenAI-compatible endpoint.
Pick a provider and add your API key when prompted. Alternatively, configure a custom endpoint that points at a hosted or local model server.
You manage your keys and account preferences from Settings, reached from the menu by your account at the bottom of the sidebar. Once a provider is connected, select one of its models in the chat and send a prompt.
The runtime stack
docker --version nginx -v sudo docker compose -f /opt/librechat/docker-compose.yml ps
sudo docker image ls --format '{{.Repository}}:{{.Tag}} {{.Size}}' | grep -E 'librechat|mongo|meili'Docker runs the three-container Compose stack, nginx fronts it, and the librechat-api, librechat-mongodb and librechat-meilisearch containers all report Up.
Data, persistence and staying current
LibreChat data (users, conversations, uploads) lives in Docker named volumes captured into the image. The first-boot service keeps every instance current.
sudo docker volume ls --format '{{.Name}}' | grep librechat systemctl is-enabled librechat-firstboot.service apt-mark showholdThe librechat_mongodb, librechat_meili, librechat_uploads, librechat_logs and librechat_images volumes hold the data. The first-boot service has already run once and disabled itself on this instance, and there are no held packages, so the OS security baseline is intact.
The baked images are present, so the stack starts immediately while the first-boot pull fetches any newer release.
Enable HTTPS
nginx already fronts LibreChat on port 80 and is ready for TLS. Point a DNS record at your VM, then obtain a certificate with certbot:
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d <your-domain> --agree-tos -m <your-email> --redirectcertbot installs the certificate, rewrites the nginx server block for TLS, and sets up automatic renewal. LibreChat is then served over HTTPS.
Managing the service
sudo systemctl is-active librechat nginx dockerAll three services report active. librechat.service manages the Compose stack.
- Restart: run
sudo systemctl restart librechat. - Follow the logs: run
sudo docker compose -f /opt/librechat/docker-compose.yml logs -fto follow the container logs live. - Update: to refresh to the newest release at any time, run
sudo docker compose -f /opt/librechat/docker-compose.yml pull, thensudo systemctl restart librechat. - Back up: snapshot the OS disk, or export the
librechat_mongodbvolume while the service is stopped.
Support
SecureAnyCloud provides 24/7 support for this image by email and live chat. Support covers deployment, nginx TLS termination, model provider configuration, upgrades and performance tuning. Email sales@secureanycloud.com.
This is a repackaged open-source software product, with additional charges for SecureAnyCloud support services. LibreChat is a trademark of its respective owner. All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on Azure
Launch LibreChat on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
This image runs LibreChat, the open-source AI chat platform. It is a self-hosted, ChatGPT-style web interface that connects to many model providers (OpenAI, Azure OpenAI, Anthropic, Google, AWS Bedrock, Ollama and any OpenAI-compatible endpoint) behind one UI. It includes conversation search, presets and multi-user accounts.
The LibreChat Node server runs behind nginx as a reverse proxy. MongoDB is the datastore and Meilisearch powers conversation search. Both bind to the loopback interface only. The server listens on 127.0.0.1:3080 and is reached through nginx on port 80 (and 443 once you add TLS).
LibreChat encrypts user-saved provider keys at rest and signs sessions with secrets that are generated fresh on the first boot of every deployed instance. No two instances share an encryption or session key.
Open registration is disabled. A single login is created on first boot and written to /root/librechat-credentials.txt with mode 0600. The image ships no model provider API keys, so you add your own after signing in.
Prerequisites
Before you deploy this image you need:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network and inbound ports 80 and 443 from the networks your users will reach LibreChat on
- The AWS CLI (version 2) installed locally if you plan to deploy from the command line
- An API key for at least one model provider (OpenAI, Anthropic, AWS Bedrock credentials, a local Ollama endpoint, etc.) to actually chat
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for LibreChat. Select the SecureAnyCloud listing, choose Select, then choose Continue on the subscription summary.
Pick an instance type of m5.large or larger. Choose your EC2 key pair under Key pair (login).
Under Network settings, select your VPC and subnet. Create or select a security group that allows inbound port 22 from your management network and inbound ports 80 and 443 from the networks your users use. Leave the root volume at the default size or larger.
Select Launch instance. First-boot initialisation takes approximately one to two minutes after the instance state becomes Running and the status checks pass.
Launch the instance from the AWS CLI
The following command launches an instance from the SecureAnyCloud LibreChat Marketplace AMI into an existing subnet and security group.
Replace <ami-id> with the AMI ID shown on the Marketplace listing, <key-name> with your EC2 key pair name, and <subnet-id> with your subnet ID. Replace <security-group-id> with a security group that opens ports 22, 80 and 443 as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":30,"VolumeType":"gp3"}}]' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=librechat-01}]'On success, the command prints a JSON document. Note the instance ID. Once the instance is running, retrieve its public address with aws ec2 describe-instances --instance-ids <instance-id> --query "Reservations[].Instances[].PublicIpAddress" --output text.
Connect and retrieve the initial login
Connect over SSH with the key pair you selected and the public IP address from Step 2. The SSH login user depends on the operating system of the AMI variant you launched:
- LibreChat 0.8 on Ubuntu 24.04: SSH login user ubuntu
The first-boot service runs before the SSH daemon becomes ready, so the credentials file is always in place when you log in for the first time.
ssh <login-user>@<public-ip>
sudo cat /root/librechat-credentials.txtThe output is a plain text file containing the LibreChat URL, the login email (admin@example.com) and the password. Copy these values somewhere secure.
From the same SSH session, confirm that the deployment is healthy. The health endpoint is open:
curl -fsS -o /dev/null -w 'health HTTP %{http_code}\n' http://127.0.0.1/healthA health HTTP 200 response confirms that the full stack (nginx, the LibreChat server, MongoDB and Meilisearch) is serving.
First sign-in
Open a web browser and go to http://<public-ip>/. LibreChat shows its sign-in page. Enter the email and password from /root/librechat-credentials.txt and select Continue.
The sign-in page is served on first boot with a per-instance login and registration disabled.
After you sign in, you reach the chat interface. The first-boot service set LibreChat's domain to the instance's own address automatically, so the app works immediately on its launch address.
The conversation interface offers one UI for many model providers, with conversation search and presets.
Connect a model provider
The image ships no model provider API keys, so you must connect at least one provider before you can chat. Select Select a model at the top of the chat and choose a provider, for example OpenAI, Anthropic, or a custom OpenAI-compatible endpoint. Enter your API key when prompted. Keys you enter in the UI are encrypted at rest with this instance's unique key.
For AWS Bedrock, give the instance an IAM role with Bedrock access and configure the Bedrock endpoint.
To use a private model server in the same VPC (for example an Ollama or vLLM instance), point a custom endpoint at its address. Prompts then never leave your account.
You can also set provider defaults server-side in /opt/LibreChat/.env and /opt/LibreChat/librechat.yaml. After editing, restart the service with sudo systemctl restart librechat.
Agents and conversation search
LibreChat includes an Agent Marketplace for building and sharing AI agents across categories. Open it from the left sidebar.
The Agent Marketplace is where you discover and use AI agents.
Meilisearch provides conversation search. Use the search box in the sidebar once you have some conversations.
Enable registration and add users
By default, open registration is disabled, so the instance is not open to the world on launch. To let users self-register, set ALLOW_REGISTRATION=true in /opt/LibreChat/.env and restart. To add a user from the command line without enabling registration, run:
cd /opt/LibreChat && sudo -u librechat npm run create-user -- <your-email> "<full name>" <username> --email-verified=trueEnable HTTPS with Let's Encrypt
For any production deployment, serve LibreChat over HTTPS so that session tokens and prompts cannot be intercepted. The image ships with nginx, which certbot can configure automatically.
The following steps assume that a DNS record points your fully qualified domain name at the instance's public IP address.
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d librechat.your-domain.example \
--non-interactive --agree-tos -m you@your-domain.example \
--redirectAfter certbot finishes, set the domain so that LibreChat generates correct links, then restart:
sudo sed -i 's|^DOMAIN_CLIENT=.*|DOMAIN_CLIENT=https://<your-domain>|; s|^DOMAIN_SERVER=.*|DOMAIN_SERVER=https://<your-domain>|' /opt/LibreChat/.env
sudo systemctl restart librechatBackups and maintenance
LibreChat keeps its state in MongoDB and uploaded files under /opt/LibreChat. Back up both together:
sudo mongodump --db LibreChat --archive=<backup-dir>/librechat-mongo-$(date +%F).archive
sudo tar -czf <backup-dir>/librechat-files-$(date +%F).tgz -C /opt/LibreChat uploadsShip both artifacts to an Amazon S3 bucket or another object store. The database and application tiers are on their own EBS volumes, so you can also take coordinated EBS snapshots.
Ubuntu's unattended-upgrades is enabled by default for kernel and package updates. To upgrade LibreChat itself, follow the upgrade guidance at https://www.librechat.ai/docs.
Scaling beyond a single instance
For larger deployments, decouple LibreChat from the single-instance pattern:
- Move MongoDB to Amazon DocumentDB or a managed MongoDB and update
MONGO_URIin/opt/LibreChat/.env - Run Meilisearch on its own instance and point
MEILI_HOSTat it - Put the web tier behind an Application Load Balancer with sticky sessions and scale horizontally
- Serve static assets through Amazon CloudFront
The official LibreChat documentation at https://www.librechat.ai/docs covers each of these.
Support
SecureAnyCloud provides 24/7/365 expert technical support for this image. We guarantee a response within 24 hours, with a one-hour average for critical issues. Contact sales@secureanycloud.com.
For general LibreChat questions, consult the documentation at https://www.librechat.ai/docs. LibreChat is a trademark of its respective owner. Its use here is nominative and does not imply affiliation or endorsement.
Deploy on AWS
Launch LibreChat on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com