Set Up a Private AI Chatbot in 30 Minutes
Remember that first blog about running your own private AI? I got a lot of messages asking "but don't I need to pay for API keys?"
No, you don't.
Today we're setting up LibreChat with Google's Gemini. It's free. No credit card needed. In 30 minutes, you'll have your own ChatGPT alternative running on your computer.

Why Google Gemini?
Simple reasons:
2 million tokens free per month (that's about 1.5 million words)
No credit card required
It's actually good - competitive with GPT-5 for most tasks, plus it's much faster and cheaper
Works with images and documents
Available in most countries
What You Need

Check you have these:
A computer with 4GB free RAM
Docker Desktop installed (docker.com/products/docker-desktop)
A Google account (Gmail works)
30 minutes
Ability to copy-paste commands
Installing Prerequisites
Docker Desktop:
Windows/Mac: Download from docker.com/products/docker-desktop, run installer
Linux: Follow instructions at docs.docker.com/engine/install
After installing, start Docker Desktop and wait for it to show "Docker is running"
Git (optional, for easier download):
Windows: Download from git-scm.com
Mac: Run
xcode-select --install
in terminalLinux: Run
sudo apt install git
(Ubuntu/Debian) orsudo yum install git
(RedHat/CentOS)
Text Editor (if you don't have one):
Windows: Notepad works, or download Notepad++
Mac: TextEdit works, or download VS Code
Linux: nano, vim, or download VS Code
Don't have Docker? Just download and install it like any other app. Make sure it's running before continuing.
Step 1: Get Your Gemini API Key

This takes 5 minutes:
Go to aistudio.google.com
Sign in with Google
Click "Get API Key" on the left
Click "Create API Key"
Choose "Create API key in new project"
Copy the key (looks like:
AIzaSyD...
)
Save this key. We need it soon.
Step 2: Download LibreChat
Open terminal (Command Prompt on Windows, Terminal on Mac/Linux):
git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat
No git? Download the ZIP from github.com/danny-avila/LibreChat and extract it.
Step 3: Configure It
Copy the example config:
cp .env.example .env
Open
.env
in any text editorFind and update these lines:
# Enable Google and Uncomment these lines.
GOOGLE_MODELS=gemini-2.5-flash
GOOGLE_TITLE_MODEL=gemini-2.0-flash-lite-001
# Add your key
GOOGLE_KEY=your_key_here
Change these security settings (generate random strings):
Option A - Use a command:
On Mac/Linux:
openssl rand -hex 32
On Windows (PowerShell):
-join ((1..32) | ForEach {(65..90) + (97..122) + (48..57) | Get-Random | % {[char]$_}})
Option B - Use a website:
Go to randomkeygen.com and copy any string from "CodeIgniter Encryption Keys" section.
Then update your
.env
:CREDS_KEY=paste_your_first_random_string_here JWT_SECRET=paste_your_second_random_string_here
Save the file
Step 4: Start It
Run this command:
docker compose up -d
Wait 2-3 minutes. You'll see:
✔ Container LibreChat-mongodb Started
✔ Container LibreChat-api Started
Step 5: Use It
Open browser, go to: http://localhost:3080
Click "Sign up"
Create account (email doesn't need to be real for local use)
Log in
Select "gemini-2.5-flash" from the model dropdown
Type: "Hello, are you working?"
If you get a response, you're done. You have your own private AI.
Lock It Down
Do these security steps:
In
.env
, disable new signups:ALLOW_REGISTRATION=false
Restart LibreChat:
docker compose restart
If Something Goes Wrong
Docker won't connect
Check Docker Desktop is running
Port 3080 in use
Change port in
.env
to 3081 or another number
API key invalid
Check you copied the whole key
Remove any spaces before/after
No models showing
Make sure
GOOGLE_MODELS=gemini-2.5-flash
is set and uncommented.Restart with
docker compose restart
What Now?
You have a private AI that:
Stores conversations locally
Works with files and images
Costs nothing
Runs on your computer
Try uploading an image and asking about it. Or paste a long document for summarizing.
Check Your Usage
Go to aistudio.google.com and click "API Keys" to see how many tokens you've used. At 2 million per month, you probably won't hit the limit.
Useful Commands
Stop LibreChat:
docker compose down
Start it again:
docker compose up -d
See logs if something's wrong:
docker compose logs
Next Steps
Now that LibreChat works, you can:
Add more AI providers later
Install local models with Ollama (next blog)
Set up team access
Customize it
But for now, you have a working private AI that costs nothing.
Get Help
LibreChat Discord: discord.gg/librechat
GitHub Issues: github.com/danny-avila/LibreChat/issues
Next: Running AI completely offline with Ollama. No internet, no API keys, just local models.