Deploy Kafka Stack
Apache Kafka (KRaft) and Kafbat UI in one click. No ZooKeeper needed.
kafka
Just deployed
kafka-ui
Just deployed
/etc/kafkaui
Deploy and Host Kafka Stack on Railway
Kafka Stack deploys a ready-to-use single-node Apache Kafka broker in modern KRaft mode together with Kafbat UI. Get a full event-streaming environment with a browser-based management interface in one click — no ZooKeeper required.
About Hosting Kafka Stack
This template deploys two services: a single-node Kafka broker running in combined broker/controller KRaft mode, and Kafbat UI for easy cluster management. The UI comes with basic authentication and is pre-connected to the Kafka service. Kafka runs without a persistent volume (data is ephemeral and resets on redeploy), while the UI configuration is persisted. After deploy, open the UI, log in with the default credentials, and start creating topics or inspecting messages immediately. Ideal for development, testing, prototypes, and small internal workloads that need a lightweight event-streaming setup without operational overhead.
Default UI Credentials
- Username:
kafka - Password: Auto-generated 16-character secret (visible in the Variables tab after deploy)
Common Use Cases
- Rapid local-style Kafka development and testing in the cloud
- Prototyping event-driven applications and microservices
- Staging environments that need a simple message broker
- Learning Kafka with a visual UI instead of pure CLI tools
Dependencies for Kafka Stack Hosting
- None beyond this template (Kafka + UI are included)
- Optional: your application services that produce/consume messages
Deployment Dependencies
- Apache Kafka: https://kafka.apache.org/
- Kafbat UI: https://github.com/kafbat/kafka-ui
- Kafbat UI Docs: https://ui.docs.kafbat.io/
- Railway Templates: https://docs.railway.com/templates
Implementation Details
Services
| Service | Image | Volume | Port |
|---|---|---|---|
| Kafka | apache/kafka:latest | ❌ None | 9092 (private) |
| Kafbat UI | ghcr.io/kafbat/kafka-ui:latest | /etc/kafkaui | 8080 (public) |
Kafka (KRaft) key settings
KAFKA_NODE_ID=1
KAFKA_PROCESS_ROLES=broker,controller
CLUSTER_ID=MkU3OEVBNTcwNTJENDM2Qk
KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${{RAILWAY_PRIVATE_DOMAIN}}:9092
KAFKA_CONTROLLER_QUORUM_VOTERS=1@${{RAILWAY_PRIVATE_DOMAIN}}:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
KAFKA_LOG_DIRS=/tmp/kraft-combined-logs
Kafbat UI key settings
SERVER_PORT=8080
AUTH_TYPE=LOGIN_FORM
SPRING_SECURITY_USER_NAME=kafka
SPRING_SECURITY_USER_PASSWORD=${{secret(16)}}
DYNAMIC_CONFIG_ENABLED=true
KAFKA_CLUSTERS_0_NAME=local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=${{Kafka.RAILWAY_PRIVATE_DOMAIN}}:9092
Why choose this template?
| Feature | This Template (Kafka Stack) | Manual setup / Other templates |
|---|---|---|
| No ZooKeeper (pure KRaft) | ✅ | ❌ Often still uses ZK |
| Kafka + UI in one click | ✅ | ❌ Separate deploys needed |
| Pre-connected UI to Kafka | ✅ | ❌ Manual bootstrap config |
| Basic Auth enabled by default | ✅ | ❌ Extra setup |
| UI config persisted | ✅ | ❌ Easy to lose settings |
| Auto-generated secure password | ✅ | ❌ Hardcoded or missing |
| Lightweight single-node design | ✅ | ❌ Over-complex multi-node |
| Kafka data persisted by default | ❌ (ephemeral) | ✅ Some templates include it |
Note: Kafka data is ephemeral (no volume) to avoid permission issues with the official image on Railway. Suitable for dev/staging. For persistent Kafka data, consider switching to
bitnami/kafkalater.
Why Deploy Kafka Stack on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Kafka Stack on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
kafka
apache/kafka:latestkafka-ui
ghcr.io/kafbat/kafka-ui:latest