Tyk has it’s own APT repositories hosted by the kind folks at packagecloud.io, which makes it easy, safe and secure to install a trusted distribution of the Tyk Gateway stack.
This tutorial will run on an Amazon AWS Ubuntu Server 14.04 LTS instance. We will install the Tyk Gateway with all dependencies stored locally.
We’re installing on a
t2.micro because this is a tutorial, you’ll need more RAM and more cores for better performance.
- Ensure port
8080is open: this is used in this guide for Gateway traffic (API traffic to be proxied)
Step 1: Set up our APT repositories
First, add our GPG key which signs our binaries:
curl https://packagecloud.io/gpg.key | sudo apt-key add -
sudo apt-get update
Since our repositories are installed via HTTPS, you will need to make sure APT supports this:
sudo apt-get install -y apt-transport-https
Now lets add the required repos and update again (notice the
-a flag in the second Tyk commands – this is important!):
echo "deb https://packagecloud.io/tyk/tyk-gateway/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/tyk_tyk-gateway.list echo "deb-src https://packagecloud.io/tyk/tyk-gateway/ubuntu/ trusty main" | sudo tee -a /etc/apt/sources.list.d/tyk_tyk-gateway.list sudo apt-get update
What we’ve done here is:
- Added the Tyk Gateway repository
- Updated our package list
Step 2: Install the Tyk Gateway
We’re now ready to install Tyk Gateway and Tyk Dashboard, along with all the main dependencies: Redis and MongoDB. To install everything run:
sudo apt-get install -y redis-server tyk-gateway
What we’ve done here is instructed apt-get to install Redis and the Tyk Gateway without prompting, wait for the downloads to complete.
When Tyk is finished installing, it will have installed some init scripts, but it will not be running yet. The next step will be to setup the Gateway – thankfully this can be done with three very simple commands, however it does depend on whether you are configuring Tyk Gateway for use with the Dashboard or without (Community Edition).