Deployment
Just getting started? See the Installation Guide for local development setup.
This guide covers deploying Nous to a production environment using Docker Compose.
Deployment Modes
Section titled “Deployment Modes”Nous supports two deployment modes:
| Mode | Use Case |
|---|---|
| Standalone | Fresh servers — includes a bundled Caddy reverse proxy with automatic HTTPS |
| BYO Reverse Proxy | Servers with existing Caddy, Nginx, or Traefik — core services only |
Prerequisites
Section titled “Prerequisites”- A server with Docker and Docker Compose installed
- A domain name (for HTTPS in standalone mode)
- A Google API key for embeddings
Configuration
Section titled “Configuration”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/jwandekoken/nous.gitcd nous2. Create Your Environment File
Section titled “2. Create Your Environment File”cp .env.example .env3. Configure Environment Variables
Section titled “3. Configure Environment Variables”Edit .env with your production values:
# Required — generate with: openssl rand -hex 32SECRET_KEY=your-secret-key-here
# Required for embeddings and fact extractionGOOGLE_API_KEY=your-google-api-key
# Database credentials (change from defaults)POSTGRES_PASSWORD=your-secure-password
# For standalone mode with HTTPSDOMAIN=yourdomain.comOption A: Standalone Deployment
Section titled “Option A: Standalone Deployment”Use this if you don’t have an existing reverse proxy. Caddy will handle SSL certificates automatically via Let’s Encrypt.
Start All Services
Section titled “Start All Services”docker compose -f docker-compose.prod.yml --profile with-proxy up -d --buildYour application will be available at:
http://localhost(if no domain configured)https://yourdomain.com(ifDOMAINis set)
Option B: BYO Reverse Proxy
Section titled “Option B: BYO Reverse Proxy”Use this if you already have a reverse proxy (Caddy, Nginx, Traefik) running on your server.
Start Core Services
Section titled “Start Core Services”docker compose -f docker-compose.prod.yml up -d --buildThis starts the databases, API, and web frontend — but no reverse proxy.
Connect Your Reverse Proxy
Section titled “Connect Your Reverse Proxy”Your reverse proxy needs to connect to the nous-net Docker network to reach the internal services.
Step 1: Add the network to your reverse proxy’s docker-compose.yml:
networks: nous_nous-net: external: true
services: caddy: # or nginx, traefik, etc. networks: - your-existing-network - nous_nous-netStep 2: Add routing rules. Example for Caddy:
nous.yourdomain.com { handle /api/* { reverse_proxy nous_api:8000 } handle { reverse_proxy nous_web:80 }}Step 3: Reload your reverse proxy:
docker exec your-caddy-container caddy reload --config /etc/caddy/CaddyfileService Architecture
Section titled “Service Architecture”| Service | Container | Port (Internal) | Description |
|---|---|---|---|
| db | postgres_age | 5432 | PostgreSQL with Apache AGE (graph storage) |
| qdrant | qdrant | 6333 | Vector database (semantic search) |
| api | nous_api | 8000 | FastAPI backend |
| web | nous_web | 80 | Vue.js static frontend |
| reverse-proxy | nous_proxy | 80, 443 | Caddy (standalone mode only) |
Managing Your Deployment
Section titled “Managing Your Deployment”View Logs
Section titled “View Logs”# All servicesdocker compose -f docker-compose.prod.yml logs -f
# Specific servicedocker compose -f docker-compose.prod.yml logs -f apiStop Services
Section titled “Stop Services”docker compose -f docker-compose.prod.yml downUpdate to Latest Version
Section titled “Update to Latest Version”git pulldocker compose -f docker-compose.prod.yml up -d --buildQuick Reference
Section titled “Quick Reference”| Command | Description |
|---|---|
docker compose -f docker-compose.prod.yml up -d --build | Start core services (BYO proxy) |
docker compose -f docker-compose.prod.yml --profile with-proxy up -d --build | Start with bundled Caddy |
docker compose -f docker-compose.prod.yml down | Stop all services |
docker compose -f docker-compose.prod.yml logs -f | View logs |
docker compose -f docker-compose.prod.yml ps | Check service status |
Troubleshooting
Section titled “Troubleshooting”Containers Won’t Start
Section titled “Containers Won’t Start”- Check logs:
docker compose -f docker-compose.prod.yml logs - Verify
.envfile exists and has required variables - Ensure ports 80/443 aren’t in use (standalone mode)
Database Connection Issues
Section titled “Database Connection Issues”- Check database health:
docker compose -f docker-compose.prod.yml ps - View database logs:
docker compose -f docker-compose.prod.yml logs db - Verify
POSTGRES_PASSWORDmatches in your.env
SSL Certificate Issues (Standalone)
Section titled “SSL Certificate Issues (Standalone)”- Ensure your domain’s DNS points to your server
- Check Caddy logs:
docker compose -f docker-compose.prod.yml logs reverse-proxy - Verify port 443 is accessible from the internet
API Returns 502 Bad Gateway
Section titled “API Returns 502 Bad Gateway”- Check if the API container is running:
docker compose -f docker-compose.prod.yml ps api - View API logs for errors:
docker compose -f docker-compose.prod.yml logs api - Ensure database migrations have run successfully