Skip to main content

Prerequisites

Running on Podman, containerd, or another container runtime? See Container Runtimes.

Docker

This section explains how to install Tyk Developer Portal in a container using Docker. Depending on your preferences, you can use MariaDB, MySQL or PostgreSQL for the database. In this recipe, the database and the portal container will run on the same network, with the database storing its data on a volume. The portal’s CMS assets (images, files and themes) are stored in the database, although this guide provides links to the documentation to use a persistent volume or an S3 bucket as a storage medium for CMS assets. Additionally, all settings for the Portal are configured using an env-file.
NoteThis document is just an example. Customize all fields, including the username, password, root password, database name and more.Be sure to update the connection DSN in the env-file accordingly.

Using PostgreSQL

  1. Create a network for the portal deployment To start with, you need to create a Docker network for communication between the database and the portal. Execute the following command to create it:
  2. Create an init script for PostgreSQL To initialize a PostgreSQL database, you need to create an init script that will later be used to launch the PostgreSQL instance. Copy the content below to a file named init.sql, which you will need in the next step.
  3. Create the database volume and launch the database The next step is to launch the PostgreSQL database for the portal. To achieve this, create a data volume for the database first:
    Then launch the PostgreSQL instance by executing the following command:
    Note
    The above PostgreSQL configuration is an example. You can customize deployment of your PostgreSQL instance. Please refer to the PostgreSQL documentation for further guidance.
  4. Create an environment variables file Creating an environment variables file to specify settings for the portal is the next step. This is optional, as you can alternatively specify all the variables using the -e option when starting your deployment. Here is an example of a sample environment file. For a comprehensive reference of environment variables, please refer to the configuration section in the Tyk Developer Portal documentation.
    Once you have completed this step, you are ready to launch the portal application with PostgreSQL in a Docker container.
  5. Pull and launch the portal container To pull and launch the portal using Docker, use the command provided below. Ensure that you replace <tag> with the specific version of the portal you intend to launch before executing the command, e.g. tykio/portal:v1.7 for the portal v1.7. You can browse all available versions on Docker Hub and in the release notes section.
    This command will launch the portal on localhost at port 3001. Now, you can bootstrap the portal and start managing your API products.
  6. Bootstrap the portal Now the portal is running on port 3001, but it needs to be bootstrapped by providing credentials for the super admin user since it’s the first time you are launching it. Follow the bootstrapping section of the documentation to bootstrap the portal via the UI or the admin API.
  7. Clean up If you want to clean up your environment or start the installation process from scratch, execute the following commands to stop and remove the portal container:

Using MySQL

  1. Create a network for the portal deployment To start with, you need to create a Docker network for communication between the database and the portal. Execute the following command to create it:
  2. Create the database volume and launch the database The next step is to launch the MySQL database for the portal. To achieve this, create a data volume for the database first:
    Then launch the MySQL instance by executing the following command:
    NoteThe above MySQL configuration is an example. You can customize deployment of your MySQL instance.Please refer to the MySQL documentation for further guidance.
  3. Create an environment variables file Creating an environment variables file to specify settings for the portal is the next step. This is optional, as you can alternatively specify all the variables using the -e option when starting your deployment. Here is an example of a sample environment file. For a comprehensive reference of environment variables, please refer to the configuration section in the Tyk Developer Portal documentation.
    Once you have completed this step, you are ready to launch the portal application with MySQL in a Docker container or via Docker Compose.
  4. Pull and launch the portal container To pull and launch the portal using Docker, use the command provided below. Ensure that you replace <tag> with the specific version of the portal you intend to launch before executing the command, e.g. tykio/portal:v1.7 for the portal v1.7. You can browse all available versions on Docker Hub and in the release notes section.
    This command will launch the portal on localhost at port 3001. Now, you can bootstrap the portal and start managing your API products.
  5. Bootstrap the portal Now the portal is running on port 3001, but it needs to be bootstrapped by providing credentials for the super admin user since it’s the first time you are launching it. Follow the bootstrapping section of the documentation to bootstrap the portal via the UI or the admin API.
  6. Clean up If you want to clean up your environment or start the installation process from scratch, execute the following commands to stop and remove the portal container:

Docker Compose

This section provides a clear and concise, step-by-step recipe for launching the Tyk Developer Portal in a container using Docker Compose. Depending on your preferences, you can use MariaDB, MySQL or PostgreSQL for the database. In this recipe, the database and the portal containers will run on the same network, with the database storing it’s data on a volume. The portal’s CMS assets (images, files and themes) are stored in the database, although this guide provides links to the documentation to use a persistent volume or an S3 bucket as a storage medium for CMS assets. Additionally, all settings for the Portal are configured using an env-file.
NoteThis document is just an example. Customize all fields, including the username, password, root password, database name and more.

Using PostgreSQL

  1. Create an init script for PostgreSQL To initialize a PostgreSQL database, you need to create an init script that will later be used to launch the PostgreSQL instance. Copy the content below to a file named init.sql, which you will need in the next step.
  2. Create an environment variables file for configuring the portal and the database Creating an environment file to specify settings for the portal is the next step. Here is an example of a sample environment file. For a comprehensive reference of environment variables, please refer to the configuration section in the Tyk Developer Portal documentation.
    Once you have completed this step, you are ready to launch the portal application with PostgreSQL via Docker Compose.
  3. Create a docker-compose file Before launching the portal using docker-compose, you will need to create a docker-compose.yaml file. An example of the portal’s docker-compose file is provided below, which you can use as a starting point and further customize to meet your specific requirements. Ensure that you replace <tag> with the specific version of the portal you intend to launch before executing the command, e.g. tykio/portal:v1.7 for the portal v1.7. You can browse all available versions on Docker Hub and in the release notes section.
  4. Pull and launch the portal container using docker-compose To launch the portal using docker-compose, execute the command provided below.
    This command will launch the portal on localhost at port 3001. Now, you can bootstrap the portal and start managing your API products.
  5. Bootstrap the portal Now the portal is running on port 3001, but it needs to be bootstrapped by providing credentials for the super admin user since it’s the first time you are launching it. Follow the bootstrapping section of the documentation to bootstrap the portal via the UI or the admin API.
  6. Clean up If you want to clean up your environment or start the installation process from scratch, execute the following commands to stop and remove the portal container:

Using MySQL

  1. Create an environment variables file for configuring the portal and the database The first step is to create an environment file to specify settings for the portal. Here is an example of a sample environment file. For a comprehensive reference of environment variables, please refer the configuration section in the Tyk Developer Portal documentation.
    Once you have completed this step, you are ready to launch the portal application with MySQL via Docker Compose.
  2. Create a docker-compose file Before launching the portal using docker-compose, you will need to create a docker-compose.yaml file. An example of the portal’s docker-compose file is provided below, which you can use as a starting point and further customize to meet your specific requirements. Ensure that you replace <tag> with the specific version of the portal you intend to launch before executing the command, e.g. tykio/portal:v1.7 for the portal v1.7. You can browse all available versions on Docker Hub and in the release notes section.
  3. Pull and launch the portal container using docker-compose To launch the portal using docker-compose, execute the command provided below.
    This command will launch the portal on localhost at port 3001. Now, you can bootstrap the portal and start managing your API products.
  4. Bootstrap the portal Now the portal is running on port 3001, but it needs to be bootstrapped by providing credentials for the super admin user since it’s the first you are launching it. Follow the bootstrapping section of the documentation to bootstrap the portal via the UI or the admin API.
  5. Clean up If you want to clean up your environment or start the installation process from scratch, execute the following commands to stop and remove the portal container: