Quick Start
This quickstart walks you through deploying API7 Gateway locally with Docker Compose, creating your first service and route, and verifying that API traffic is proxied through the gateway.
Time to complete: ~10 minutes
Prerequisites
| Requirement | Minimum Version |
|---|---|
| Docker | v20.10+ |
| Docker Compose | v2.0+ |
| curl | Any |
| API7 Enterprise license | Get a trial license |
Step 1: Install API7 Gateway
Run the quickstart script to deploy all API7 Gateway components:
curl -sL "https://run.api7.ai/api7/quickstart" | bash
This starts the Control Plane, Dashboard, DP Manager, Gateway, PostgreSQL, and Prometheus. Wait for the script to complete. You should see output similar to:
✔ Container api7-ee-postgresql
✔ Container api7-ee-prometheus
✔ Container api7-ee-api7-ee-dashboard
✔ Container api7-ee-api7-ee-dp-manager
✔ Container api7-ee-api7-ee-gateway
...
✔ API7-EE is ready!
Verify all containers are running:
docker ps
You should see containers for api7-ee-gateway, api7-ee-dashboard, api7-ee-dp-manager, api7-ee-postgresql, and api7-ee-prometheus.
Step 2: Activate API7 Gateway
-
Open your browser and navigate to
https://localhost:7443. -
Log in with the default credentials:
Field Value Username adminPassword admin -
Upload your API7 Enterprise license to activate the platform.
The quickstart automatically creates a default gateway group with a gateway instance. You can verify this by navigating to Gateway Groups in the Dashboard sidebar.
If you want to use the Admin API in the next steps, create a token by following Obtain a Token from the Dashboard, then export it as an environment variable:
export API_KEY="a7ee-xxxxxxxxxxxxx"
Step 3: Create a Service and Route
Create a published service that proxies requests to httpbin.org:
- Dashboard
- Admin API
- ADC
-
In the Dashboard sidebar, navigate to the default gateway group and click Published Services.
-
Click Add Service → Add Manually.
-
Configure the service:
Field Value Name httpbinService Type HTTP (Layer 7 Proxy)Upstream Scheme HTTPHow to find the upstream Use Nodes -
Click Add Node and configure:
Field Value Host httpbin.orgPort 80Weight 100 -
Click Add to create the service.
-
Click the
httpbinservice, then click Add Route. -
Configure the route:
Field Value Name get-anythingPath /anything/*Methods GET -
Click Add.
# Create the service with the upstream
curl -k "https://localhost:7443/apisix/admin/services/httpbin?gateway_group_id={group_id}" -X PUT \
-H "X-API-KEY: ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "httpbin",
"upstream": {
"type": "roundrobin",
"scheme": "http",
"nodes": [
{ "host": "httpbin.org", "port": 80, "weight": 100 }
]
}
}'
# Create the route under that service
curl -k "https://localhost:7443/apisix/admin/routes/get-anything?gateway_group_id={group_id}" -X PUT \
-H "X-API-KEY: ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "get-anything",
"service_id": "httpbin",
"paths": ["/anything/*"],
"methods": ["GET"]
}'
If you are not running locally, replace localhost with your Admin API host. The -k flag is required if the Admin API uses a self-signed TLS certificate. Replace {group_id} with the gateway group ID — use default for the gateway group created by the quickstart, or copy the ID from the Gateway Groups page in the Dashboard.
First, install ADC:
curl -sL "https://run.api7.ai/adc/install" | bash
Before using ADC, configure it to connect to API7 Gateway:
- Create a token by following Obtain a Token from the Dashboard. Sign in with a non-root user and create a token in the Dashboard.
- Create a
.envfile in your working directory:
ADC_BACKEND=api7ee
ADC_SERVER=https://localhost:7443
ADC_TOKEN=a7ee-xxxxxxxxxxxxx # Replace with the token you created
ADC_GATEWAY_GROUP=default
- Verify connectivity:
adc ping
You should see: Connected to the "api7ee" backend successfully!
- Create a configuration file:
services:
- name: httpbin
upstream:
name: default
scheme: http
nodes:
- host: httpbin.org
port: 80
weight: 100
routes:
- uris:
- /anything/*
name: get-anything
methods:
- GET
- Synchronize the configuration to API7 Gateway:
adc sync -f adc.yaml
Step 4: Verify the Proxy
Send a request through the gateway:
curl "http://127.0.0.1:9080/anything/hello"
Expected response:
{
"args": {},
"headers": {
"Host": "127.0.0.1",
"User-Agent": "curl/8.x.x"
},
"method": "GET",
"url": "http://127.0.0.1/anything/hello"
}
A 200 OK response confirms that API7 Gateway is successfully proxying requests to the upstream httpbin.org service.
Stop API7 Gateway
To stop all services, navigate to the api7-ee directory created by the quickstart script and run:
bash run.sh stop
Next Steps
- Tutorial: Proxying and Managing API Requests via Plugins: Add authentication and rate limiting to your API.
- Learn More About API7 Products and APISIX: Understand the relationship between API7 products and the open-source APISIX ecosystem.
- Deploy on Kubernetes: Set up API7 Gateway in a production Kubernetes environment.