First of all, you need to know that Tyk it's divided in three different components:

Now, we'll guide you on how to setup your the Tyk Suite in your local environment.


The Tyk Gateway requires RedisDB in order to run, so that's our first step. Fortunately, it will ship with most Ubuntu In-Release versions (For any special installations please refer to the official RedisDB documentation):

sudo apt-get update && sudo apt-get install -y redis-server

Once that's done, the dashboard and the pump both rely on MongoDB as their persistence solution. And to install Mongo we'll need the public key to their repositories on our system:

sudo apt-key adv --keyserver hkp:// --recv 0C49F3730359A14518585931BC711F9BA15703C6

Now we need to set the repositories depending on our Ubuntu In-Release version(For any special installations please refer to the official MongoDB documentation):

echo "deb [ arch=amd64 ] precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
echo "deb [ arch=amd64 ] trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
echo "deb [ arch=amd64,arm64 ] xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

And finally we are really to install Mongo, so let's run the following commands to update our repositories, download and install Mongo:

sudo apt-get update && sudo apt-get install -y mongodb-org

On to Tyk Installation

An important remark to make about the Tyk Suite is the fact that the Dashboard and the Pump components of the suite are behind a pay wall (A free license is available). Nevertheless, the core functionality is implemented on the Gateway and the Dashboard is just to ease the final user with GUI and the Pump to get analytics going.

With that out of the way, will need to setup the repository key and select the right version for our system; but for our ease will be using a script that will add the key and detect our operating system (if it fails, it will mean that our OS is not supported so please refer to the official Tyk documentation):

curl -s | sudo bash
curl -s | sudo bash
curl -s | sudo bash

Now that our repositories are setup correctly, we'll need to install every component:

sudo apt-get install -y tyk-gateway
sudo apt-get install -y tyk-dashboard
sudo apt-get install -y tyk-pump

And finally everything it's installed on our system, but of course we aren't done over here. We are missing configurations and starting each service. Since we are gonna need MongoDB and RedisDB services for our Tyk suite make sure they're running:

sudo service mongod start
sudo service redis-server start

Lets start with the Dashboard, because the Gateway is capable of detecting the dashboard, so it's important to install the Dashboard first:

sudo /opt/tyk-dashboard/install/ --listenport=3000 --redishost=localhost --redisport=6379 --mongo=mongodb:// --tyk_api_hostname=$HOSTNAME --tyk_node_hostname=http://localhost --tyk_node_port=8080 --portal_root=/portal --domain="XXX.XXX.XXX.XXX"

And finally proceed to start the service:

sudo service tyk-dashboard start

Next is the Pump:

sudo /opt/tyk-pump/install/ --redishost=localhost --redisport=6379 --mongo=mongodb://
sudo service tyk-pump start

And finally the core part, the Gateway:

sudo /opt/tyk-gateway/install/ --dashboard=1 --listenport=8080 --redishost=localhost --redisport=6379
sudo service tyk-gateway start

And everything should be ready to start setting up your API's and everything!