Running OpenSearch on Docker in production

The sample docker-compose file is a starting point, not a production design. Here is what to change before an OpenSearch container runs in front of real data.

On this page

Why the Docker sample needs changes before production

The sample docker-compose file from the OpenSearch docs is built for evaluation, so a team moving it toward production must replace its demo defaults and make the host and storage decisions the container will not make for you. The most visible demo default is the admin password: since OpenSearch 2.12, the demo security configuration needs a custom value in OPENSEARCH_INITIAL_ADMIN_PASSWORD, and the cluster fails to start unless the password meets the length and strength rules in the demo configuration docs. Other demo choices, such as the self-signed certificates, the bundled users and the default heap values in OPENSEARCH_JAVA_OPTS, also need a deliberate decision before go-live.

The Docker image runs inside infrastructure you control, so the container is only one layer of the deployment. The host must meet the kernel requirement for vm.max_map_count, which must be at least 262144 even when the image is used, and the host's memory must leave room for the JVM heap the sample sets. Storage is also yours to plan: the named volumes in the sample hold index data, so you need to decide where they live, how they are sized, and how they are backed up and restored.

The security plugin is the third layer. Keeping it enabled with the demo configuration is not an acceptable production baseline, so the team needs to plan identity backends, TLS for node and client traffic, roles, and audit logging before the first real data is loaded. Ask whoever will own the cluster to confirm which of these choices already have owners in your organization, and treat the compose file as a starting point for a written configuration review rather than the finished design.

How to prepare the host and container for OpenSearch on Docker

This sequence takes the sample docker-compose file from a test setup to a container that starts with a known admin credential, sized memory, persistent data and verified TLS access. Each step ends with a check you can repeat before the cluster goes into service.

  1. Set the kernel map count on the host

    The platform engineer running the Docker host sets vm.max_map_count to at least 262144 before any container starts. The value applies to the host kernel, so it must be set there even though OpenSearch runs in a container. To make it survive reboots, write it to a sysctl configuration file, then reload sysctl. Confirm the setting by reading the live value with the sysctl command on each host that will run an OpenSearch node. The step is done when every node reports 262144 or higher.

  2. Set a strong initial admin password

    The engineer who owns the deployment secrets sets OPENSEARCH_INITIAL_ADMIN_PASSWORD in the environment file or secret store that Compose reads, not in the compose file committed to version control. Since OpenSearch 2.12, the demo security configuration requires a custom value between 8 and 100 characters that zxcvbn rates as strong. If the value does not meet this rule, the cluster fails to start, so check the container logs after the first launch. Store the password in your approved vault and remove any default value from the sample file. The step is done when the value is in the vault and the variable is no longer set to a placeholder.

  3. Size the JVM heap through OPENSEARCH_JAVA_OPTS

    The platform engineer sets the minimum and maximum JVM heap in OPENSEARCH_JAVA_OPTS, using the same value for both. The sample file includes a comment advising at least 50 percent of system RAM, so the heap should be sized against the memory actually allocated to the container and the host, leaving room for the operating system and file system cache. Confirm the heap settings with the node stats or node info API after startup. The step is done when the reported heap matches the planned value on every node.

  4. Define persistent volumes for data and configuration

    The engineer creates named volumes or bind mounts for the data directory and maps them into each container, so index data does not live only in the container's writable layer. Give each node its own data volume and record which host path or storage backend backs it. Keep the TLS certificates and security configuration files in a location that is backed up and access controlled. The step is done when the compose file lists a volume for every node's data path and the host paths exist with the correct ownership for the container user.

  5. Replace demo TLS and security configuration

    The security engineer replaces the demo certificates and the demo security configuration that ship with the sample image. Demo certificates are for evaluation only, so issue certificates from your certificate authority or the one your organization approves, and mount them into the container. Review the security configuration for demo users and roles, change or remove them, and confirm which identity backend will be used. Record which files hold private keys and who can read them. The step is done when no demo certificate is mounted and the security configuration reflects your identity and role plan.

  6. Start the cluster and check TLS health

    The engineer starts the stack with Docker Compose and waits for the containers to report running. Then the engineer calls the cluster health endpoint over HTTPS on port 9200, using the CA certificate and the admin credential from the vault. A plain HTTP request should fail, which confirms TLS is enforced. Health should report green or yellow, depending on the replica settings in the test. If the cluster fails to start, read the container logs first, since a password rule failure appears there. The step is done when an authenticated HTTPS health request returns a response and an unauthenticated request is refused.

  7. Confirm data survives a container restart

    The engineer creates a test index with one document, restarts the containers with Docker Compose, and queries the document again through the same HTTPS endpoint. The check proves that the volumes are mounted and the data path is persistent. Remove the test index afterward so it does not remain in a production cluster. Repeat the restart on one node at a time if the cluster has several. The step is done when the test document is returned after the restart and the test index is deleted.

Which Docker settings to change and when each fits

This table compares the main settings in the sample docker-compose file with what a production node usually needs, plus the trade-off for each change. Read each row as a checklist: confirm the sample value, decide the production value for your node role and host memory, then weigh the operational cost of the change.

SettingWhat the sample providesWhat production needs and the trade-off
OPENSEARCH_INITIAL_ADMIN_PASSWORDA variable the demo security configuration reads, and the cluster will not start without a strong custom value since 2.12Set it from a secret store, not a literal in the file. Trade-off: the password must be supplied at every fresh start, so plan how the value reaches containers and rotates.
OPENSEARCH_JAVA_OPTS heapSets minimum and maximum JVM heap, with a comment to use at least 50 percent of system RAMSize heap per node role and total host memory, keeping min and max equal. Trade-off: a larger heap leaves less memory for the filesystem cache, and heap above the JVM's compressed pointer range can reduce efficiency.
vm.max_map_count on the hostNot set by the container; the host kernel must allow at least 262144Set the value on every Docker host and persist it outside the container. Trade-off: it is a host-wide kernel change, so coordinate it with other workloads on the same machine.
Named volumes versus bind mountsData paths are mapped to volumes so index data survives container recreationUse named volumes for data on a single host, or bind mounts when backups and disk monitoring must target a known host path. Trade-off: bind mounts depend on host paths and ownership, while named volumes are harder to inspect directly.
Security plugin configuration filesDemo certificates and a demo security configuration for quick startReplace demo certificates and security files with your own TLS material and role mappings, mounted read-only. Trade-off: every change to security configuration must be versioned and reapplied, and mistakes can lock out administrators.
Container resource limitsUsually no memory limit beyond the hostSet memory limits that leave room for heap plus off-heap memory, and confirm the container sees the intended RAM. Trade-off: a limit set too low causes the kernel to kill the process.
Restart policy and node nameMinimal restart behavior and generic node namesSet a restart policy and stable node names so the cluster recognizes nodes after restarts. Trade-off: stable names must be planned with the topology, and renaming later requires care.
Heap for dedicated versus combined rolesSingle-node style defaults for trial useConfirm which role each container plays before choosing heap. Trade-off: a combined node needs more memory than a dedicated cluster manager, so ask your team to confirm the topology first.

How the host, container, volumes and security plugin fit together

The flow starts on the host, where vm.max_map_count must be set before the container starts. The OpenSearch container then reads its JVM heap options from OPENSEARCH_JAVA_OPTS and the admin password from OPENSEARCH_INITIAL_ADMIN_PASSWORD, while the security plugin applies TLS to node and client traffic. Data lands on a persistent volume outside the container layer, and clients reach only the REST port. Check each boundary: the host kernel setting, the container network, and the TLS-protected client path.

Host kernel, container, data volume and client access boundaries for a single OpenSearch node.

Replacing demo security settings before go-live

The demo security configuration is a starting point for trying OpenSearch, not an identity design you can take to production. It creates a built-in admin account, ships with demo certificates that no one in your organization trusts or rotates, and assumes that users are managed inside the cluster. Before go-live, you need to decide where people and services authenticate (SAML, OpenID Connect, LDAP or Active Directory), how those identities map to OpenSearch roles, and where audit logs go. The OPENSEARCH_INITIAL_ADMIN_PASSWORD variable only gets the cluster started, so treat it as a bootstrap secret and plan its removal from day-to-day use once your identity backend is in place. Confirm with your security team which authentication backend is authoritative and who approves role mappings before anyone edits the security configuration.

