Skip to main content

Install on AWS Marketplace

Tyk offers a flexible and powerful API management solution through Tyk Cloud on the AWS Marketplace. Tyk Cloud is an end-to-end managed API platform where both the control plane and gateways are installed on AWS for a seamless, fully cloud-hosted experience. For those who need more deployment flexibility, Tyk Cloud also supports a Hybrid Gateway option. In this setup, the control plane remains hosted and managed by Tyk on AWS, while the gateways can be deployed on your preferred cloud provider or on-premises environment—allowing you to meet data locality and compliance needs without sacrificing control.

Available AWS Deployment Regions

You can deploy Tyk Cloud in the following AWS regions:
  • Singapore: aws-ap-southeast-1
  • Frankfurt, Germany: aws-eu-central-1
  • London, UK: aws-eu-west-2
  • N. Virginia, USA: aws-us-east-1
  • Oregon, USA: aws-us-west-2
  • Australia: aws-ap-southeast-2
Getting started with Tyk Cloud via the AWS Marketplace is quick and easy. Sign up today to access Tyk’s comprehensive API management tools designed to scale with your needs.

Install Tyk on AWS EC2

  1. Spin up an EC2 instance, AWS Linux2 preferably, T2.Medium is fine
    • add a public IP
    • open up SG access to:
      • 3000 for the Tyk Dashboard
      • 8080 for the Tyk Gateway
      • 22 TCP for SSH
  2. SSH into the instance ssh -i mykey.pem ec2-user@public-ec2-ip
  3. Install Git, Docker, & Docker Compose Feel free to copy paste these
  4. Clone the Tyk Pro Docker repo
  5. Add the license key to confs/tyk_analytics.conf into the license_key variable using “vi” or “nano”, etc
This is the most common place to have problems. Look for extra spaces between quotes ("") and the license key. It will not work if there are any. Inside tyk_analytics.conf, license_key should look something like this, with a real license however: "license_key": "eyJhbGciOiJSUzI1NiIsInR5cCI...WQ",
  1. Run the containers via docker-compose
  2. Visit
    and fill out the Bootstrap form! If you see any page besides the Bootstrap page, you have pasted the license key incorrectly
Enable SSL for the Gateway & Dashboard
  1. Add the following to confs/tyk.conf
  1. Add the following to confs/tyk_analytics.conf
  1. Generate self-signed Certs: (Or bring your own CA signed)
  1. Mount your certs to containers through docker-compose.yml
  1. Restart your containers with the mounted files
  1. Download the bootstrap script onto EC2 machine
  1. Apply execute permissions to file:
chmod +x bootstrap.sh
  1. Run the bootstrap script
./bootstrap.sh localhost
  1. Done! use the generated user and password to log into The Tyk Dashboard

Install with Ansible

RequirementsAnsible is required to run the following commands.
For a list of compatible operating systems and versions, please refer to the Linux documentation.

Instructions

  1. clone the tyk-ansible repositry
  2. cd into the directory
  3. Run initialisation script to initialise environment
  4. Modify hosts.yml file to update ssh variables to your server(s). You can learn more about the hosts file here
  5. Run ansible-playbook to install the following:
    • Redis
    • MongoDB or PostgreSQL
    • Tyk Dashboard
    • Tyk Gateway
    • Tyk Pump
    You can choose to not install Redis, MongoDB or PostgreSQL by removing the -t redis or -t mongodb or -t pgsql However Redis and MongoDB or PostgreSQL are a requirement and need to be installed for the Tyk Pro installation to run.
    For a production environment, we recommend that the Gateway, Dashboard and Pump are installed on separate machines. If installing multiple Gateways, you should install each on a separate machine. See Planning for Production For more details.
For a list available ansible variables and their descriptions, please refer to the ansible documentation

Install on Heroku

A full Tyk Self-Managed installation can be deployed to Heroku dynos and workers using Heroku Container Registry and Runtime functionality. This guide will utilize Tyk Docker images with a small amount of customization as well as an external MongoDB service.

