Skip to main content
You can use environment variables to override the config file for the Tyk Gateway. The Gateway configuration file can be found in the tyk-gateway folder and by default is called tyk.conf, though it can be renamed and specified using the --conf flag. Environment variables are created from the dot notation versions of the JSON objects contained with the config files. To understand how the environment variables notation works, see Environment Variables. All the Gateway environment variables have the prefix TYK_GW_. The environment variables will take precedence over the values in the configuration file.

Environment Variable Type Mapping

When configuring Tyk components using environment variables, it’s important to understand how different data types are represented. The type of each variable is based on its definition in the Go source code. This section provides a guide on how to format values for common data types.
For complex types like map[string]interface{}, the value should be a valid JSON string. For []string and map[string]string, ensure there are no spaces around the commas unless they are part of the value itself.

tyk lint

In v2.4 we have added a new tyk lint command which will validate your tyk.conf file and validate it for syntax correctness, misspelled attribute names or format of values. The Syntax can be: tyk lint or tyk --conf=path lint If --conf is not used, the first of the following paths to exist is used: ./tyk.conf /etc/tyk/tyk.conf