Secret handling deserves the same review as the identity design. The admin password should not sit in plain text in a committed docker-compose.yml, in a shared .env file or in shell history. Use your existing secrets manager or the orchestrator's secret mechanism to inject it at start, restrict who can read the host's environment, and record a rotation procedure for the admin credential and any certificate private keys. Ask your team to confirm how container inspection exposes environment variables on your hosts, because docker inspect output is often more widely readable than the compose file itself. The password complexity rule supplied for the demo configuration means your secrets process must generate strong values, not just accept whatever a person types.

TLS for both node-to-node transport and client traffic must be planned as part of the same change. Demo certificates cannot be reused, so decide which certificate authority issues the node and admin certificates, how hostnames in the subject alternative names match the container networking you run, and how renewal will happen without a cluster restart. Mount the certificates and keys as read-only volumes with restrictive file permissions, and keep the CA private key off the cluster hosts. The security plugin topic covers the configuration details for identity backends, TLS settings and roles, so use it as the next read once these decisions are written down.

Operational risks of running OpenSearch in containers

Most OpenSearch container failures in production trace back to a handful of host, configuration and data decisions made during the first deployment. Each card below names one risk, the control that addresses it, and what to check before the cluster takes real traffic.

Host kernel setting missing

The container image does not change the host kernel. OpenSearch needs vm.max_map_count set to at least 262144 on the Docker host, and a new host or a rebuilt virtual machine often lacks it. Set the value through the host's sysctl configuration so it survives reboots, and confirm it on every node before first start. A node that fails at boot for this reason is easy to diagnose only if someone knows to look at the host.

Docker install docs

Heap set without node role

The sample compose file sets minimum and maximum heap through OPENSEARCH_JAVA_OPTS, with a comment to use at least 50 percent of system RAM. That guidance is a starting point, not a sizing rule. A data node with heavy indexing, a coordinating node and a dedicated cluster manager need different heap and memory limits. Decide the role of each container first, then set heap and the container memory limit together so the JVM never competes with the operating system for memory.

Volumes lost on recreation

Data written to a container's writable layer disappears when the container is removed or recreated during an image upgrade. Map the data directory to named volumes or host paths on every data node, and confirm the path in the compose file matches the path OpenSearch writes to. Test a recreate of one node and check that its shards return from the volume, because a volume that is declared but not mounted gives no protection.

Demo certificates left in place

The demo security configuration ships with sample certificates and users intended for evaluation only. Replace them with certificates issued from your own certificate authority, set a strong initial admin password through OPENSEARCH_INITIAL_ADMIN_PASSWORD, and remove demo users you do not need. Ask who owns certificate renewal and where the private keys are stored. Demo material copied into a production image is one of the easiest findings for a security reviewer to spot.

Demo configuration docs

Image tags drifting across environments

A latest tag or an unpinned minor version lets development, staging and production run different OpenSearch builds, and a restart can pull a newer image than the one tested. Pin the exact image tag in every compose file, store it in version control, and promote the same tag through each environment. Plan upgrades as deliberate changes that go through the upgrade method you chose, not as side effects of a pull.

No tested snapshot repository

Volumes protect a node from restarts, not from deletion, corruption or a bad index operation. Without a registered snapshot repository, the only recovery path is rebuilding from source data. Register a repository on storage outside the cluster, schedule snapshots, and restore a snapshot into a test cluster on a regular basis. Ask the team who can restore, how long a restore takes at your data volume, and whether the repository location is reachable from every node.

Questions teams ask about OpenSearch on Docker in production

Is Docker a supported way to run OpenSearch in production?

Yes, the OpenSearch install documentation covers Docker alongside Helm, the OpenSearch Kubernetes Operator, tarball, RPM and Debian packages, an Ansible playbook and Windows, so Docker is one documented route among several. Whether it fits depends on how your team already runs containers, how many nodes you need and who owns the host. Docker runs the same OpenSearch software, but production readiness comes from what surrounds the container: host kernel settings, persistent volumes, TLS, a supplied admin password, backups and monitoring. Read the installation documentation and confirm the image tag and compose layout you plan to use against the version you intend to run.

What drives the cost and effort of running OpenSearch on Docker?

The main drivers are the number of nodes, how many roles each node carries, the security configuration, the data volume and retention, and how much of the surrounding platform you build. OpenSearch itself is released under the Apache License, Version 2.0, so software licensing is not a cost line. Costs come from infrastructure you provision, the people who design and operate the cluster, and any partner work. One-time work includes the initial build, TLS, identity integration and backup testing. Recurring work includes patching, version upgrades, capacity growth and monitoring. Ask any quote to itemize these separately.

