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.The Edge Gateway’s image, binary, and directory names use the older name
microgateway or the abbreviation mgw (for example the tykio/tyk-microgateway-ent image and the mgw-data/mgw-plugins directories below). This guide uses “Edge Gateway” in prose for the same component.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: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.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 you start the services, create the first user:- Open
http://localhost:8080in your browser. - Select Sign up, then enter a name, an email address, and a password.
- Log in with the new account.
The first user who registers becomes the administrator. You can use any email address. Other users must verify their email address before they can log in, so configure SMTP before you invite them. AI Studio ignores the deprecated
ADMIN_EMAIL variable.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 thepostgres service and pgdata volume from compose.yaml, then update studio.env:
Upgrading
To upgrade to a newer version:Troubleshooting
Services fail to start
Services fail to start
Check the logs for specific services:
Edge Gateway restarts on first start
Edge Gateway restarts on first start
On the first start, the Edge Gateway can start before the AI Studio gRPC server is ready. The Edge Gateway then logs
Failed to connect to control server and restarts. This is normal. The restart: always policy restarts it until the connection succeeds. Check that all services show Up:Edge Gateway cannot connect to AI Studio
Edge Gateway cannot connect to AI Studio
- Verify
CONTROL_ENDPOINTinmicrogateway.envmatches the AI Studio service name and gRPC port (e.g.,tyk-ai-studio:50051) - Verify
EDGE_AUTH_TOKENmatchesGRPC_AUTH_TOKEN - Verify
ENCRYPTION_KEYmatchesMICROGATEWAY_ENCRYPTION_KEY - Check that
GATEWAY_MODE=controlis set instudio.env
Database connection errors
Database connection errors
- Ensure the
postgrescontainer is healthy:docker compose ps - Verify
DATABASE_URLcredentials match thePOSTGRES_USER/POSTGRES_PASSWORDincompose.yaml - For external databases, verify network connectivity and SSL mode
Marketplace page is empty
Marketplace page is empty
The Plugin Marketplace requires Restart AI Studio after making this change.The marketplace is enabled by default (
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:MARKETPLACE_ENABLED=true), but it will not function without the OCI cache directory configured.Port conflicts
Port conflicts
If ports 8080, 9090, or 9091 are already in use, change the left-hand side of the port mapping in Then update
compose.yaml:SITE_URL in studio.env accordingly.