Back to all templates
Apache Kafka logo

Apache Kafka

Database1024MB+ RAM

Distributed event streaming platform with KRaft mode (no Zookeeper)

messagingstreamingevent-drivenqueue

Deploy Apache Kafka in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Apache Kafka

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy Apache Kafka on a VPS with Server Compass

Use the Apache Kafka template in Server Compass to deploy a fast distributed event streaming platform on your VPS, then verify the Kafka CLI topic command.

About 10 minutesBrowser verified
1
Step 1

Open the server Apps tab

Select the tutorial-vps VPS, open the Apps tab, and start a new app deployment. Keep sensitive server details hidden before capturing or sharing screenshots.

Server Compass Apps tab before creating an Apache Kafka app
2
Step 2

Choose an app template

Click New App and choose the template deployment path so Server Compass can load the built-in catalog.

Choosing to deploy an app from a Server Compass template
3
Step 3

Search for Apache Kafka

Use the template picker search to find Apache Kafka in the Server Compass template catalog.

Searching for Apache Kafka in the Server Compass template picker
4
Step 4

Select the Apache Kafka template

Choose the Apache Kafka template. Server Compass fills the Kafka container, persistent data volume, broker port, and advertised listener host.

Apache Kafka template selected in Server Compass
5
Step 5

Review the Apache Kafka settings

Confirm the app name and compose service. In this run, the app was named kafka-demo and used host port 9092.

Reviewing Apache Kafka project settings and compose services
6
Step 6

Deploy Apache Kafka

Review the generated environment values, confirm the Kafka broker port is available, and click Deploy Now.

Reviewing Apache Kafka environment variables and port before deployment
7
Step 7

Watch the deployment progress

Keep the deployment modal open while Server Compass uploads the compose file, pulls the Apache Kafka image, starts the container, and verifies the stack.

Server Compass deploying the Apache Kafka template on the VPS
8
Step 8

Confirm Apache Kafka is running

After deployment finishes, return to the Apps tab and confirm the Apache Kafka app is marked Running with the broker port available.

Apache Kafka template running in the Server Compass Apps tab
9
Step 9

Verify Apache Kafka is reachable

Open the app detail view and verify the running Apache Kafka container. In this tutorial run, the Kafka CLI topic command reported that Apache Kafka was ready.

Apache Kafka app detail screen after verifying the deployed event streaming container

After Apache Kafka Opens

  • Restrict external access to port 9092 unless remote clients explicitly need it.
  • Configure SASL/SSL before production use.
  • Configure regular backups for the Apache Kafka data volume before storing production data.
  • Review topic retention and replication settings before storing production event streams.

Verified Result

The Kafka CLI created and listed a tutorial verification topic through the local broker.

Apache Kafka deployment questions

What does the Apache Kafka template deploy?

It deploys an Apache Kafka container in KRaft mode with a persistent data volume and an externally advertised broker listener.

Which port did the tutorial use?

The tutorial used host port 9092, which maps to the Kafka broker port 9092.

Why is there no browser verification screenshot?

Apache Kafka exposes a broker endpoint rather than a conventional browser app. The tutorial verifies it with the Kafka CLI topic command.

Should this become a blog post?

No. The deployment guide should live on the Apache Kafka template detail page and be linked from the reusable template deployment docs page.

Do It Yourself

Deploy Apache Kafka via Command Line

Prefer the command line? Follow this step-by-step guide to deploy Apache Kafka manually on your VPS.

1

Open a Terminal Connection

Start by opening a terminal window and connecting to your VPS via SSH.

terminal
# Connect to your VPS
ssh root@your-server-ip

# Or with a specific SSH key
ssh -i ~/.ssh/your-key root@your-server-ip

First time? Docker required! Install it with: curl -fsSL https://get.docker.com | sh

2

Create Application Directory

Create a dedicated space for your application deployment.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/kafka
cd ~/apps/kafka
3

Create Deployment Configuration

Create a docker-compose.yml file with the following configuration:

docker-compose.yml
services:
  kafka:
    image: apache/kafka:latest
    ports:
      - "9092:9092"
    environment:
      - KAFKA_NODE_ID=1
      - KAFKA_PROCESS_ROLES=broker,controller
      - KAFKA_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
      - KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
      - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
      - KAFKA_CONTROLLER_QUORUM_VOTERS=1@localhost:9093
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
      - KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
      - KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1
      - KAFKA_LOG_DIRS=/var/lib/kafka/data
    volumes:
      - kafka_data:/var/lib/kafka/data
    restart: unless-stopped

volumes:
  kafka_data:
Configuration Variables
PORTKafka port(default: 9092)
4

Launch Your Application

Deploy the stack and monitor the startup process.

terminal
# Spin up containers
docker compose up -d

# Verify deployment
docker compose ps

# Check logs for errors
docker compose logs -f
5

Enable External Access

Set up firewall rules to permit incoming connections.

terminal
# Allow the application port through firewall
sudo ufw allow 9092/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:9092
Skip the Terminal

Skip the command line. Deploy visually.

Deploy Apache Kafka with a beautiful UI instead. No SSH, no YAML editing, no terminal commands. Just click, configure, and deploy in under 3 minutes.

  • Visual config editor
  • Instant deployment
  • Automatic HTTPS
  • Smooth updates
  • Live monitoring
  • Quick rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying Apache Kafka with Server Compass, complete these steps to finish setup

1

Create topics

2

Test with kafka-console-producer and kafka-console-consumer

3

Configure retention policies

Need help? Check out our documentation for detailed guides.

Apache Kafka FAQ

Common questions about self-hosting Apache Kafka

How do I deploy Apache Kafka with Server Compass?

Simply download Server Compass, connect to your VPS, and select Apache Kafka from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for Apache Kafka?

Apache Kafka requires a minimum of 1024MB RAM. We recommend a VPS with at least 2048MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing Apache Kafka data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard Apache Kafka backup and restore procedures.

How do I update Apache Kafka to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest Apache Kafka image will be pulled and deployed with zero downtime.

Is Apache Kafka free to self-host?

Apache Kafka is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host Apache Kafka?

Download Server Compass and deploy Apache Kafka to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass