Skip to content
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      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
      Kuma
      Open-source distributed control plane with a bundled Envoy Proxy integration
  • API Specs
  • 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
      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 Gateway
3.3.x
  • Home icon
  • Kong Gateway
  • Production Deployment
  • Networking
  • Network and Firewall
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • 3.4.x (latest)
  • 3.3.x
  • 3.2.x
  • 3.1.x
  • 3.0.x
  • 2.8.x
  • 2.7.x
  • 2.6.x
  • Archive (pre-2.6)
enterprise-switcher-icon Switch to OSS
On this pageOn this page
  • Ports
    • Proxy
    • Admin API
  • Firewall
You are browsing documentation for an outdated version. See the latest documentation here.

Network and Firewall

In this section you will find a summary about the recommended network and firewall settings for Kong.

Ports

Kong uses multiple connections for different purposes.

  • proxy
  • admin api

Proxy

The proxy ports is where Kong receives its incoming traffic. There are two ports with the following defaults:

  • 8000 for proxying HTTP traffic, and
  • 8443 for proxying HTTPS traffic

See proxy_listen for more details on HTTP/HTTPS proxy listen options. For production environment it is common to change HTTP and HTTPS listen ports to 80 and 443.

Kong can also proxy TCP/TLS streams. The stream proxying is disabled by default. See stream_listen for additional details on stream proxy listen options, and how to enable it (if you plan to proxy anything other than HTTP/HTTPS traffic).

In general the proxy ports are the only ports that should be made available to your clients.

Admin API

This is the port where Kong exposes its management API. Hence in production this port should be firewalled to protect it from unauthorized access.

  • 8001 provides Kong’s Admin API that you can use to operate Kong with HTTP. See admin_listen.

    Important: If you need to expose the admin_listen port to the internet in a production environment,

    secure it with authentication.

  • 8444 provides the same Kong Admin API but using HTTPS. See admin_listen and the ssl suffix.

Firewall

Below are the recommended firewall settings:

  • The upstream Services behind Kong will be available via the proxy_listen interface/port values. Configure these values according to the access level you wish to grant to the upstream Services.
  • If you are binding the Admin API to a public-facing interface (via admin_listen), then protect it to only allow trusted clients to access the Admin API. See also Securing the Admin API.
  • Your proxy will need have rules added for any HTTP/HTTPS and TCP/TLS stream listeners that you configure. For example, if you want Kong to manage traffic on port 4242, your firewall will need to allow traffic on said port.

Transparent Proxying

It is worth mentioning that the transparent listen option may be applied to proxy_listen and stream_listen configuration. With packet filtering such as iptables (Linux) or pf (macOS/BSDs) or with hardware routers/switches, you can specify pre-routing or redirection rules for TCP packets that allow you to mangle the original destination address and port. For example a HTTP request with a destination address of 10.0.0.1, and a destination port of 80 can be redirected to 127.0.0.1 at port 8000. To make this work, you need (with Linux) to add the transparent listen option to Kong proxy, proxy_listen=8000 transparent. This allows Kong to see the original destination for the request (10.0.0.1:80) even when Kong didn’t actually listen to it directly. With this information, Kong can route the request correctly. The transparent listen option should only be used with Linux. macOS/BSDs allow transparent proxying without transparent listen option. With Linux you may also need to start Kong as a root user or set the needed capabilities for the executable.

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
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023