Deployment Guide
Quickly deploy your own KiroGate instance
๐
Requirements
๐
Python 3.10+
๐ฆ
pip or poetry
๐
Network Access
โ๏ธ
Environment Variables
# Required PROXY_API_KEY="your-secret-api-key" # Proxy server password # Optional (simple mode only) # If you use combined mode (PROXY_API_KEY:REFRESH_TOKEN), this setting can be omitted. REFRESH_TOKEN="your-kiro-refresh-token" # Kiro Refresh Token # Other optional settings KIRO_REGION="us-east-1" # AWS region PROFILE_ARN="arn:aws:..." # Profile ARN LOG_LEVEL="INFO" # Log level # Or use a credentials file KIRO_CREDS_FILE="~/.kiro/credentials.json"
๐ก Configuration notes
- โข Simple mode: Requires the
REFRESH_TOKENenvironment variable. - โข Combined mode (recommended): No
REFRESH_TOKENrequired; users pass it in the request. - โข Multi-tenant deployment: Combined mode lets multiple users share the same gateway instance.
๐
Run Locally
# Clone the repository git clone https://github.com/dext7r/KiroGate.git cd KiroGate # Install dependencies pip install -r requirements.txt # Configure environment variables cp .env.example .env # Edit .env to fill in the configuration # Start the service python main.py
๐ณ
Docker Deployment
Docker Compose (Recommended)
# Copy the config file cp .env.example .env # Edit .env to fill in your credentials # Start the service (creates the persistent volume automatically) docker-compose up -d # View logs docker logs -f kirogate
Manual Docker Run
docker build -t kirogate . docker run -d -p 8000:8000 \ -v kirogate_data:/app/data \ -e PROXY_API_KEY="your-key" \ -e ADMIN_PASSWORD="your-admin-pwd" \ --name kirogate kirogate
๐
Fly.io Deployment
# 1. Install the Fly CLI and log in curl -L https://fly.io/install.sh | sh fly auth login # 2. Create the app fly apps create kirogate # 3. Create a persistent volume (important to prevent data loss) fly volumes create kirogate_data --region nrt --size 1 # 4. Set environment variables fly secrets set PROXY_API_KEY="your-password" fly secrets set ADMIN_PASSWORD="your-admin-password" fly secrets set ADMIN_SECRET_KEY="your-random-secret" # 5. Deploy fly deploy
๐พ
Data Persistence
โ ๏ธ Important
User data (database) must be persisted, otherwise every deployment will lose all users, tokens, and API keys!
๐ณ Docker Compose
Named volume kirogate_data:/app/data is already configured; use docker-compose down to retain data.
๐ Fly.io
Create the volume manually: fly volumes create kirogate_data --region nrt --size 1
๐
Obtain a Refresh Token
๐ Option 1: Browser (Recommended)
- 1Open https://app.kiro.dev/account/usage and log in.
- 2Press F12 to open DevTools.
- 3Click Application โ Storage โ Cookies.
- 4Select
https://app.kiro.dev. - 5Copy the value of
RefreshToken.
๐ ๏ธ Option 2: Kiro Account Manager
Use Kiro Account Manager to easily manage refresh tokens for multiple accounts.