Prerequisites

  1. Docker daemon installed and running locally
  2. Heroku account, the free plan is sufficient for a basic PoC but not recommended for production usage
  3. Heroku CLI installed
  4. MongoDB service (such as Atlas, mLab, or your own deployment), this guide is based on MongoDB Atlas but others should work as well
  5. Tyk License (note that in case of running multiple gateway dynos, license type must match)
  6. Checkout the Tyk quickstart repository from GitHub
  7. Python 2 or 3 in order to execute the bootstrap script

Creating Heroku Apps

We will create two Heroku apps, one for the Tyk Gateway (with Redis add-on attached to it) and another for the Dashboard and Pump. Given Heroku CLI is installed and your Heroku account is available, log into it:
Now create the Gateway app and note down its name:
--space flag must be added to the command if the app is being created in a private space, see more details in the section on Heroku private spaces (below).
Provision a Redis add-on (we’ll use a hobby-dev plan for demonstration purposes but that’s not suitable for production), replacing the app name with your own:
Once add-on provisioning is done, the info command (replacing the add-on name with your own) will show the following output:
Time to create the Dashboard app and note down its name as well:
Since the Dashboard and Pump need access to the same Redis instance as the gateway, we’ll need to share the Gateway app’s add-on with this new app:
To check that both apps have access to the same Redis add-on, we can utilize the heroku config command and check for the Redis endpoint:
Their outputs should match.

Deploy the Dashboard

