| Edition | Deployment Type |
|---|---|
| Enterprise | Self-Managed, Hybrid, Cloud |
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.Using PostgreSQL
-
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:
-
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. -
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
-
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.
-
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.7for 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. - 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.
-
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
-
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:
-
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:
-
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.
-
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.7for 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. - 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.
-
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.Using PostgreSQL
-
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. -
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.
-
Create a docker-compose file
Before launching the portal using docker-compose, you will need to create a
docker-compose.yamlfile. 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.7for the portal v1.7. You can browse all available versions on Docker Hub and in the release notes section. -
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.
- 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.
-
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
-
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.
-
Create a docker-compose file
Before launching the portal using docker-compose, you will need to create a
docker-compose.yamlfile. 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.7for the portal v1.7. You can browse all available versions on Docker Hub and in the release notes section. -
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.
- 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.
-
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: