Installation Guide
This guide will help you install and configure ContextDX on your own infrastructure.
ContextDX Installation Guide
Welcome to ContextDX! This guide will help you install and configure ContextDX on your own infrastructure.
Table of Contents
- System Requirements
- Quick Start
- Configuration
- Starting the Platform
- Accessing the Application
- Verifying Installation
- Upgrades
- Stopping and Restarting
- Getting Help
Related Guides:
System Requirements
Minimum Requirements
| Resource | Requirement |
|---|---|
| CPU | 2 cores |
| RAM | 4 GB |
| Disk | 20 GB free space |
| OS | Linux (Ubuntu 20.04+, CentOS 8+), Windows Server 2019+, macOS |
Software Requirements
| Software | Version | Notes |
|---|---|---|
| Docker | 20.10+ | Install Docker |
| Docker Compose | v2+ | Usually included with Docker Desktop |
Network Requirements
| Port | Protocol | Purpose |
|---|---|---|
| 80 | TCP | Web interface (configurable) |
| 443 | TCP | HTTPS (if using SSL termination) |
The platform needs outbound internet access to:
portal.contextdx.com(or your configured Portal URL)registry.hub.docker.com(to pull images)
Quick Start
Step 0: Pre-flight Check (Recommended)
Before installing, verify your system meets all requirements:
Linux/macOS:
BASHcurl -fsSL https://raw.githubusercontent.com/your-org/contextdx/main/deploy/preflight.sh | bash
Windows (PowerShell):
POWERSHELL# No preflight script for Windows yet - check requirements manually
This checks Docker, memory, disk space, ports, and network connectivity.
Step 1: Download the Installation Files
Option A: One-line installer (Recommended)
Linux/macOS:
BASHcurl -fsSL https://raw.githubusercontent.com/your-org/contextdx/main/deploy/install.sh | bash
Windows (PowerShell):
POWERSHELLiwr -useb https://raw.githubusercontent.com/your-org/contextdx/main/deploy/install.ps1 | iex
This downloads all required files to ~/contextdx (or %USERPROFILE%\contextdx on Windows).
Option B: Manual download
BASH# Create installation directory mkdir contextdx && cd contextdx # Download required files curl -O https://raw.githubusercontent.com/your-org/contextdx/main/deploy/docker-compose.production.yml curl -O https://raw.githubusercontent.com/your-org/contextdx/main/deploy/nginx.conf curl -O https://raw.githubusercontent.com/your-org/contextdx/main/deploy/.env.template
Or copy from the provided package:
BASHcp -r /path/to/deploy/* ./
Step 2: Configure Environment
BASH# Create your configuration file cp .env.template .env # Edit with your credentials nano .env # or use your preferred editor
Step 3: Start the Platform
BASHdocker compose -f docker-compose.production.yml up -d
Step 4: Access the Application
Open your browser and navigate to:
http://localhost
Or if you configured a different port:
http://localhost:YOUR_PORT
Configuration
Required Configuration
Edit your .env file and set these required values:
Portal Credentials
Get these from your Portal dashboard at https://portal.contextdx.com:
- Log in to Portal
- Navigate to Dashboard → Deployments
- Select your deployment
- Copy the Deployment ID and Deployment Secret
BASH# .env file CDX_DEPLOYMENT_ID=your-deployment-id-here CDX_DEPLOYMENT_SECRET=your-deployment-secret-here
Database Password
Set a strong, unique password for the database:
BASH# .env file CDX_DATABASE_PASSWORD=YourSecurePassword123!
Security Note: Use a strong password with letters, numbers, and special characters. This password is stored locally and never transmitted to Portal.
Optional Configuration
Change the External Port
If port 80 is already in use:
BASH# .env file CDX_PORT=8080
Specify a Version
Pin to a specific version instead of latest:
BASH# .env file CDX_VERSION=1.2.3
AI Features (Optional)
If you want to use AI-powered features, add your API keys:
BASH# .env file OPENAI_API_KEY=sk-your-openai-key ANTHROPIC_API_KEY=sk-ant-your-anthropic-key
Database Tuning (Optional)
For high-load environments:
BASH# .env file CDX_DATABASE_MAX_CONNECTIONS=20 CDX_DATABASE_IDLE_TIMEOUT=60000
Complete Configuration Example
BASH# =========================================== # Required # =========================================== CDX_DEPLOYMENT_ID=dep_abc123xyz CDX_DEPLOYMENT_SECRET=secret_xyz789abc CDX_DATABASE_PASSWORD=MySecureP@ssw0rd! # =========================================== # Optional # =========================================== # CDX_PORT=80 # CDX_VERSION=latest # CDX_PORTAL_URL=https://portal.contextdx.com # AI Features (optional) # OPENAI_API_KEY=sk-... # ANTHROPIC_API_KEY=sk-ant-...
Starting the Platform
First Time Start
BASH# Pull the latest images and start docker compose -f docker-compose.production.yml up -d
This will:
- Download the Docker images (first time only)
- Create the database
- Start all services
- Run database migrations
View Startup Progress
BASH# Watch all logs docker compose -f docker-compose.production.yml logs -f # Watch specific service docker compose -f docker-compose.production.yml logs -f server
Check Service Status
BASHdocker compose -f docker-compose.production.yml ps
Expected output:
NAME STATUS PORTS
contextdx-proxy Up (healthy) 0.0.0.0:80->80/tcp
contextdx-web Up (healthy)
contextdx-server Up (healthy)
contextdx-postgres Up (healthy)
All services should show Up (healthy).
Accessing the Application
Web Interface
Open your browser and go to:
- Default:
http://localhost - Custom port:
http://localhost:YOUR_PORT - Custom domain:
http://your-domain.com
First Login
- Click Sign In
- You'll be redirected to Portal for authentication
- Log in with your Portal credentials
- You'll be redirected back to ContextDX
Verifying Installation
Automated Verification (Recommended)
Use the verification script to check all components:
Linux/macOS:
BASH# Download and run verification script curl -fsSL https://raw.githubusercontent.com/your-org/contextdx/main/deploy/verify.sh | bash # Or if you have the script locally ./verify.sh
Windows (PowerShell):
POWERSHELL# Download and run verification script .\verify.ps1
The verification script checks:
- Docker daemon status
- All containers running and healthy
- API health endpoint
- Platform status
- Web UI accessibility
- Database connectivity
- Portal connectivity
- Data volumes
Manual Health Checks
ContextDX provides multiple health check endpoints:
| Endpoint | Service | Purpose |
|---|---|---|
/nginx-health | nginx | Proxy health |
/health | server | Backend health |
/api/health | web | Frontend health |
BASH# Check backend server health curl http://localhost/health # Check frontend health curl http://localhost/api/health # Check nginx proxy health curl http://localhost/nginx-health
Expected response for /health:
JSON{"status":"ok"}
Detailed Status
BASHcurl http://localhost/api/status
This returns detailed information about:
- Database connectivity
- Portal connectivity
- File system access
- Platform version
Service Health
BASH# All services should be healthy docker compose -f docker-compose.production.yml ps
Upgrades
Check Current Version
BASHdocker compose -f docker-compose.production.yml images
Upgrade to Latest
BASH# Pull new images docker compose -f docker-compose.production.yml pull # Restart with new images docker compose -f docker-compose.production.yml up -d
Upgrade to Specific Version
BASH# Edit .env CDX_VERSION=1.3.0 # Apply upgrade docker compose -f docker-compose.production.yml pull docker compose -f docker-compose.production.yml up -d
Rollback
If something goes wrong:
BASH# Edit .env to previous version CDX_VERSION=1.2.0 # Rollback docker compose -f docker-compose.production.yml up -d
Stopping and Restarting
Stop All Services
BASHdocker compose -f docker-compose.production.yml down
Note: This stops containers but preserves data.
Restart All Services
BASHdocker compose -f docker-compose.production.yml restart
Restart Single Service
BASHdocker compose -f docker-compose.production.yml restart server
Complete Reset (Caution!)
Warning: This deletes ALL data including the database!
BASHdocker compose -f docker-compose.production.yml down -v
Getting Help
Logs for Support
When contacting support, include:
BASH# Save logs to file docker compose -f docker-compose.production.yml logs > contextdx-logs.txt 2>&1 # Include service status docker compose -f docker-compose.production.yml ps >> contextdx-logs.txt # Include configuration (without secrets!) grep -v SECRET .env | grep -v PASSWORD >> contextdx-logs.txt
Support Channels
- Documentation: https://docs.contextdx.com
- Portal Dashboard: https://portal.contextdx.com
- Email Support: support@contextdx.com
Helper Scripts Reference
| Script | Platform | Purpose |
|---|---|---|
preflight.sh | Linux/macOS | Check system requirements before installation |
install.sh | Linux/macOS | Download and set up all required files |
install.ps1 | Windows | Download and set up all required files |
verify.sh | Linux/macOS | Verify deployment is working correctly |
verify.ps1 | Windows | Verify deployment is working correctly |
Usage:
BASH# Pre-flight check (before install) curl -fsSL https://raw.githubusercontent.com/your-org/contextdx/main/deploy/preflight.sh | bash # Install (downloads files to ~/contextdx) curl -fsSL https://raw.githubusercontent.com/your-org/contextdx/main/deploy/install.sh | bash # Verify (after starting containers) ./verify.sh
Useful Commands Reference
| Command | Purpose |
|---|---|
docker compose -f docker-compose.production.yml up -d | Start all services |
docker compose -f docker-compose.production.yml down | Stop all services |
docker compose -f docker-compose.production.yml ps | Check status |
docker compose -f docker-compose.production.yml logs | View logs |
docker compose -f docker-compose.production.yml logs -f server | Follow server logs |
docker compose -f docker-compose.production.yml pull | Pull latest images |
docker compose -f docker-compose.production.yml restart | Restart all |
docker compose -f docker-compose.production.yml exec server sh | Shell into server |
Thank you for choosing ContextDX!