It’s recommended to start with the Dashboard so in your Heroku quickstart clone run:
You will find it contains a Dockerfile.web for the web dyno, a config file for the Dashboard, entrypoint script for the Docker container and a bootstrap script for seeding the dashboard instance with sample data. All these files are editable for your purposes but have sane defaults for a PoC.
You can use the FROM statement in Dockerfile.web to use specific dashboard version and upgrade when needed instead of relying on the latest tag.
The Dashboard configuration can be changed by either editing the tyk_analytics.conf file or injecting them as environment variables via heroku config. In this guide we’ll use the latter for simplicity of demonstration but there is merit to both methods. First let’s set the license key:
Now the MongoDB endpoint (replacing with your actual endpoint):
And enable SSL for it if your service supports/requires this:
Since the Tyk Dashboard needs to access gateways sometimes, we’ll need to specify the Gateway endpoint too, which is the Gateway app’s URL:
This is enough for a basic Dashboard setup but we recommend also changing at least node and admin secrets with strong random values, as well as exploring other config options. Since the Tyk Pump is also a part of this application (as a worker process), we’ll need to configure it too.
Same principles apply here as well. Here we’ll need to configure MongoDB endpoints for all the Pumps (this can also be done in the pump.conf file):
With the configuration in place it’s finally time to deploy our app to Heroku. First, make sure CLI is logged in to Heroku containers registry:
Provided you’re currently in analytics directory of the quickstart repo:
This has built Docker images for both dashboard and pump, as well as pushed them to Heroku registry and automatically deployed to the application. Provided everything went well (and if not, inspect the application logs), you should be seeing the Dashboard login page at your app URL (e.g “https://evening-beach-40625.herokuapp.com/”). However, it doesn’t yet have any accounts. It order to populate it please run the dashboard/bootstrap.sh script:
It will generate a default organization with random admin username and a specified password. The bootstrap script can be edited to suit your needs as well as just editing the user info in the dashboard. If this was successful, you should be able to log into your dashboard now. The last step in this app is to start the Pump worker dyno since by default only the web dyno is enabled:
At that point the dyno formation should look like this:

Deploy the Gateway

The process is very similar for the Tyk Gateway, except it doesn’t have a worker process and doesn’t need access to MongoDB.
All these files serve the same purpose as with the Dasboard and the Pump. Configuration can either be edited in tyk.conf or injected with heroku config. To get things going we’ll need to set following options for the Dashboard endpoint (substituting the actual endpoint and the app name, now for the gateway app):
Since the Redis configuration will be automatically discovered (it’s already injected by Heroku), we’re ready to deploy:
Inspect the logs (heroku logs -a infinite-plains-14949) to check that deployment was successful, also the node should be registered by the Dashboard in “System Management” -> “Nodes and Licenses” section. You’re ready to follow the guide on creating and managing your APIs with this Heroku deployment.
To use the geographic log distribution feature in the Dashboard please supply the GeoLite2 DB in the gateway directory, uncomment the marked line in Dockerfile.web and set the analytics_config.enable_geo_ip setting (or TYK_GW_ANALYTICSCONFIG_ENABLEGEOIP env var) to true.

Heroku Private Spaces

Most instructions are valid for Heroku Private Spaces runtime. However there are several differences to keep in mind. Heroku app creation commands must include the private space name in the --space flag, e.g.:
When deploying to the app, the container must be released manually after pushing the image to the app:
Similarly, the Gateway:
Please allow several minutes for the first deployment to start as additional infrastructure is being created for it. Next deployments are faster. Private spaces maintain stable set of IPs that can be used for allowing fixed set of IPs on your upstream side (e.g. on an external database service). Find them using the following command:
Alternatively VPC peering can be used with the private spaces if external service supports it. This way exposure to external network can be avoided. For instance, see MongoDB Atlas guide for setting this up. The minimal Heroku Redis add-on plan that installs into your private space is currently private-7. Please refer to Heroku’s Redis with private spaces guide for more information. Apps in private spaces don’t enable SSL/TLS by default. It needs to be configured in the app settings along with the domain name for it. If it’s not enabled, please make sure that configs that refer to corresponding hosts are using HTTP instead of HTTPS and related ports (80 for HTTP).

Gateway Plugins

In order to enable rich plugins for the Gateway, please set the following Heroku config option to either python or lua depending on the type of plugins used:
After re-starting the Gateway, the logs should be showing something similar to this:
Set this variable back to an empty value in order to revert back to the default behavior.

Upgrading or Customizing Tyk

Since this deployment is based on Docker images and containers, upgrading or making changes to the deployment is as easy as building a new image and pushing it to the registry. Specifically, upgrading version of any Tyk components is done by editing the corresponding Dockerfile and replacing the base image version tag. E.g. changing FROM tykio/tyk-gateway:v2.5.4 to FROM tykio/tyk-gateway:v2.6.1 will pull the Tyk gateway 2.6.1. We highly recommend specifying concrete version tags instead of latest for better house keeping. Once these changes have been made just run heroku container:push --recursive -a app_name on the corresponding directory as shown previously in this guide. This will do all the building and pushing as well as gracefully deploying on your Heroku app. Please refer to Heroku documentation on containers and registry for more information.

Install on Microsoft Azure

Azure allows you to install Tyk in the following ways: On-Premises
  1. Via our Ubuntu Setup on an installed Ubuntu Server on Azure.
  2. Via our Docker Installation using Azure’s Docker support.
See our video for installing Tyk on Ubuntu via Azure:
We also have a blog post that walks you through installing Tyk on Azure.

Install to Google Cloud

Google Cloud allows you to install Tyk in the following ways: On-Premises
  1. Via our Ubuntu Setup on an installed Ubuntu Server within Google Cloud.
  2. Via our Docker Installation using Google Cloud’s Docker support.
Tyk Pump on GCP When running Tyk Pump in GCP using Cloud Run it is available 24/7. However, since it is serverless you also need to ensure that the CPU always allocated option is configured to ensure availability of the analytics. Otherwise, for each request there will be a lag between the Tyk Pump container starting up and having the CPU allocated. Subsequently, the analytics would only be available during this time.
  1. Configure Cloud Run to have the CPU always allocated option enabled. Otherwise, the Tyk Pump container needs to warm up, which takes approximately 1 min. Subsequently, by this time the stats are removed from Redis.
  2. Update the Tyk Gateway configuration to keep the stats for 3 mins to allow Tyk Pump to process them. This value should be greater than the Pump purge delay to ensure the analytics data exists long enough in Redis to be processed by the Pump.