Skip to content
Kong Docs are moving soon! Our docs are migrating to a new home. You'll be automatically redirected to the new site in the future. In the meantime, view this page on the new site!
Kong Logo | Kong Docs Logo
  • Docs
    • Explore the API Specs
      View all API Specs View all API Specs View all API Specs arrow image
    • Documentation
      API Specs
      Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      Kong AI Gateway
      Multi-LLM AI Gateway for GenAI infrastructure
      Kong Mesh
      Enterprise service mesh based on Kuma and Envoy
      decK
      Helps manage Kong’s configuration in a declarative fashion
      Kong Ingress Controller
      Works inside a Kubernetes cluster and configures Kong to proxy traffic
      Kong Gateway Operator
      Manage your Kong deployments on Kubernetes using YAML Manifests
      Insomnia
      Collaborative API development platform
  • Plugin Hub
    • Explore the Plugin Hub
      View all plugins View all plugins View all plugins arrow image
    • Functionality View all View all arrow image
      View all plugins
      AI's icon
      AI
      Govern, secure, and control AI traffic with multi-LLM AI Gateway plugins
      Authentication's icon
      Authentication
      Protect your services with an authentication layer
      Security's icon
      Security
      Protect your services with additional security layer
      Traffic Control's icon
      Traffic Control
      Manage, throttle and restrict inbound and outbound API traffic
      Serverless's icon
      Serverless
      Invoke serverless functions in combination with other plugins
      Analytics & Monitoring's icon
      Analytics & Monitoring
      Visualize, inspect and monitor APIs and microservices traffic
      Transformations's icon
      Transformations
      Transform request and responses on the fly on Kong
      Logging's icon
      Logging
      Log request and response data using the best transport for your infrastructure
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
Kong Konnect
  • Home icon
  • Kong Konnect
  • Gateway Manager
  • Plugins
  • Adding custom plugins in Konnect
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • Introduction
    • Overview of Konnect
    • Architecture
    • Network Resiliency and Availability
    • Port and Network Requirements
    • Private Connections to Other Cloud Providers
      • Create a private connection with AWS PrivateLink
    • Geographic Regions
    • Centralized consumer management
    • Compatibility
    • Stages of Software Availability
    • Release Notes
    • Support
      • Control Plane Upgrades FAQ
      • Supported Installation Options
  • Get Started
    • Overview
    • Add your API
    • Migrating a Self-Managed Kong Gateway into Konnect
  • Gateway Manager
    • Overview
    • Dedicated Cloud Gateways
      • Overview
      • Provision a Dedicated Cloud Gateway
      • Securing Backend Traffic
      • Transit Gateways
      • Azure VNET Peering
      • Custom Domains
      • Custom Plugins
      • Data plane logs
    • Serverless Gateways
      • Overview
      • Provision a serverless Gateway
      • Securing Backend Traffic
      • Custom Domains
    • Data Plane Nodes
      • Installation Options
      • Upgrade a Data Plane Node
      • Verify a Data Plane Node
      • Secure Control Plane/Data Plane Communications
      • Renew Data Plane Certificates
      • Parameter Reference
      • Using Custom DP Labels
    • Control Plane Groups
      • Overview
      • Working with Control Plane Groups
      • Migrate Configuration into Control Plane Groups
      • Conflicts in Control Planes
    • Kong Gateway Configuration in Konnect
      • Overview
      • Manage Plugins
        • Overview
        • Adding Custom Plugins
        • Updating Custom Plugins
        • How to Create Custom Plugins
      • Create Consumer Groups
      • Secrets Management
        • Overview
        • Konnect Config Store
        • Set Up and Use a Vault in Konnect
      • Manage Control Plane Configuration with decK
    • Active Tracing
      • Overview
    • KIC Association
    • Backup and Restore
    • Version Compatibility
    • Troubleshooting
  • Mesh Manager
    • Overview
    • Create a mesh with the Kubernetes demo app
    • Federate a zone control plane to Konnect
    • Migrate a self-managed zone control plane to Konnect
  • Service Catalog
    • Overview
    • Integrations
      • Overview
      • Datadog
      • GitHub
      • GitLab
      • PagerDuty
      • SwaggerHub
      • Traceable
      • Slack
    • Scorecards
  • API Products
    • Overview
    • Product Documentation
    • Productize a Service
  • Dev Portal
    • Overview
    • Dev Portal Configuration Preparation
    • Create a Dev Portal
    • Sign Up for a Dev Portal Account
    • Publish an API to Dev Portal
    • Access and Approval
      • Manage Developer Access
      • Manage Developer Team Access
      • Add Developer Teams from IdPs
      • Manage Application Registrations
      • Configure generic SSO for Dev Portal
      • Configure Okta SSO for Dev Portal
    • Application Lifecycle
    • Register and create an application as a developer
    • Enable and Disable App Registration for API Product Versions
    • Dynamic Client Registration
      • Overview
      • Okta
      • Curity
      • Auth0
      • Azure
      • Custom IdP
    • Portal Management API Automation Guide
    • Audit Logging
      • Overview
      • Set up an Audit Log Webhook
      • Set up an Audit Log Replay Job
    • Portal Customization
      • Overview
      • About Self-Hosted Dev Portal
      • Host your Dev Portal with Netlify
      • Custom Domains
    • Dev Portal SDK
    • Troubleshoot
  • Advanced Analytics
    • Overview
    • Dashboard
    • Explorer
    • Analyze API Usage and Performance with Reports
    • Requests
  • Org Management
    • Plans and Billing
    • Authentication and Authorization
      • Overview
      • Teams
        • Overview
        • Manage Teams
        • Teams Reference
        • Roles Reference
      • Manage Users
      • Manage System Accounts
      • Personal Access Tokens
      • Social Identity Login
      • Org Switcher
      • Configure Generic SSO
      • Configure Okta SSO
      • Login Sessions Reference
      • Troubleshoot
    • Audit Logging
      • Overview
      • Set up an Audit Log Webhook
      • Set up an Audit Log Replay Job
    • Account and Org Deactivation
  • API
    • Overview
    • API Request API (Beta)
      • API Spec
    • API Products API
      • API Spec
    • Audit Logs API
      • API Spec
      • Audit Log Webhooks
    • Control Plane API
      • API Spec
    • Control Plane Configuration API
      • API Spec
    • Cloud Gateways API
      • API Spec
    • Identity API
      • API Spec
      • Identity Integration Guide
      • SSO Customization
    • Konnect Search API (Beta)
      • API Spec
    • Mesh Manager API
      • API Spec
      • Kong Mesh API Reference
    • Portal Client API
      • API Spec
    • Portal Management API
      • API Spec
    • Reference
      • Filtering
      • API Errors
  • Reference
    • Labels
    • Plugin Ordering Reference
    • Konnect Search
    • Terraform Provider
    • Audit Logs
    • Verify audit log signatures
    • IdP SAML attribute mapping
