Debian / Ubuntu
Requirements
- Ansible is required to run the following commands. Instructions on how install Tyk CE with shell is in the Shell tab.
- Ensure port
8080
is open: this is used in this guide for Gateway traffic (the API traffic to be proxied).
Getting Started
- clone the tyk-ansible repositry
$ git clone https://github.com/TykTechnologies/tyk-ansible
cd
into the directory
$ cd tyk-ansible
- Run initalization script to initialize environment
$ sh scripts/init.sh
-
Modify
hosts.yml
file to update ssh variables to your server(s). You can learn more about the hosts file here -
Run ansible-playbook to install
tyk-ce
$ ansible-playbook playbook.yml -t tyk-ce -t redis
You can choose to not install Redis by removing the -t redis
. However Redis is a requirment and needs to be installed for the gateway to run.
Supported Distributions
Distribution | Version | Supported |
---|---|---|
Debian | 10 | ✅ |
Debian | 9 | ✅ |
Debian | 8 | ❌ |
Ubuntu | 20 | ✅ |
Ubuntu | 18 | ✅ |
Ubuntu | 16 | ✅ |
Ubuntu | 14 | ❌ |
Requirements
- Ensure port
8080
is open: this is used in this guide for Gateway traffic (the API traffic to be proxied).
Install Redis
sudo apt-get install -y redis-server
Installation
First import the public key as required by Ubuntu APT
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
Run Installation Scripts via our PackageCloud Repositories
From https://packagecloud.io/tyk/tyk-gateway you have the following options:
-
Via the correct package for your Ubuntu version. We have packages for the following:
-
Xenial
-
Trusty
-
Precise
-
Via Quick Installation Instructions. You can use:
Configuring The Gateway
You can set up the core settings for the Tyk Gateway with a single setup script, however for more involved deployments, you will want to provide your own configuration file.
Note
You need to replace <hostname>
for --redishost=<hostname>
with your own value to run this script.
sudo /opt/tyk-gateway/install/setup.sh --listenport=8080 --redishost=<hostname> --redisport=6379 --domain=""
What you’ve done here is told the setup script that:
--listenport=8080
: Listen on port8080
for API traffic.--redishost=<hostname>
: The hostname for Redis.--redisport=6379
: Use port6379
for Redis.--domain=""
: Do not filter domains for the Gateway, see the note on domains below for more about this.
In this example, you don’t want Tyk to listen on a single domain. It is recommended to leave the Tyk Gateway domain unbounded for flexibility and ease of deployment.
Starting Tyk
The Tyk Gateway can be started now that it is configured. Use this command to start the Tyk Gateway:
sudo service tyk-gateway start
Next Steps Tutorials
Follow the Tutorials on the Community Edition tabs for the following: