A self-hosted, lightweight web interface for Ollama with per-IP persistent chat history. Perfect for local network deployments where multiple users can chat with AI models without authentication.
- 🚀 Simple Setup - Just Node.js and Ollama required
- 💬 Persistent History - Chat history saved per IP address
- 📊 Real-time Stats - Live CPU, RAM, and temperature monitoring
- 👥 Multi-User - Multiple users on local network
- 🔄 Streaming Responses - Real-time token streaming
- 🎯 Model Selection - Choose from available Ollama models
- 📱 Responsive Design - Works on desktop and mobile
- Node.js 18+ (for running the web server)
- Ollama installed and running on port 11434
- Local network access for users
# Linux
curl -fsSL https://ollama.com/install.sh | sh
# macOS
brew install ollama
# Windows
# Download from https://ollama.com/downloadollama serve# Example models
ollama pull llama3.2
ollama pull mistral
ollama pull codellama# Clone the repository
git clone https://github.com/jlaportebot/ollama-webapp-v2.git
cd ollama-webapp-v2
# Install dependencies
npm install
# Start the server
npm startThe web app will be available at http://localhost:3000
-
Find your local IP address:
# Linux/macOS hostname -I | awk '{print $1}' # Windows ipconfig
-
Access from other devices:
http://YOUR_LOCAL_IP:3000
- Create Conversations - Start new chats with any available model
- View History - All conversations are saved per IP address
- System Stats - Monitor CPU, RAM, and temperature in real-time
- Model Switching - Switch between different Ollama models
GET /api/healthReturns available Ollama models and connection status.
GET /api/statsReturns CPU, RAM, temperature, and active user count.
GET /api/conversations
POST /api/conversations
DELETE /api/conversations/:idManage chat conversations (scoped to user's IP).
GET /api/conversations/:id/messages
POST /api/conversations/:id/chatRetrieve and send messages with streaming support.
Edit server.js to change the default port (3000):
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});If Ollama is running on a different host, update the hostname in server.js:
// Line 173
hostname: "localhost", // Change to your Ollama host# Run with auto-reload
npm run dev
# Run tests (when available)
npm test
# Lint code (when available)
npm run lintollama-webapp-v2/
├── server.js # Express server with SQLite database
├── public/
│ └── index.html # Frontend interface
├── package.json # Dependencies and scripts
└── chat.db # SQLite database (auto-created)
- Backend: Node.js + Express
- Database: SQLite (better-sqlite3)
- Frontend: Vanilla HTML/CSS/JavaScript
- AI: Ollama API
- This app is designed for trusted local networks only
- No authentication - anyone on the network can access
- Chat history is stored per IP address
- Consider adding authentication for public deployments
- Use a reverse proxy (nginx) for production deployments
- Enable HTTPS for remote access
-
Add Authentication:
// Add middleware for authentication app.use((req, res, next) => { // Check for valid session/token next(); });
-
Use Reverse Proxy:
server { listen 443 ssl; server_name your-domain.com; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
-
Rate Limiting:
npm install express-rate-limit
# Check if Ollama is running
curl http://localhost:11434/api/tags
# Restart Ollama
ollama serve# Stop the server
# Delete or backup chat.db
rm chat.db
# Restart server (will create new database)# Find process using port 3000
lsof -i :3000
# Kill the process
kill -9 <PID>Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see LICENSE file for details.
- Ollama - Local LLM inference
- Express - Web framework
- better-sqlite3 - SQLite database
- 📧 Email: jlaportebot@gmail.com
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- User authentication system
- Export chat history
- Dark mode toggle
- Mobile app (PWA)
- Model parameters configuration
- System prompt customization
- Multi-language support