enterprise-switcher-icon Switch to OSS
On this pageOn this page
  • Prerequisites
  • Add a custom plugin to a control plane
  • Upload files to data plane nodes
  • More information

Adding custom plugins in Konnect

You can manage schemas for custom plugins via the Konnect UI or the Konnect Control Planes Config API.

After uploading a schema to Konnect, upload your custom plugin to each data plane node, then Konnect can manage the configuration for your plugin like any other Kong entity.

If you need to update a schema for a plugin that was already uploaded to Konnect, there are a few considerations based on the type of update. See Editing or deleting a custom plugin’s schema for more information.

Note: For adding custom plugins to a Dedicated Cloud Gateway, see Custom plugins in Dedicated Cloud Gateways.

Prerequisites

  • Your custom plugin meets Konnect’s requirements for Konnect.

  • The schema file must be in Lua, even if the custom plugin is written in another supported language. For help with developing plugins, see the plugin development resources.

    If you have a custom plugin written in a language other than Lua, convert the schema into a schema.lua file before uploading it to Konnect.

  • When using the /plugin-schemas API, authenticate your requests with either a personal access token or a system account token by including it in the authentication header:

      --header 'Authorization: Bearer kpat_xgfT'
    

Add a custom plugin to a control plane

Konnect only requires the custom plugin’s schema.lua file. Using that file, it creates a plugin entry in the plugin catalog for your control plane.

Upload a custom plugin schema to create a configurable entity in Konnect:

Konnect UI
Konnect API

Note: The UI is not available when using KIC in Konnect. Please use the Konnect API instead.

  1. From the Gateway Manager, open a control plane.
  2. Open Plugins from the side navigation, then click Add Plugin.
  3. Open the Custom Plugins tab, then click Create on the Custom Plugin tile.
  4. Upload the schema.lua file for your plugin.
  5. Check that your file displays correctly in the preview, then click Save.

Upload the schema.lua file for your plugin using the /plugin-schemas endpoint:

curl -i -X POST \
  https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas \
  --header 'Content-Type: application/json' \
  --data "{\"lua_schema\": <your escaped Lua schema>}"

Tip: You can use jq to pass your schema directly from the file instead of manually escaping it:

--data "{\"lua_schema\": $(jq -Rs '.' < REPLACE-PATH-TO-SCHEMA-FILE)}"

