Skip to content

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:

bash
klisk start my-agent --port 8080

This exposes:

EndpointDescription
/Chat interface
/api/chatREST API
/ws/chatWebSocket for streaming
/widget.jsEmbeddable widget for any website

Embeddable widget

You can add your agent to any web page with a single script:

html
<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

bash
klisk docker my-agent

This generates three things in your project directory:

  • Dockerfile — Installs dependencies from requirements.txt and runs klisk start on port 8080
  • .dockerignore — Excludes .venv/, __pycache__/, .env, .git/, etc.
  • Updated requirements.txt — Ensures klisk is 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.

bash
cd ~/klisk/projects/my-agent
gcloud run deploy my-agent --source . --allow-unauthenticated

Cloud 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

bash
cd ~/klisk/projects/my-agent
fly launch

Fly.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

CloudServiceWhy
Google CloudCloud RunServerless containers, scales to zero, built-in HTTPS
AWSApp RunnerDeploys from a container image, auto-scales, managed HTTPS
AWSECS + FargateMore control over networking and load balancers
AzureContainer AppsServerless containers, scales to zero, managed HTTPS
OtherFly.io / RailwaySimple 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:

bash
cd ~/klisk/projects/my-agent
docker build -t my-agent .
docker run -p 8080:8080 --env-file .env my-agent

Deployment checklist

  1. Run klisk docker to generate the Dockerfile
  2. Set environment variables — pass the API keys from .env as env vars in your platform (e.g. --set-env-vars in Cloud Run, environment config in App Runner)
  3. Expose port 8080 — the container listens on this port by default
  4. klisk.config.yaml is in the image — the Dockerfile copies it automatically with COPY . .

Authentication

Protect your deployed agent with API keys. Add them as environment variables in your platform:

sh
KLISK_API_KEY=my-secret-key

See the authentication reference for details on key types and how each interface handles auth.

Klisk Documentation