Upgrading Tyk Open Source
Last updated: 3 minutes read.
The following guide explains how to upgrade Tyk Gateway when using Docker. For guides of other installation types check the “Self-manged” section, and look for the instruction regarding Tyk Gateway.
Before proceeding with the upgrade process, ensure that you have thoroughly reviewed and completed the steps outlined in the pre-upgrade guidelines. Once you have adequately prepared, follow the instructions below to upgrade your Tyk components and plugins in this specified order. Adhering to the provided sequence is crucial for a smooth and successful upgrade.
Upgrade order
In a production environment, where we recommend installing the Dashboard, Gateway, and Pump on separate machines, you should upgrade components in the following sequence:
- Tyk Gateway
- Tyk Pump
1. Upgrade Tyk Gateway
Development Environment Upgrade
In a development environment where you can simply restart your gateways, follow these steps:
- Backup your gateway config file (
tyk.conf
or the name you chose for it) - Update the image version in the docker command or script
- Restart the gateway. For example, update the following command to
v5.1
and run it as follows:
$ docker run \
--name tyk_gateway \
--network tyk \
-p 8080:8080 \
-v $(pwd)/tyk.standalone.conf:/opt/tyk-gateway/tyk.conf \
-v $(pwd)/apps:/opt/tyk-gateway/apps \
docker.tyk.io/tyk-gateway/tyk-gateway:v5.3
For full installation details, check the usual installation page.
Docker compose upgrade in a simple environment
For non-production environments where brief downtime is acceptable, you can upgrade by simply restarting your gateways. Follow these steps:
- Backup your gateway config file (
tyk.conf
or the name you chose for it) - Update the image version in the
docker-compose.yaml
file.
For example, Tyk Gateway version4.3.3
is defined in this docker-compose.yamlimage: docker.tyk.io/tyk-gateway/tyk-gateway:v4.3.3
. Change4.3.3
to the version you want to use. - Restart the gateway (or stop and start it)
$ docker compose restart
- Check the log to see that the new version is used and if the gateway is up and running
- Check that the gateway is healthy
$ curl localhost:8080/hello | jq .
{
"status": "pass",
"version": "5.3.0",
"description": "Tyk GW",
"details": {
"redis": {
"status": "pass",
"componentType": "datastore",
"time": "2023-07-17T21:07:27Z"
}
}
}
Production Environment Upgrade
- Backup your Gateway config file
- Use Docker’s best practices for a rolling update
- Review and complete the steps outlined in the pre-upgrade guidelines.
- Define the version in your setup script (for example in
.env
file). The new image will be pulled once it’s executed. If your script is doingdocker pull
, update the version of the gateway in that command to the target version. - Check the log to see that the new version is used and if the gateway is up and running
- Check that the Gateway is healthy using the open /hello API ( run
curl localhost:8080/hello | jq .
)
2. Upgrade Tyk Pump
Docker Instructions for upgrading Tyk Pump is the same as the above for Tyk Gateway just with
the name of the docker image of Tyk Pump tykio/tyk-pump-docker-pub