Installation Guide
This document describes various installation methods for Apache APISIX to help you quickly set up an API gateway environment.
Prerequisites
Before installing APISIX, ensure you meet the following requirements:
- Operating System: Linux (recommended: Ubuntu 20.04+, CentOS 7+, Debian 11+)
- Docker (for Docker deployment): Docker and Docker Compose installed
- etcd: APISIX uses etcd for configuration storage, requires etcd 3.4.0+
- Perl: Some dependencies require Perl 5.5.32+
- curl: For verifying installation
Docker Quick Install (Recommended)
This is the fastest installation method, suitable for development and testing environments.
Step 1: Create Quick Start Directory
mkdir apisix-quickstart && cd apisix-quickstart
Step 2: Run Quick Start Script
curl -sL https://run.api7.ai/apisix/quickstart | sh
This command automatically starts apisix-quickstart and etcd containers. APISIX uses etcd to store and synchronize configurations. The containers use Docker's host network mode, allowing direct access from localhost.
Step 3: Verify Installation
Upon successful installation, the terminal will output:
✔ APISIX is ready!
You can verify APISIX is running with:
curl "http://127.0.0.1:9080" --head | grep Server
This should return:
Server: APISIX/Version
Where Version is the installed APISIX version, e.g., APISIX/3.15.0.
Step 4: Access Dashboard
APISIX provides a built-in Dashboard UI accessible at:
http://127.0.0.1:9180/ui
⚠️ Note: For better experience, the Admin API is not authorized by default. Please enable authorization in production environments.
Docker Compose Installation
For custom configurations, use Docker Compose deployment.
Step 1: Create Configuration File
Create a docker-compose.yaml file:
version: '3.8'
services:
apisix:
image: apache/apisix:${APISIX_VERSION:-3.15.0}
container_name: apisix
restart: always
ports:
- "9080:9080"
- "9180:9180"
- "9443:9443"
environment:
- APISIX_ADMIN_API_KEY=your-admin-key
volumes:
- ./apisix_config/apisix.yml:/usr/local/apisix/conf/apisix.yml
networks:
- apisix-network
etcd:
image: quay.io/coreos/etcd:v3.5.0
container_name: etcd
restart: always
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
volumes:
- ./etcd_data:/etcd
networks:
- apisix-network
networks:
apisix-network:
driver: bridge
Step 2: Start Services
docker-compose up -d
Step 3: Verify Services
curl "http://127.0.0.1:9080" --head | grep Server
Kubernetes Installation
APISIX provides an official Ingress Controller for direct deployment in Kubernetes.
Install Using Helm Chart
# Add APISIX Helm repository
helm repo add apisix https://charts.apiseven.com
helm repo update
# Install APISIX
helm install apisix apisix/apisix \
--set gateway.type=LoadBalancer \
--set etcd.persistence.size=10Gi
Install Using kubectl
kubectl apply -f https://raw.githubusercontent.com/apache/apisix-ingress-controller/master/deploy/manifests/deploy.yaml
Source Compilation Installation
For production environments requiring custom builds.
Step 1: Install Dependencies
Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y perl build-essential git curl
CentOS/RHEL:
sudo yum install -y perl gcc git curl
Step 2: Install OpenResty
# Add OpenResty repository
wget https://openresty.org/package/pubkey.gpg
sudo apt-key add pubkey.gpg
echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) openresty" | sudo tee /etc/apt/sources.list.d/openresty.list
# Install OpenResty
sudo apt-get update
sudo apt-get install -y openresty openresty-opm
Step 3: Install APISIX
# Clone source code
git clone https://github.com/apache/apisix.git
cd apisix
# Install dependencies
make deps
# Initialize configuration
make init
# Start APISIX
make run
Verify Installation
Regardless of the installation method, verify with:
- Check Process Status
curl "http://127.0.0.1:9180/apisix/admin/notifications" \
-H "X-API-KEY: your-admin-key"
- Create Test Route
curl -i "http://127.0.0.1:9180/apisix/admin/routes" -X PUT -d '
{
"id": "test-route",
"uri": "/test",
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
- Test Route
curl "http://127.0.0.1:9080/test"
Uninstall
Docker:
# Stop containers
docker-compose down
# Delete volumes (if needed)
docker-compose down -v
Kubernetes:
helm uninstall apisix
Next Steps
After installation, continue with:
