This guide focuses on the Enterprise Edition of Tyk AI Studio. For the Community Edition, please refer to the Tyk AI Studio GitHub repository.The Community Edition uses different Docker images (tykio/tyk-ai-studio and tykio/tyk-microgateway) and does not require a license key.
This guide covers deploying Tyk AI Studio with a Edge Gateway using Docker Compose. In this architecture, AI Studio acts as the control plane (hub) and the Edge Gateway acts as the data plane (spoke), receiving configuration via gRPC.
Create the AI Studio configuration file. Replace the CHANGE-ME values with the secrets you generated earlier, and add your Tyk AI License key.
Expandable
Copy
Ask AI
# =============================================================================# Core Settings# =============================================================================DEVMODE=true # Set to false when using HTTPS; required for login over plain HTTPALLOW_REGISTRATIONS=trueSITE_URL=http://localhost:8080ADMIN_EMAIL=admin@example.comFROM_EMAIL=noreply@example.com# =============================================================================# Database# =============================================================================DATABASE_TYPE=postgresDATABASE_URL=postgresql://tyk:your-db-password@postgres:5432/tyk_ai_studio?sslmode=disable# =============================================================================# Security — CHANGE THESE (use values from "Generate Secrets" above)# =============================================================================TYK_AI_SECRET_KEY=CHANGE-ME-generate-with-openssl-rand-hex-16MICROGATEWAY_ENCRYPTION_KEY=CHANGE-ME-generate-with-openssl-rand-hex-16# =============================================================================# Hub-Spoke: Control Plane Mode# =============================================================================GATEWAY_MODE=controlGRPC_PORT=50051GRPC_HOST=0.0.0.0GRPC_TLS_INSECURE=trueGRPC_AUTH_TOKEN=CHANGE-ME-generate-with-openssl-rand-hex-16# =============================================================================# Proxy — Point to external Edge Gateway URL# =============================================================================PROXY_URL=http://localhost:9091TOOL_DISPLAY_URL=http://localhost:9091DATASOURCE_DISPLAY_URL=http://localhost:9091# =============================================================================# Logging# =============================================================================LOG_LEVEL=info# =============================================================================# Enterprise Edition — REQUIRED for EE images, must be set before first start# =============================================================================TYK_AI_LICENSE=your-license-key# =============================================================================# Plugin Marketplace (Optional — enables browsing and installing plugins)# =============================================================================# AI_STUDIO_OCI_CACHE_DIR must be set to enable the marketplace.# Without it, the Marketplace page will be empty.AI_STUDIO_OCI_CACHE_DIR=./data/cache/pluginsAI_STUDIO_OCI_REQUIRE_SIGNATURE=false # cosign not available in distroless images# =============================================================================# SMTP (Optional — required for email invites/notifications)# =============================================================================# SMTP_SERVER=smtp.example.com# SMTP_PORT=587# SMTP_USER=apikey# SMTP_PASS=your-smtp-password
Create the Edge Gateway configuration file. Ensure the security tokens match the ones used in studio.env.
Expandable
Copy
Ask AI
# =============================================================================# Server Configuration# =============================================================================PORT=8080HOST=0.0.0.0READ_TIMEOUT=300sWRITE_TIMEOUT=300sSHUTDOWN_TIMEOUT=30s# =============================================================================# Database (SQLite — default for edge deployments)# =============================================================================DATABASE_TYPE=sqliteDATABASE_DSN=file:./data/edge.db?cache=shared&mode=rwcDB_AUTO_MIGRATE=true# =============================================================================# Hub-Spoke: Edge Mode# =============================================================================GATEWAY_MODE=edgeCONTROL_ENDPOINT=tyk-ai-studio:50051EDGE_ID=edge-1EDGE_NAMESPACE=defaultEDGE_HEARTBEAT_INTERVAL=30sEDGE_ALLOW_INSECURE=trueEDGE_TLS_ENABLED=false# =============================================================================# Security — MUST MATCH AI Studio values# =============================================================================EDGE_AUTH_TOKEN=CHANGE-ME-must-match-studio-GRPC_AUTH_TOKENENCRYPTION_KEY=CHANGE-ME-must-match-studio-MICROGATEWAY_ENCRYPTION_KEY# =============================================================================# Gateway# =============================================================================GATEWAY_TIMEOUT=300sGATEWAY_ENABLE_FILTERS=trueGATEWAY_ENABLE_ANALYTICS=true# =============================================================================# Analytics# =============================================================================ANALYTICS_ENABLED=trueANALYTICS_BUFFER_SIZE=1000ANALYTICS_FLUSH_INTERVAL=10sANALYTICS_RETENTION_DAYS=90# =============================================================================# Analytics Pulse Plugin (sends data to control plane)# =============================================================================PLUGINS_CONFIG_PATH=/opt/tyk-microgateway/analytics-pulse.yaml# =============================================================================# Cache# =============================================================================CACHE_ENABLED=trueCACHE_TTL=1h# =============================================================================# Logging# =============================================================================LOG_LEVEL=info# =============================================================================# OCI Plugin Support# =============================================================================OCI_PLUGINS_CACHE_DIR=/var/lib/microgateway/pluginsOCI_PLUGINS_REQUIRE_SIGNATURE=false # cosign not available in distroless images# =============================================================================# Enterprise Edition — REQUIRED for EE images, must be set before first start# =============================================================================TYK_AI_LICENSE=your-license-key
Important: Make sure all configuration files (studio.env, microgateway.env, analytics-pulse.yaml) exist before running docker compose up. If a file-mounted volume target does not exist, Docker will create it as a directory, causing errors.
# Check all services are runningdocker compose ps# Check AI Studio is respondingcurl -s http://localhost:8080/health# Check Edge Gateway is respondingcurl -s http://localhost:9091/health# Check AI Studio logs for successful edge connectiondocker compose logs tyk-ai-studio | grep -i "edge\|grpc"
After starting the service, you need to create your first admin user:
Access the application: Open your browser and navigate to http://localhost:8080
Register with admin email: Use the EXACT email address you set in the ADMIN_EMAIL environment variable in studio.env.
Complete registration: The first user who registers with the admin email will automatically become the administrator.
Important: The first user registration must use the same email address specified in the ADMIN_EMAIL environment variable. This user will have full administrative privileges.
To use an existing PostgreSQL instance instead of the bundled container, remove the postgres service and pgdata volume from compose.yaml, then update studio.env:
Check that GATEWAY_MODE=control is set in studio.env
Database connection errors
Ensure the postgres container is healthy: docker compose ps
Verify DATABASE_URL credentials match the POSTGRES_USER / POSTGRES_PASSWORD in compose.yaml
For external databases, verify network connectivity and SSL mode
Marketplace page is empty
The Plugin Marketplace requires AI_STUDIO_OCI_CACHE_DIR to be set. Without it, the marketplace service does not start and no plugins will appear. Add this to your studio.env:
Copy
Ask AI
AI_STUDIO_OCI_CACHE_DIR=./data/cache/plugins
Restart AI Studio after making this change.The marketplace is enabled by default (MARKETPLACE_ENABLED=true), but it will not function without the OCI cache directory configured.
Port conflicts
If ports 8080, 9090, or 9091 are already in use, change the left-hand side of the port mapping in compose.yaml:
Copy
Ask AI
ports: - "8585:8080" # Map to 8585 instead of 8080