OpsCanary
data infrakafkaPractitioner

Kafka Quickstart: Stream Events Like a Pro

5 min read Apache Kafka DocsNov 1, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

Kafka exists to solve the challenges of handling large streams of data across distributed systems. It allows you to read, write, store, and process events seamlessly, making it a cornerstone for modern data infrastructures. Whether you're building real-time applications or integrating various data sources, Kafka provides the tools you need to manage event streams efficiently.

To get started with Kafka, you can run it locally using scripts or a Docker image. Begin by extracting the Kafka package and generating a Cluster UUID with bin/kafka-storage.sh random-uuid. Format the log directories using bin/kafka-storage.sh format --standalone -t$KAFKA_CLUSTER_ID-c config/server.properties, and start the server with bin/kafka-server-start.sh config/server.properties. Create a topic with bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092, and use the console producer to write events. For example, run bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092 and input your events. To read these events, use the console consumer: bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092.

In production, remember that your local environment must have Java 17+ installed. While the quickstart uses relative paths for connectors, it's advisable to use absolute paths in production to avoid issues. Also, be aware that Kafka Connect and Kafka Streams are powerful features that allow you to ingest data from external systems and process events in real-time. However, always consider the scale of your application and the complexity of your data flows when implementing these features.

Key takeaways

  • →Extract Kafka by running 'tar -xzf kafka_2.13-4.4.0.tgzcdkafka_2.13-4.4.0'.
  • →Start the Kafka server with 'bin/kafka-server-start.sh config/server.properties'.
  • →Create a topic using 'bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092'.
  • →Produce events with 'bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092'.
  • →Consume events using 'bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092'.

Why it matters

Kafka's ability to handle high-throughput event streams is crucial for applications that require real-time data processing. This can significantly enhance your system's responsiveness and scalability.

Code examples

Bash
tar -xzf kafka_2.13-4.4.0.tgzcdkafka_2.13-4.4.0
Bash
bin/kafka-server-start.sh config/server.properties
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.