What does the client team need to provide for a Docker deployment?

The client team typically provides the hosts or cloud instances, the container runtime, persistent storage, network rules between clients and nodes, DNS names, certificate authority or certificate workflow, and an identity provider if you want single sign-on. You also need people who can approve the design, own the admin credentials and run the change process. Confirm with your security team how secrets such as the initial admin password are stored and rotated, and who has access to the host. Your team should also state retention, backup location and recovery expectations before build work starts, since those decisions shape the volumes and snapshot repositories.

Can an internal team deploy OpenSearch on Docker without outside help?

An internal team with Linux, container and search operations experience can deploy a single-host or small test cluster from the documentation alone. Production is harder because it requires decisions about node roles, shard allocation, heap sizing, backup, upgrades and access control, which the sample configuration does not make for you. Teams without recent OpenSearch operations experience often bring in outside help for the design and the first deployment, then keep the cluster in house. Weigh the skills you have against the number of clusters, the compliance evidence you must produce and how quickly you need the first production cluster running.

How long does a first OpenSearch Docker deployment take?

Duration depends on scope: the number of clusters and nodes, whether Dashboards is included, how many identity backends you integrate, how TLS is issued, and whether backup and monitoring are part of the first release. A single development node with default settings can be running quickly, while a multi-node production cluster with SSO, roles, audit logging and tested snapshots takes considerably longer, mostly in design reviews, access approvals and testing. No duration figure has been established for this topic, so ask any provider for a timeline tied to a written scope, with the dependencies on your identity, network and change teams listed as separate milestones.

When should a team move OpenSearch from Docker to Kubernetes or packages?

Move when the operational model you need no longer fits a standalone container host. Kubernetes becomes the better fit when your platform team already runs clusters, wants declarative management, and needs the OpenSearch Kubernetes Operator or Helm charts to handle scaling and configuration. Package installs on systemd hosts suit teams that manage virtual machines with existing configuration tooling and want the Ansible playbook or RPM and Debian packages. Plan the migration around your data: a rolling upgrade, snapshot and restore, or Migration Assistant each carries different downtime and effort. Review the installation options before choosing.

What host and container settings must be right before the first start?

Three settings cause most first-start failures. The host needs vm.max_map_count set to at least 262144, even when you use the Docker image. The compose file sets minimum and maximum JVM heap through OPENSEARCH_JAVA_OPTS, and its comment advises at least 50 percent of system RAM, so confirm the value fits the host and leaves room for the operating system. Since OpenSearch 2.12, the demo security configuration requires OPENSEARCH_INITIAL_ADMIN_PASSWORD with 8 to 100 characters rated strong by zxcvbn, or the cluster fails to start. Store that value in your secrets system, not in the compose file, and check that data volumes persist across container restarts.

What to confirm in your environment before you deploy

A Docker deployment inherits decisions made by your platform team, your security team and your release process. The cards below list what to confirm before the first container starts, so the sample compose file is not the only design input.

Image tag and release policy

Pin an explicit OpenSearch image tag instead of a floating tag, and check it against the OpenSearch releases page before you choose it. Confirm which minor versions are still under maintenance, since maintenance covers bug fixes and security patches but no new features. Agree who approves minor version bumps and how often your team tests them against a copy of production data.

OpenSearch releases

Host kernel setting approval

Setting vm.max_map_count to at least 262144 happens on the host, not inside the container, so the Docker image alone does not satisfy it. Ask your platform team whether they allow changes to host kernel parameters, and whether the change is persisted through configuration management and survives reboots. Record who owns the setting so a new host does not fail at first start.

Docker install docs

Memory for heap and file system

Set OPENSEARCH_JAVA_OPTS with equal minimum and maximum heap values, and confirm the host has enough RAM left for the operating system and the file system cache that search and indexing depend on. The sample file's comment suggests at least 50 percent of system RAM for the heap, so check that figure against your node size and the other containers on the host. Confirm the heap is not set above what your memory limit allows.

Orchestrator or host restrictions

