<a id="cpdocker-intro"></a>

# Install Confluent Platform Using Docker

To run Confluent Platform in Docker, pull the Confluent Platform component images from [Docker
Hub](https://hub.docker.com/u/confluentinc/). The images include
`confluentinc/cp-kafka`, `confluentinc/cp-schema-registry`, and
others. You can install the full platform or individual components,
and you can rebuild the images from the GitHub source. For the full
image list, see [Docker Image Reference for Confluent Platform](image-reference.md#image-reference).

<!-- WARNING: THIS IS A SHARED FILE AND THE SOURCE IS LOCATED IN DOCS-COMMON. DO NOT ADD TO ANY OTHER REPO. -->

## Considerations before you deploy

Before you deploy Confluent Platform with Docker, review how the images handle
networking, persistent storage, connector packaging, the JDK,
multi-host deployments, and Docker Swarm.

Multi-node Environment
: For more information, see [Configure a Multi-Node Confluent Platform Environment with Docker](../../kafka/multi-node.md#cp-multi-node).

Persistent Data (Mounted Volumes)
: When deploying Kafka images, you should always use [Mount Docker External Volumes in Confluent Platform](operations/external-volumes.md#external-volumes)
  for the file systems those images use for their persistent data. This ensures that the containers retain their
  proper state when stopped and restarted. The other images maintain their state directly in Kafka topics, so mounted
  volumes are not usually required for those containers.

Bridge networking vs. host networking
: Bridge networking works only on a single host. Multi-host bridge
  networks require overlay networks, which the Confluent Platform images do not
  currently support. To expose Kafka to clients outside the bridge
  network, you must set `advertised.listeners` to the container’s
  IP, which can be hard to discover. Bridge networking also adds a
  network hop and runs slower than host networking, which shares the
  host’s network stack.
  <br/>
  Confluent recommends host networking in the following cases:
  <br/>
  * Multi-host clusters without using Swarm or Kubernetes.
  * You need clients to be able to access Kafka outside the bridge/overlay network.

Adding Connectors to the Kafka Connect Image
: Use one of the following methods to add new connectors to the Kafka Connect image:
  <br/>
  * Build a new Docker image that has the connector installed. You can follow the examples found in
    [Extend Confluent Platform images](development.md#extending-images). You must make sure that the connector
    JARs are on the CLASSPATH for the Connect service. The default location is `/usr/share/java/kafka-connect-*`.
  * Add the connector JARs using volumes. If you don’t want to create a new Docker image, see the documentation
    on [Extend Confluent Platform images](development.md#extending-images) to configure the `cp-kafka-connect`
    container with external JARs.

Supported Java
: The Confluent Docker images are tested and shipped with [Temurin JDK](https://adoptium.net/temurin/releases/).
  Other JDKs (including Oracle Java) are supported, but you must extend the images yourself to implement that change.

Untested Features
: The images are not currently tested on Docker Swarm.

## Supported platforms

Confluent Platform Docker images support the following architectures.

* Linux AMD64 / x86_64
* Linux ARM64 / aarch64

Linux ARM64 Docker images also run on Apple macOS with Apple silicon.

To pull a Confluent Platform image for a specific architecture, use the following command.
The container runtime auto selects the platform. The following example pulls the latest cp-server image:

```bash
docker pull confluentinc/<image-name>:<tag>
```

```bash
docker pull confluentinc/cp-server:latest
```

Optionally, you can use the `--platform` option to pull a platform-specific image,
but most container runtimes automatically select this for you. The following example
pulls a platform-specific image:

```bash
docker pull confluentinc/cp-server:latest --platform linux/arm64
```

## Related content

- [Confluent Platform and Apache Kafka compatibility](../versions-interoperability.md#cp-ak-compatibility)
- [Quick Start for Confluent Platform](../../get-started/platform-quickstart.md#quickstart)
- [Docker Image Configuration Reference for Confluent Platform](config-reference.md#config-reference)
- [Configure Kafka Logs for Docker in Confluent Platform](operations/logging.md#docker-operations-logging)
- [Monitor and Track Metrics in Docker with JMX in Confluent Platform](operations/monitoring.md#use-jmx-monitor-docker-deployments)
- [Tutorial: Add and Remove Brokers with Auto Data Balancer in Confluent Platform](../../clusters/rebalancer/adb-docker-tutorial.md#automatic-data-balancing)
- [Example: Replicate Data in an Active-Active Multi-DataCenter Deployment on Confluent Platform](../../multi-dc-deployments/replicator/replicator-docker-tutorial.md#replicator)
