OpenSearch + Dashboards
Open source search and analytics suite.
Overview
OpenSearch is a community-driven, open source search and analytics suite derived from Elasticsearch 7.10.2 and Kibana 7.10.2. Created by Amazon as a response to Elastic's license change, OpenSearch maintains full compatibility with the Elasticsearch REST APIs while remaining under the Apache 2.0 license. It provides distributed search capabilities, real-time analytics, and machine learning features for handling large-scale data workloads across various use cases from log analytics to application search.
This deployment consists of two services: a single-node OpenSearch cluster configured for standalone operation, and OpenSearch Dashboards for data visualization and cluster management. The OpenSearch service runs with 512MB heap memory allocation and operates in single-node discovery mode, making it suitable for development, testing, or small production workloads. The dashboards service connects directly to the OpenSearch instance over HTTPS, providing a web-based interface for data exploration, visualization creation, and cluster administration.
This configuration is ideal for teams migrating from Elasticsearch who want to maintain API compatibility, organizations requiring open source search solutions without licensing restrictions, and developers building search-driven applications. The combination provides both the search engine capabilities and the visualization tools needed for comprehensive data analysis workflows, from ingesting documents to creating interactive dashboards and monitoring search performance.
Key Features
- Full Elasticsearch REST API compatibility for seamless migration from existing applications
- Built-in security with TLS encryption and authentication enabled by default
- Real-time search and analytics with support for complex queries and aggregations
- Machine learning capabilities including anomaly detection and k-NN search
- Index State Management (ISM) for automated lifecycle policies and data retention
- Performance analyzer for monitoring cluster health and query performance
- Cross-cluster replication support for disaster recovery and data distribution
- Plugin architecture with support for custom analyzers, processors, and extensions
Common Use Cases
- 1Application search functionality for e-commerce, content management, or documentation platforms
- 2Log analytics and monitoring for DevOps teams collecting application and infrastructure logs
- 3Business intelligence dashboards combining search results with data visualizations
- 4Security information and event management (SIEM) for analyzing security logs and alerts
- 5Real-time analytics for user behavior tracking and product recommendation engines
- 6Migration testing environment for teams moving away from Elastic Stack
- 7Development and staging environments requiring lightweight search infrastructure
Prerequisites
- Minimum 2GB RAM available for containers (512MB each for OpenSearch JVM plus overhead)
- Docker host with vm.max_map_count set to at least 262144 for OpenSearch memory mapping
- Ports 9200, 9600, and 5601 available on the host system
- ADMIN_PASSWORD environment variable set with at least 8 characters including uppercase, lowercase, and numbers
- Understanding of Elasticsearch query DSL and index management concepts
- Basic knowledge of Lucene query syntax for search operations
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 opensearch: 3 image: opensearchproject/opensearch:latest4 environment: 5 - cluster.name=opensearch-cluster6 - node.name=opensearch-node7 - discovery.type=single-node8 - bootstrap.memory_lock=true9 - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m10 - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${ADMIN_PASSWORD}11 ulimits: 12 memlock: 13 soft: -114 hard: -115 nofile: 16 soft: 6553617 hard: 6553618 volumes: 19 - opensearch-data:/usr/share/opensearch/data20 ports: 21 - "9200:9200"22 - "9600:9600"23 networks: 24 - opensearch-network25 restart: unless-stopped2627 dashboards: 28 image: opensearchproject/opensearch-dashboards:latest29 environment: 30 - OPENSEARCH_HOSTS=["https://opensearch:9200"]31 ports: 32 - "5601:5601"33 depends_on: 34 - opensearch35 networks: 36 - opensearch-network37 restart: unless-stopped3839volumes: 40 opensearch-data: 4142networks: 43 opensearch-network: 44 driver: bridge.env Template
.env
1# OpenSearch2ADMIN_PASSWORD=SecurePassword123!34# Password requirements:5# Min 8 chars, uppercase, lowercase, number, special charUsage Notes
- 1OpenSearch at https://localhost:9200
- 2Dashboards at http://localhost:5601
- 3Default user: admin
- 4REST API compatible
- 5Kibana alternative
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
opensearch
opensearch:
image: opensearchproject/opensearch:latest
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node
- discovery.type=single-node
- bootstrap.memory_lock=true
- OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${ADMIN_PASSWORD}
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data:/usr/share/opensearch/data
ports:
- "9200:9200"
- "9600:9600"
networks:
- opensearch-network
restart: unless-stopped
dashboards
dashboards:
image: opensearchproject/opensearch-dashboards:latest
environment:
- OPENSEARCH_HOSTS=["https://opensearch:9200"]
ports:
- "5601:5601"
depends_on:
- opensearch
networks:
- opensearch-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 opensearch:5 image: opensearchproject/opensearch:latest6 environment:7 - cluster.name=opensearch-cluster8 - node.name=opensearch-node9 - discovery.type=single-node10 - bootstrap.memory_lock=true11 - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m12 - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${ADMIN_PASSWORD}13 ulimits:14 memlock:15 soft: -116 hard: -117 nofile:18 soft: 6553619 hard: 6553620 volumes:21 - opensearch-data:/usr/share/opensearch/data22 ports:23 - "9200:9200"24 - "9600:9600"25 networks:26 - opensearch-network27 restart: unless-stopped2829 dashboards:30 image: opensearchproject/opensearch-dashboards:latest31 environment:32 - OPENSEARCH_HOSTS=["https://opensearch:9200"]33 ports:34 - "5601:5601"35 depends_on:36 - opensearch37 networks:38 - opensearch-network39 restart: unless-stopped4041volumes:42 opensearch-data:4344networks:45 opensearch-network:46 driver: bridge47EOF4849# 2. Create the .env file50cat > .env << 'EOF'51# OpenSearch52ADMIN_PASSWORD=SecurePassword123!5354# Password requirements:55# Min 8 chars, uppercase, lowercase, number, special char56EOF5758# 3. Start the services59docker compose up -d6061# 4. View logs62docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/opensearch-complete/run | bashTroubleshooting
- OpenSearch fails to start with memory errors: Increase Docker memory limits or adjust OPENSEARCH_JAVA_OPTS heap size
- Dashboards shows 'Unable to connect to OpenSearch' error: Verify opensearch service is healthy and check network connectivity between containers
- Authentication failed with admin user: Ensure ADMIN_PASSWORD environment variable is set and meets complexity requirements
- Bootstrap check failures on startup: Set vm.max_map_count=262144 on Docker host system using sysctl
- Port binding errors on 9200 or 5601: Check for conflicting services and ensure ports are not already in use
- Low disk watermark exceeded warnings: Monitor opensearch-data volume usage and configure appropriate disk space
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
opensearchopensearch-dashboards
Tags
#opensearch#elasticsearch#analytics#search#dashboards
Category
Database StacksAd Space
Shortcuts: C CopyF FavoriteD Download