Deploy to production
Klisk offers two ways to put your agent in production: local server and cloud deployment.
Local server
Start a production server on your machine:
klisk start my-agent --port 8080This exposes:
| Endpoint | Description |
|---|---|
/ | Chat interface |
/api/chat | REST API |
/ws/chat | WebSocket for streaming |
/widget.js | Embeddable widget for any website |
Embeddable widget
You can add your agent to any web page with a single script:
<script src="http://localhost:8080/widget.js"></script>Deploy to the cloud
You can deploy a Klisk agent to any platform that runs Docker containers.
1. Generate deployment files
klisk docker my-agentThis generates three things in your project directory:
Dockerfile— Installs dependencies fromrequirements.txtand runsklisk starton port 8080.dockerignore— Excludes.venv/,__pycache__/,.env,.git/, etc.- Updated
requirements.txt— Ensureskliskis listed with the correct extras (e.g.klisk[litellm]if your project uses non-OpenAI models)
The generated container runs klisk start, which reads your klisk.config.yaml at startup and applies all your configuration: chat page settings, widget customization, CORS origins, etc. Everything you configure in the Studio's Customize section is automatically included in the deployment.
2. Deploy to your platform
You don't need Docker installed on your machine. Most cloud platforms build the image remotely from the Dockerfile — you just upload your project source code.
Google Cloud Run (recommended)
cd ~/klisk/projects/my-agent
gcloud run deploy my-agent --source . --allow-unauthenticatedCloud Run sends the source to Cloud Build, which builds the Docker image in the cloud and deploys it automatically. No local Docker required. You'll need the Google Cloud CLI installed and configured.
Fly.io
cd ~/klisk/projects/my-agent
fly launchFly.io detects the Dockerfile and builds remotely. No local Docker required.
Railway
Connect your repository or use railway up — Railway builds from the Dockerfile automatically.
Other platforms
| Cloud | Service | Why |
|---|---|---|
| Google Cloud | Cloud Run | Serverless containers, scales to zero, built-in HTTPS |
| AWS | App Runner | Deploys from a container image, auto-scales, managed HTTPS |
| AWS | ECS + Fargate | More control over networking and load balancers |
| Azure | Container Apps | Serverless containers, scales to zero, managed HTTPS |
| Other | Fly.io / Railway | Simple CLI-based deploys, good for quick prototypes |
All of these support environment variables (for API keys), custom domains, and HTTPS.
WARNING
Avoid services meant for static sites or serverless functions (Lambda, Cloud Functions, Azure Functions) — they don't support long-lived HTTP connections needed for WebSocket and SSE streaming.
Test locally with Docker (optional)
If you want to test the production image on your machine before deploying, you can build and run it locally. This requires Docker installed:
cd ~/klisk/projects/my-agent
docker build -t my-agent .
docker run -p 8080:8080 --env-file .env my-agentDeployment checklist
- Run
klisk dockerto generate the Dockerfile - Set environment variables — pass the API keys from
.envas env vars in your platform (e.g.--set-env-varsin Cloud Run, environment config in App Runner) - Expose port 8080 — the container listens on this port by default
klisk.config.yamlis in the image — the Dockerfile copies it automatically withCOPY . .
Authentication
Protect your deployed agent with API keys. Add them as environment variables in your platform:
KLISK_API_KEY=my-secret-keySee the authentication reference for details on key types and how each interface handles auth.
