OpsCanary
data infrakafkaPractitioner

Kafka Quickstart: Setting Up Event Streaming in Minutes

5 min read Apache Kafka DocsJun 28, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

Kafka exists to solve the challenges of real-time data processing and event streaming across distributed systems. It allows you to read, write, store, and process events efficiently, making it essential for modern applications that require high throughput and low latency.

To get started, you can run Kafka using local scripts or a Docker image. Begin by extracting the Kafka package and navigating to the directory. Use the command $ bin/kafka-storage.sh format --standalone -t$KAFKA_CLUSTER_ID-c config/server.properties to format the storage. Start the Kafka server with $ bin/kafka-server-start.sh config/server.properties. Once the server is running, create a topic with $ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092. You can then produce events using $ bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092>This is my first event>This is my second event and consume them with $ bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092.

In production, ensure your environment has Java 17+ installed. While using relative paths for connectors is convenient for quickstarts, always prefer absolute paths for production deployments to avoid path resolution issues. Be aware that Kafka Connect allows you to continuously ingest data from external systems, which can be a game changer for integrating various data sources into your Kafka ecosystem.

Key takeaways

  • Install Java 17+ to run Kafka smoothly.
  • Use `$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092` to create your first topic.
  • Start producing events with `$ bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092>This is my first event`.
  • Leverage Kafka Connect for seamless data ingestion from external systems.
  • Always use absolute paths for connectors in production environments.

Why it matters

In production, Kafka can significantly enhance your data processing capabilities, enabling real-time analytics and event-driven architectures. This can lead to faster decision-making and improved responsiveness in your applications.

Code examples

Bash
$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
Bash
$ bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092>This is my first event>This is my second event
Bash
$ bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOcean Serverless InferenceSponsor

OpenAI & Anthropic-compatible inference API — no GPU provisioning needed. 55+ models, pay-per-token with no minimums. VPC + zero data retention by default.

Try Serverless Inference →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.