You should get an HTTP 201 response.

You can check that your schema was uploaded using the following request:

curl -i -X GET \
  https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas

This request returns an HTTP 200 response with the schema for your plugin as a JSON object.

Uploading a custom plugin schema adds the plugin to a specific control plane. If you need it to be available in multiple control planes, add the schema individually to each one.

Upload files to data plane nodes

After uploading a schema to Konnect, upload the schema.lua and handler.lua for your plugin to each Kong Gateway data plane node.

If a data plane node doesn’t have these files, the plugin won’t be able to run on that node.

Konnect does not support plugins with api.lua, daos.lua, or migration.lua.

Universal
Docker

Follow the Kong Gateway plugin deployment and installation instructions to get your plugin set up on each node.

If you are running Kong Gateway on Docker, the plugin needs to be installed inside the Kong Gateway container for each node. Copy or mount the plugin’s source code into the container.

Let’s consider this sample custom plugin. This is composed of a schema.lua and a handler.lua file. On your filesystem, let’s create a similar path structure to the following:

.
└── kong
    └── plugins
        └── example-plugin
            ├── handler.lua
            └── schema.lua

You can do this in one of two ways: mounting the files with docker run, or using a Dockerfile.

To mount and enable this custom plugin on a data plane node:

  1. In your control plane, go to Data Plane Nodes, then click New Data Plane Node.
  2. Choose Linux (Docker) and Generate a certificate.
  3. Copy the generated docker run command and add the following snippet to it:

     -v "/tmp/plugins/kong:/tmp/custom_plugins/kong" \
     -e "KONG_PLUGINS=bundled,example-plugin" \
     -e "KONG_LUA_PACKAGE_PATH=/tmp/custom_plugins/?.lua;;" \
    

    Substitute your own source and target paths, as well as the plugin name.

    A sample quickstart command would look something like this:

     docker run -d \
       -v "/tmp/plugins/kong:/tmp/custom_plugins/kong" \
       -e  "KONG_PLUGINS=bundled,example-plugin" \
       -e "KONG_LUA_PACKAGE_PATH=/tmp/custom_plugins/?.lua;;" \
       -e "KONG_ROLE=data_plane" \
       -e "KONG_DATABASE=off" \
       -e "KONG_VITALS=off" \
       -e "KONG_NGINX_WORKER_PROCESSES=1" \
       -e "KONG_CLUSTER_MTLS=pki" \
       -e "KONG_CLUSTER_CONTROL_PLANE=<example>.cp0.konghq.com:443" \
       -e "KONG_CLUSTER_SERVER_NAME=<example>.cp0.konghq.com" \
       -e "KONG_CLUSTER_TELEMETRY_ENDPOINT=<example>.tp0.konghq.com:443" \
       -e "KONG_CLUSTER_TELEMETRY_SERVER_NAME=<example>.tp0.konghq.com" \
       -e "KONG_CLUSTER_CERT=<cert>" \
       -e "KONG_CLUSTER_CERT_KEY=<key>" \
       -e "KONG_LUA_SSL_TRUSTED_CERTIFICATE=system" \
       -e "KONG_KONNECT_MODE=on" \
       -p 8000:8000 \
       -p 8443:8443 \
       kong/kong-gateway:<version>
    
  4. Run the command to start a data plane node with your custom plugin loaded in.

To copy the plugin using a Dockerfile instead, see the Kong Gateway custom plugin docs.

You can now configure this custom plugin like any other plugin in Konnect.

Caution: Carefully test the operation of any custom plugins before using them in production. Kong is not responsible for the operation or support of any custom plugins, including any performance impacts on your Konnect or Kong Gateway deployments.

More information

  • Edit or delete custom plugins in Konnect
  • Custom plugins in Dedicated Cloud Gateways
  • Custom plugin schema endpoints (Control Plane Config API)
  • Custom plugin template
  • Plugin development guide
  • PDK reference
Thank you for your feedback.
Was this page useful?
Too much on your plate? close cta icon
More features, less infrastructure with Kong Konnect. 1M requests per month for free.
Try it for Free
  • Kong
    Powering the API world

    Increase developer productivity, security, and performance at scale with the unified platform for API management, service mesh, and ingress controller.

    • Products
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • Product Updates
      • Get Started
    • Documentation
      • Kong Konnect Docs
      • Kong Gateway Docs
      • Kong Mesh Docs
      • Kong Insomnia Docs
      • Kong Konnect Plugin Hub
    • Open Source
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kong Community
    • Company
      • About Kong
      • Customers
      • Careers
      • Press
      • Events
      • Contact
  • Terms• Privacy• Trust and Compliance
© Kong Inc. 2025