Skip to main content

On VM Deployment Architecture

This page describes the infrastructure and application architecture of CodeMie On VM.

Infrastructure Overview

CodeMie On VM runs on a single EC2 instance with supporting AWS services. Terraform provisions the following resources depending on the network mode:

Direct access to the EC2 instance via Elastic IP:

IP Mode Diagram

AWS Resources

ResourcePurpose
VPCIsolated network with public subnets (+ private if private_ip_only)
EC2 InstanceSingle instance running Docker Compose (Ubuntu, r5.xlarge default)
Elastic IPStatic public IP for the EC2 instance
S3 BucketPersistent storage for user data (repos, files)
KMS KeyEncryption key for S3 data at rest
ALBApplication Load Balancer with TLS (if domain configured)
ACM CertificateTrusted TLS certificate for the domain (if domain configured)
Route 53 RecordDNS A record pointing to ALB (if domain configured)
SSM ParameterStores EC2 SSH private key securely
Security GroupsControls inbound traffic to ALB and EC2
IAM Instance ProfileGrants EC2 access to Bedrock, S3, KMS, SSM

Network Modes

ModeConfigurationAccess
Public IP (default)TF_VAR_private_ip_only=falseEC2 gets EIP, direct HTTPS access
Domain + ALBTF_VAR_platform_domain_name="example.com"ALB with ACM cert, Route 53 DNS
Private IPTF_VAR_private_ip_only=trueNo public IP, access via VPN only

Application Architecture

All CodeMie services run as Docker containers on the EC2 instance, orchestrated by Docker Compose.

Docker Compose Services

Services by Profile

Shared services (both profiles):

ServiceImagePurpose
postgrespgvector/pgvector:pg17Primary database for application data
elasticsearchelasticsearch:8.xDocument storage and search for Data Sources
kibanakibana:8.xLog visualization and analytics for Elasticsearch
mcp-connectcodemie-mcp-connect-serviceConnector for MCP servers
nginxnginx:1.31-alpineReverse proxy, TLS termination

OSS profile:

ServicePurpose
codemie-ossAPI server with built-in local authentication
codemie-ui-ossWeb frontend

Enterprise profile:

ServicePurpose
codemieAPI server
codemie-uiWeb frontend
keycloakIdentity provider (SSO, OIDC)
oauth2-proxyAuthentication proxy in front of nginx
litellmLLM proxy for model routing and key management
natsMessaging for plugin engine
nats-auth-calloutNATS authentication service
mermaid-serverDiagram rendering

Resource Requirements

Minimum EC2 Instance

ResourceMinimumRecommended
vCPU44 (r5.xlarge)
RAM16 GB32 GB
Disk50 GB100 GB (gp3)

Next Steps

  • Deployment — Deploy CodeMie On VM with Terraform