Self-Hosting
Deploy the Lucid stack on your own infrastructure for full data sovereignty and custom deployment requirements.Architecture
Prerequisites
- Docker and Docker Compose
- PostgreSQL 15+ (or Supabase self-hosted)
- Solana RPC endpoint (Helius, QuickNode, or local validator)
- Ed25519 keypair for receipt signing
- Node.js 20+
Docker Compose
Configuration
1. Generate a Session Signer
2. Configure LiteLLM
Createlitellm-config.yaml for your preferred LLM providers:
3. Run Migrations
4. Start the Stack
Verify Installation
Networking
| Service | Port | Protocol | External? |
|---|---|---|---|
| TrustGate | 4010 | HTTP | Yes (clients connect here) |
| MCPGate | 4020 | HTTP | Yes (agents connect here) |
| Lucid-L2 API | 3001 | HTTP | Optional (internal receipts) |
| LiteLLM | 4000 | HTTP | No (internal only) |
| PostgreSQL | 5432 | TCP | No (internal only) |
Security Considerations
- Never expose PostgreSQL or LiteLLM ports externally
- Use TLS termination (nginx/Caddy) in front of TrustGate and MCPGate
- Rotate the session signer keypair periodically
- Set
ADMIN_API_KEYfor MCPGate control plane access - Store secrets in a vault, not in docker-compose.yaml
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)