Skip to main content

Availability

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.

Prerequisites

  • Docker Engine 20.10+ and Docker Compose v2
  • At least 4 GB RAM available
  • A Tyk AI License key (contact support@tyk.io or your account manager to obtain)
Running on Podman, containerd, or another container runtime? See Container Runtimes.

Generate Secrets

Before starting, generate the required secret keys. These will be used in the configuration files to secure communication and encrypt data:
Save these values — you will need them for both the AI Studio and Edge Gateway configuration files.

Instructions

1. Create Directory Structure

Create a new directory for your project and set up the required folders:

2. Create compose.yaml

Create a compose.yaml file with the following content. This configuration sets up AI Studio, the Edge Gateway, and a PostgreSQL database.
Expandable

3. Create confs/studio.env

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

4. Create confs/microgateway.env

Create the Edge Gateway configuration file. Ensure the security tokens match the ones used in studio.env.
Expandable

5. Create confs/analytics-pulse.yaml

This configures the Edge Gateway to send analytics data back to the AI Studio control plane:
Expandable

6. Start Services

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.
Start the services using Docker Compose:

7. Verify

Check that all services are running correctly:

Accessing the Portal

Once the services are running, you can access the different components:
  • AI Studio UI: http://localhost:8080
  • Embedded Gateway: http://localhost:9090
  • Edge Gateway: http://localhost:9091

First User Registration

After starting the service, you need to create your first admin user:
  1. Access the application: Open your browser and navigate to http://localhost:8080
  2. Register with admin email: Use the EXACT email address you set in the ADMIN_EMAIL environment variable in studio.env.
  3. 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.

Shared Secrets Reference

These values must match between the AI Studio and Edge Gateway configuration files:

Port Reference

Using an External Database

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:

Upgrading

To upgrade to a newer version:

Troubleshooting

Check the logs for specific services:
  • Verify CONTROL_ENDPOINT in microgateway.env matches the AI Studio service name and gRPC port (e.g., tyk-ai-studio:50051)
  • Verify EDGE_AUTH_TOKEN matches GRPC_AUTH_TOKEN
  • Verify ENCRYPTION_KEY matches MICROGATEWAY_ENCRYPTION_KEY
  • Check that GATEWAY_MODE=control is set in studio.env
  • 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
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:
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.
If ports 8080, 9090, or 9091 are already in use, change the left-hand side of the port mapping in compose.yaml:
Then update SITE_URL in studio.env accordingly.