WeirdSecurity/VPS_Docker_MCP_Server
If you are the rightful owner of VPS_Docker_MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is a containerized VPS management system with Ollama integration, SQLite, and MongoDB, featuring a chatbot interface for VPS support using the phi3:mini model with GPU acceleration.
VPS Management System - Docker Setup
This is a containerized VPS management system with Ollama integration, SQLite, and MongoDB. Features a chatbot interface for VPS support using phi3:mini model with GPU acceleration.
Prerequisites
- Docker Desktop must be installed and running (Windows/Mac) or Docker Engine (Linux)
- Ollama must be installed and running on your host machine
- An Ollama model (like
llama3) must be pulled
Installation and Setup
1. Install Prerequisites
Install Docker
- Windows/Mac: Download and install Docker Desktop
- Linux: Install Docker Engine following official instructions
Install Ollama
- Windows: Download from https://ollama.com/download (Windows Preview)
- Mac:
brew install ollamaor download from https://ollama.com/download - Linux:
curl -fsSL https://ollama.ai/install.sh | sh
2. Install and Configure Ollama
Start Ollama
ollama serve
Note: Keep this terminal session open while using the application
Pull Required Models
ollama pull phi3:mini
Note: The system is configured to use
phi3:miniby default. You can also use other models likellama3,mistral, or any other available Ollama model
3. Clone and Set Up the Application
If you haven't already, clone or copy the project to your local machine and navigate to the project directory:
cd /path/to/your/VPS-Docker/VPS
4. Build and Run the Application
Build and Start All Services
docker-compose up --build -d
Note: The
-dflag runs containers in detached mode (background)
Alternative: Run in Foreground (to see logs)
docker-compose up --build
5. Verify the Application is Running
Check if all containers are running:
docker-compose ps
You should see all services running:
vps_backend(port 8000)vps_frontend(port 3000)vps_mcp(port 8001)vps_mongo(port 27017)
Application Ports and Services
| Service | Port | Purpose | URL |
|---|---|---|---|
| Frontend | 3000 | Web interface for VPS management | http://localhost:3000 |
| Backend | 8000 | Main API server and Swagger UI | http://localhost:8000 |
| API Documentation | http://localhost:8000/docs | ||
| MCP Server | 8001 | Database operations and LLM integration | http://localhost:8001 |
| MCP Health Check | http://localhost:8001/health | ||
| MongoDB | 27017 | Database for chat transcripts and data | localhost:27017 (internal only) |
Features
- AI-Powered Chatbot: Interactive support chatbot using Ollama phi3:mini model with GPU acceleration
- Hybrid Database Search: Intelligent query system that searches FAQ, client data, and VPS plans before using LLM
- Automatic dummy data insertion: VPS plans, clients, invoices, FAQs, and troubleshooting guides are created on startup
- Complete frontend interface: Web-based interface for managing VPS services with integrated chat
- Backend API: RESTful API with full CRUD operations
- Database support: Both SQLite and MongoDB for different use cases
- VPS instance management: Create, start, stop, and manage VPS instances
Usage
Accessing the Application
- Web Interface: Visit http://localhost:3000 to access the VPS management dashboard
- Chatbot: Use the integrated chat interface on the main page for VPS support questions
- API Documentation: Visit http://localhost:8000/docs for the interactive API documentation
- API Endpoint: Make API calls to http://localhost:8000 for backend services
Default Credentials
- Admin User: Username:
admin, Password:secret(for backend API) - Sample Clients: Created automatically with dummy data
Example API Tests
# Test backend health
curl http://localhost:8000/health
# Test MCP server health
curl http://localhost:8001/health
# Test chatbot query
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{"query": "What VPS plans do you offer?"}'
Configuration
Environment Variables
The application uses these environment variables:
OLLAMA_HOST: Set tohost.docker.internal:11434for Windows/Docker DesktopOLLAMA_MODEL: AI model to use (default:phi3:mini)MONGODB_URL: MongoDB connection string (mongodb://mongo:27017/vps_mcp_db)MCP_SERVER_URL: URL for the MCP server (http://mcp_server:8001internally)
Ollama Model Configuration
To use a different Ollama model:
- Pull the model:
ollama pull <model-name> - Update
OLLAMA_MODELindocker-compose.yml - Restart the application:
docker-compose down && docker-compose up --build
Current Model: phi3:mini (optimized for speed and GPU acceleration)
Troubleshooting
Common Issues
Ollama Connection Issues
- Symptom: MCP server logs show Ollama connection errors
- Solution: Ensure Ollama is running with
ollama serveand the correct model is pulled
Docker Connection Issues
- Symptom: Cannot access services on specified ports
- Solution:
- Check if Docker Desktop is running
- Run
docker-compose psto verify all services are running - Check container logs:
docker-compose logs <service-name>
Frontend Not Loading
- Symptom: Blank page or resources not loading on port 3000
- Solution: Verify all containers are running and the frontend service is healthy
Useful Commands
View Container Logs
# View all service logs
docker-compose logs
# View specific service logs
docker-compose logs backend
docker-compose logs mcp_server
docker-compose logs frontend
Stop the Application
docker-compose down
Stop and Remove Containers, Networks, and Volumes
docker-compose down -v
Rebuild and Restart
docker-compose down
docker-compose up --build -d
Access Container Shell
# Access backend container
docker-compose exec backend sh
# Access frontend container
docker-compose exec frontend sh
# Access MongoDB container
docker-compose exec mongo bash
Docker Images and Volumes
Images Created
vps-backend: Main application backend servicevps-mcp_server: MCP server for database and LLM operationsnginx:alpine: Frontend web servermongo:6.0: MongoDB database
Volumes
mongo_data: Persistent storage for MongoDB data
Development
Running Without Docker Compose (Alternative)
# Start MongoDB separately
docker run --name vps-mongo -p 27017:27017 -d mongo:6.0
# Build and run the app
docker build -t vps-app .
docker run -p 8000:8000 -p 8001:8001 --network=host -e OLLAMA_HOST=host.docker.internal:11434 vps-app
Development Mode
If you're developing and want to mount local files:
- Modify
docker-compose.ymlto add volume mounts for hot reloading - Use
docker-compose upwithout-dto see logs in real-time
Reference Links
- Docker Documentation
- Docker Compose Documentation
- Ollama Documentation
- FastAPI Documentation
- MongoDB Documentation
- Nginx Documentation
Stopping the Application
When you're done using the application:
- Stop the services:
docker-compose down - If you started Ollama separately, stop it with Ctrl+C in the terminal where it's running