Find out whether your container runtime, orchestrator or security policy blocks privileged changes or the sysctl call the host setting needs. Some hardened hosts and managed container platforms ignore host-level tuning or restrict containers from changing kernel parameters. If the setting cannot be applied, plan a different host or a supported deployment method before you rely on the compose file.

Plugins and identity backends

List the identity sources you must use, such as SAML, OpenID Connect, Active Directory, LDAP, Kerberos or JSON Web Token authentication, and the roles and audit logging your security team requires. Confirm which Security plugin settings you will change from the demo configuration, and who owns TLS certificates and the admin credential after first start. Decide these before users are onboarded, not after.

OpenSearch security docs

Upgrade and migration method

Decide now how you will move to later versions, because the method affects how volumes and images are organized. OpenSearch documents rolling upgrades, snapshot and restore, remote reindexing and Migration Assistant, and each suits different source versions and downtime limits. Confirm that your volumes can be snapshotted and restored, and that someone owns the upgrade calendar for each minor release.

Migrate or upgrade docs

Keeping a container deployment on a supported version

A container deployment is only as supported as the image tag it runs, so plan the version cycle before the first production start. OpenSearch versions stay under maintenance until the next major version enters maintenance or one year passes, whichever is longer. During maintenance they receive bug fixes and security patches but no new features. Version 1 reached end of life on May 6, 2025, and version 2 is maintained through the 4.0 GA release. Pin the image tag in your compose file or chart values, record which minor version each cluster runs, and check the OpenSearch releases page on a fixed schedule against the support window of that line. Because OpenSearch targets a new minor version about every eight weeks, a tag that is current today can drift behind within a few release cycles if nobody owns the calendar.

OpenSearch documents four upgrade and migration methods: rolling upgrades, snapshot and restore, remote reindexing and Migration Assistant. Rolling upgrades suit a cluster already on a supported version that can tolerate node-by-node change while it stays in service. Snapshot and restore fits a move into a fresh cluster with a planned cutover window, and it depends on a snapshot repository that your Docker hosts can reach. Remote reindexing copies data from a remote cluster into a new one and suits cases where indices cannot be carried over in place. Migration Assistant can move workloads across several major versions in one step and supports live traffic capture for low or zero downtime. The source version and your downtime tolerance decide which path is possible, so confirm both before you choose an image tag strategy.

Before you commit to a method, confirm the source version against the compatibility statements in the OpenSearch migrate or upgrade docs, and check the Migration Assistant guidance if you are coming from an older release. Ask your team to write down the maximum acceptable write interruption, the rollback point, and who approves the image change. In a Docker deployment, an upgrade also touches the host, the OPENSEARCH_JAVA_OPTS heap settings, the vm.max_map_count value and the volumes that hold data, so rehearse the change in a non-production environment that mirrors those settings.

How DeployOpen scopes and delivers OpenSearch on Docker

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For OpenSearch on Docker, we start from a written scope that covers the admin password, heap sizing, host settings, volumes and the security plugin, then build and hand over a cluster your team can operate.

How we scope

  • We confirm the OpenSearch version, Docker host layout and the hosts that will run each container before any build starts.
  • The written scope lists security plugin configuration, identity backends, TLS, volume layout and host settings for your environment.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work begins.
  • We identify which items need your input, such as identity provider details, certificate authority and storage locations.

How we build

  • We set the initial admin password through a secret store rather than a plain compose file, and confirm it meets the documented requirements.
  • We size JVM heap variables against the RAM each host provides and apply the host kernel setting on every Docker node.
  • We configure named volumes or bind mounts, backup paths and the security plugin with roles, TLS and audit logging.
  • We test startup, restarts, failed node behavior and access controls before the cluster is handed over.

How we hand over

  • You receive the compose or deployment files, configuration, and a record of each setting and why it was chosen.
  • Runbooks cover startup order, password rotation, heap changes, host settings and volume backup and restore steps.
  • We document the upgrade path for each OpenSearch minor version, including how to test the new image before rollout.
  • Your team gets a walkthrough so the people who will run the cluster can verify and change it without us.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped to your OpenSearch version and environment.
  • Retainers can cover patching during maintenance releases, which receive bug fixes and security patches but no new features.
  • Security testing of the deployed cluster can be scheduled after handover to confirm access controls still hold.
  • Ask any provider to confirm in writing who maintains the compose files, host configuration and backup procedures after go-live.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.