This example uses Tyk , an API gateway and management platform.
Tyk is used together with Redis to store API tokens and OAuth clients.
To run this example, follow these steps:
Install the CLI.
Use the unikraft CLI or the legacy kraft CLI .
You need a BuildKit builder. The easiest way to get one is via Docker .
Alternatively, you can also directly set up and use BuildKit, see the quick start .
The unikraft CLI is the current standard, while kraft is the legacy version.
Choose one of the CLIs below and only run the commands associated with it for the rest of this guide.
Clone the examples repository and cd into the examples/tyk/ directory:
git clone https://github.com/unikraft-cloud/examples
cd examples/tyk/
Make sure to log into Unikraft Cloud and pick a metro close to you.
This guide uses fra (Frankfurt, 🇩🇪):
Build and deploy the Redis instance (used internally by Tyk):
The REDIS_PASSWORD environment variable sets the Redis requirepass directive.
If not provided, it defaults to unikraft.
unikraft build ./redis --output < my-or g > /redis:latest
unikraft run --scale-to-zero policy=idle,cooldown-time=1000,stateful= true --metro fra -m 256M --image < my-or g > /redis:latest --domain tyk-redis.internal -e REDIS_PASSWORD=unikraft
Make sure to replace <my-org> with your username / org-name in the unikraft CLI commands above.
The output shows the Redis instance details:
metro: fra
name: redis-6vgvc
uuid: 63b86d17-06ca-4f95-b921-56e5b3245554
state: starting
image: <my-org>/redis
resources:
memory: 256MiB
vcpus: 1
service:
name: snowy-water-wivk1i4r
uuid: 6612de91-d639-4b5a-95d1-b7ae6e91e3c1
domains:
- fqdn: tyk-redis.internal
networks:
- uuid: 19e4b80a-9501-448d-99a6-ec3f7b90805e
private-ip: 10.0.0.29
mac: 12:b0:0a:00:01:49
timestamps:
created: just now
scale-to-zero:
enabled: true
policy: idle
stateful: true
cooldown-time: 1s
or
kraft cloud deploy --scale-to-zero idle --scale-to-zero-stateful --scale-to-zero-cooldown 1s -M 256Mi --domain tyk-redis.internal --env REDIS_PASSWORD=unikraft ./redis/
The output shows the Redis instance details:
[ ● ] Deployed successfully!
│
├ ─ ─ ─ ─ ─ ─ ─ ─ ─ name : redis-6vgvc
├ ─ ─ ─ ─ ─ ─ ─ ─ ─ uuid : 63b86d17-06ca-4f95-b921-56e5b3245554
├ ─ ─ ─ ─ ─ ─ ─ ─ metro : https://api.fra.unikraft.cloud/v1
├ ─ ─ ─ ─ ─ ─ ─ ─ state : starting
├ ─ ─ ─ ─ ─ ─ ─ domain : tyk-redis.internal
├ ─ ─ ─ ─ ─ ─ ─ ─ image : oci://unikraft.io/<my-org>/redis@sha256:933b8b7714924eb2de880e0f32792698b14a13c83d5aee0f52dddcab5c97099d
├ ─ ─ ─ ─ ─ ─ ─ memory : 256 MiB
├ ─ ─ ─ ─ ─ ─ service : snowy-water-wivk1i4r
├ ─ private fqdn : redis-6vgvc.internal
└ ─ ─ ─ private ip : 10.0.0.29
Build and deploy the Tyk instance:
unikraft build ./tyk --output < my-or g > /tyk:latest
unikraft run --scale-to-zero policy=on,cooldown-time= 1000 --metro fra -p 443:8080/tls+http -m 256M --image < my-or g > /tyk:latest
Make sure to replace <my-org> with your username / org-name in the unikraft CLI commands above.
The output shows the Tyk instance details:
metro: fra
name: tyk-s9ixd
uuid: 4e8a5e56-2d0b-4ca4-88b4-aa816129a66d
state: starting
image: <my-org>/tyk
resources:
memory: 256MiB
vcpus: 1
service:
name: icy-haze-8ph4u8cz
uuid: 89079646-353a-4a19-99ac-5498c7d626ad
domains:
- fqdn: icy-haze-8ph4u8cz.fra.unikraft.app
networks:
- uuid: 8085804f-0fe0-4847-ad6e-8518edba126e
private-ip: 10.0.0.1
mac: 12:b0:0a:00:0e:b1
timestamps:
created: just now
or
kraft cloud deploy --scale-to-zero on --scale-to-zero-cooldown 1s -p 443:8080/tls+http -M 256Mi ./tyk/
The output shows the Tyk instance details:
[ ● ] Deployed successfully!
│
├ ─ ─ ─ ─ ─ ─ ─ ─ ─ name : tyk-s9ixd
├ ─ ─ ─ ─ ─ ─ ─ ─ ─ uuid : 4e8a5e56-2d0b-4ca4-88b4-aa816129a66d
├ ─ ─ ─ ─ ─ ─ ─ ─ metro : https://api.fra.unikraft.cloud/v1
├ ─ ─ ─ ─ ─ ─ ─ ─ state : starting
├ ─ ─ ─ ─ ─ ─ ─ domain : https://icy-haze-8ph4u8cz.fra.unikraft.app
├ ─ ─ ─ ─ ─ ─ ─ ─ image : oci://unikraft.io/<my-org>/tyk@sha256:4954033ada90f980f279e5d825dd7971111a429578ce38be764893ba0d1f358d
├ ─ ─ ─ ─ ─ ─ ─ memory : 256 MiB
├ ─ ─ ─ ─ ─ ─ service : icy-haze-8ph4u8cz
├ ─ private fqdn : tyk-s9ixd.internal
└ ─ ─ ─ private ip : 10.0.0.1
In this case, the instance names are redis-6vgvc and tyk-s9ixd, and the Tyk address is https://icy-haze-8ph4u8cz.fra.unikraft.app.
They're different for each run.
Use curl to query the Tyk instance on Unikraft Cloud:
curl https://icy-haze-8ph4u8cz.fra.unikraft.app/hello
{"status":"pass","version":"v5.3.0-dev","description":"Tyk GW","details":{"redis":{"status":"pass","componentType":"datastore","time":"2026-05-25T12:26:07Z"}}}
You can list information about the instances by running:
When done, you can remove the instances:
Customize your app
To customize the Tyk app, you can update:
Kraftfile: the Unikraft Cloud specification
Dockerfile / rootfs/: the Tyk filesystem (in this case the configuration file /etc/tyk.conf)
It's unlikely you will have to update the Kraftfile specification.
Update the contents of the rootfs/etc/tyk.conf file for a different configuration.
You can also update the Dockerfile in order to extend the Tyk filesystem with extra data files or configuration files.
Learn more
Use the --help option for detailed information on using Unikraft Cloud:
Or visit the CLI Reference or the legacy CLI Reference .
Last modified on June 2, 2026