Skip to content
2023 API Summit Hackathon: Experiment with AI for APIs (August 28 - September 27) Learn More →
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.0.x
  • Home icon
  • Kong Gateway
  • Get Started
  • Get Kong
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
  • Prerequisites
  • Get Kong
You are browsing documentation for an outdated version. See the latest documentation here.

Get Kong

Kong Gateway is a lightweight, fast, and flexible cloud-native API gateway. Kong Gateway sits in front of your service applications, dynamically controlling, analyzing, and routing requests and responses. Kong Gateway implements your API traffic policies by using a flexible, low-code, plug-in based approach.

This tutorial will help you get started with Kong Gateway by setting up a local installation and walking through some common API management tasks.

This page will walk you through running Kong Gateway and verifying it with the Admin API. Once complete, the following tasks can be performed to complete the tutorial:

  • Understanding and configuring Services and Routes
  • Configuring Rate Limiting to protect upstream Services
  • Increase system performance with Proxy Caching
  • Load Balancing for horizontal Service scaling
  • Protecting Services with Key Authentication

Prerequisites

  • Docker is used to run Kong Gateway and supporting database locally
  • curl is used to send requests to Kong Gateway. curl is pre-installed on most systems
  • jq is used to process JSON responses on the command line. While useful, this tool is not necessary to complete the tasks of this tutorial. If you wish to proceed without jq, modify the commands to remove jq processing.

Get Kong

For the purposes of this tutorial, a quickstart script is provided to quickly run Kong Gateway and its supporting database. This script uses Docker to run Kong Gateway and a PostgreSQL database as the backing database.

  1. Run Kong Gateway with the quickstart script:

    curl -Ls https://get.konghq.com/quickstart | bash
    

    Note: The quickstart script runs Kong Gateway Enterprise in Free mode. You may run Kong with a license by passing the license to the script via an environment variable. For instructions on this and other advanced usage, see the code repository documentation.

    This script runs Docker containers for Kong Gateway and the supporting PostgreSQL database. The script also creates a Docker network for those containers to communicate over. Finally, the database is initialized with the appropriate migration steps, and once the Kong Gateway is ready, you will see the following message:

    ✔ Kong is ready!
    
  2. Verify that Kong Gateway is running:

    Kong Gateway serves an Admin API on the default port 8001. The Admin API can be used for both querying and controlling the state of Kong Gateway. The following command will query the Admin API, fetching the headers only:

    curl --head localhost:8001
    

    If Kong Gateway is running properly, it will respond with a 200 HTTP code, similar to the following:

    HTTP/1.1 200 OK
    Date: Mon, 22 Aug 2022 19:25:49 GMT
    Content-Type: application/json; charset=utf-8
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    Content-Length: 11063
    X-Kong-Admin-Latency: 6
    Server: kong/3.0.2
    
  3. Evaluate the Kong Gateway configuration:

    The root route of the Admin API provides important information about the running Kong Gateway including networking, security, and plugin information. The full configuration is provided in the .configuration key of the returned JSON document.

    curl -s localhost:8001 | jq '.configuration'
    

    You should receive a large JSON response with Kong Gateway configuration information.

  4. Access Kong Manager

    While the rest of this guide demonstrates configuring Kong Gateway using the Admin API, you can also use Kong Manager to manage your Services, Routes, Plugins, and more. To access Kong Manager, go to the following URL: http://localhost:8002

Every step in this tutorial requires a running Kong Gateway, so leave everything running and proceed to the next steps in this tutorial.


Next Services and Routes
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