- OpenSearch: 2.17.1
- Elastic OSS (legacy): 7.10.2
- Elastic Stack: 8.15.2
Choose the stack you want to explore:
-
Elastic Stack (Latest) - Modern Elasticsearch with Kibana
- Best for: Learning latest features, production use with licensing
- Port: 9200 (HTTPS), Kibana: 5601
-
OpenSearch - Open-source alternative to Elasticsearch
- Best for: Open-source projects, AWS compatibility
- Port: 9200 (HTTPS), Dashboards: 5601
-
Elastic OSS (Legacy) - Elasticsearch 7.10.2 OSS
- Best for: Supporting legacy 7.x applications, no authentication
- Port: 9200 (HTTP)
| Feature | Elastic Stack (Latest) | OpenSearch | Elastic OSS (Legacy) |
|---|---|---|---|
| Version | 8.15.2 | 2.17.1 | 7.10.2 |
| License | SSPL / Elastic License | Apache 2.0 | Apache 2.0 |
| Security | ✅ Built-in (Basic Auth, TLS) | ✅ Built-in | ❌ Not included |
| Protocol | HTTPS | HTTPS | HTTP |
| UI | Kibana | OpenSearch Dashboards | Kibana OSS |
| Use Case | Latest features, commercial support | Fully open-source, AWS ecosystem | Legacy 7.x support |
| Authentication | Required (elastic/elastic) | Required (admin/strong-password) | Not required |
| Updates | Active development | Active development | No updates (frozen) |
| Plugins | Extensive ecosystem | Growing ecosystem | Limited (7.x only) |
| Memory Usage | ~2-3GB | ~4GB | ~1GB |
| Best For Students | Learning modern features | Open-source projects | Simple setup, testing |
When to use each:
- Elastic Stack: You want to learn the latest Elasticsearch features and don't mind the licensing
- OpenSearch: You prefer truly open-source software or plan to deploy on AWS
- Elastic OSS: You need compatibility with legacy 7.x applications or want the simplest setup without security
Before running these examples, ensure you have:
- Docker: Version 20.10+ (Install Docker)
- Docker Compose: Version 1.29+ (Install Docker Compose)
- System RAM: Minimum 8GB recommended (4GB absolute minimum)
- Elastic Stack: ~2-3GB
- OpenSearch: ~4GB
- Elastic OSS: ~1GB
- Disk Space: At least 10GB free
- Available Ports: 9200, 5601, 9600
Note for Linux users: You may need to increase vm.max_map_count:
sudo sysctl -w vm.max_map_count=262144Java Heap Sizes Explained:
The different memory configurations reflect realistic usage patterns:
- Elastic Stack (1GB per node): Balanced for production-like testing with security features
- OpenSearch (2GB per node): Higher baseline due to additional built-in features and plugins
- Elastic OSS (512MB per node): Minimal configuration for legacy support and testing
If you have limited RAM (< 8GB), you can reduce these values in the docker-compose.yml files:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # Minimum recommendedYou would need to install Docker and Docker Compose
# Elastic Stack
# The .env file is pre-configured with default credentials (elastic/elastic)
# You can modify them if needed before running
docker compose -f docker/elk/docker-compose.yml --env-file .env up
curl --insecure https://localhost:9200 -u elastic:elastic
# OpenSearch
# The .env file is pre-configured with a strong admin password
# Check OPENSEARCH_INITIAL_ADMIN_PASSWORD in .env file
docker compose -f docker/opensearch/docker-compose.yml --env-file .env up
curl --insecure https://localhost:9200 -u admin:YOUR_PASSWORD_FROM_ENV
# Elasticsearch OSS (do not update OSS version)
docker compose -f docker/elk-oss/docker-compose.yml --env-file .env up
curl http://localhost:9200
After some time you will have Kibana/OpenSearch Dashboards available at this URL
Once your cluster is running, try these basic operations:
Elastic Stack / OpenSearch:
curl --insecure -X PUT "https://localhost:9200/my-first-index" -u elastic:elasticElastic OSS:
curl -X PUT "http://localhost:9200/my-first-index"Elastic Stack / OpenSearch:
curl --insecure -X POST "https://localhost:9200/my-first-index/_doc/1" \
-u elastic:elastic \
-H 'Content-Type: application/json' \
-d '{
"title": "Learning Elasticsearch",
"description": "This is my first document",
"timestamp": "2025-01-15"
}'Elastic OSS:
curl -X POST "http://localhost:9200/my-first-index/_doc/1" \
-H 'Content-Type: application/json' \
-d '{
"title": "Learning Elasticsearch",
"description": "This is my first document",
"timestamp": "2025-01-15"
}'Elastic Stack / OpenSearch:
curl --insecure "https://localhost:9200/my-first-index/_search?q=Learning" -u elastic:elasticElastic OSS:
curl "http://localhost:9200/my-first-index/_search?q=Learning"- Open http://localhost:5601/ in your browser
- For Elastic Stack: Login with
elastic/elastic - For OpenSearch: Login with
admin/<password-from-env> - For Elastic OSS: No login required
- Go to Dev Tools (Console) to run queries interactively
- Try creating visualizations and dashboards
# List all indices
curl --insecure "https://localhost:9200/_cat/indices?v" -u elastic:elastic
# Check cluster health
curl --insecure "https://localhost:9200/_cluster/health?pretty" -u elastic:elastic
# Get document by ID
curl --insecure "https://localhost:9200/my-first-index/_doc/1" -u elastic:elastic
# Delete an index
curl --insecure -X DELETE "https://localhost:9200/my-first-index" -u elastic:elasticAfter recent changes announced for Elastic to move its product to SSPL licence, I would strongly recommend to keep using truly open source version of it. Not only it has security features available for free, but also it doesn't have any strings attached to it via SSPL licence.
Read more on this here
Want to compare performance between different stacks? Use these benchmarking tools:
Use ESRally - the official Elasticsearch benchmarking tool.
Install:
pip3 install esrallyRun benchmark:
# For Elastic Stack (with authentication)
esrally race --track=geonames --target-hosts=localhost:9200 --pipeline=benchmark-only \
--client-options="use_ssl:true,verify_certs:false,basic_auth_user:'elastic',basic_auth_password:'elastic'"
# For Elastic OSS (no authentication)
esrally race --track=geonames --target-hosts=localhost:9200 --pipeline=benchmark-onlyUse OpenSearch Benchmark - compatible with OpenSearch.
Install:
pip install opensearch-benchmarkRun benchmark:
opensearch-benchmark execute-test --workload=geonames --target-hosts=localhost:9200 --pipeline=benchmark-only \
--client-options="use_ssl:true,verify_certs:false,basic_auth_user:'admin',basic_auth_password:'YOUR_PASSWORD_FROM_ENV'"Available workloads: geonames, http_logs, nyc_taxis, percolator, and more. See workload repository for details.
Compare results between stacks and create your own test experiments!
If you see an error like "port is already allocated":
# Check what's using the port
sudo lsof -i :9200
sudo lsof -i :5601
# Stop any existing Elasticsearch/Kibana processes
docker compose down
# Or use different ports by modifying docker-compose.ymlIf containers crash with OOM errors:
-
Reduce Java heap size in docker-compose.yml:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # Reduce from 1G or 2G
-
Increase Docker memory limit:
- Docker Desktop: Settings → Resources → Memory (set to 6GB+)
- Linux: Docker uses host memory directly
-
Run only one stack at a time to reduce memory usage
Error: max virtual memory areas vm.max_map_count [65530] is too low
Temporary fix:
sudo sysctl -w vm.max_map_count=262144Permanent fix:
echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pIf curl commands fail:
- Wait for services to start - initial startup can take 2-5 minutes
- Check container health:
docker compose ps docker compose logs
- Verify correct protocol: Elastic Stack and OpenSearch use HTTPS, Elastic OSS uses HTTP
For two-node clusters, both nodes must start successfully:
-
Check logs:
docker compose logs es01 docker compose logs es02
-
Clean restart:
docker compose down -v # Warning: deletes all data docker compose up
If you see SSL/TLS errors:
- Certificates are auto-generated on first run
- If corrupted, remove and regenerate:
docker compose down -v docker volume rm elk_certs # if exists docker compose up
Error: Cannot connect to the Docker daemon
# Start Docker
sudo systemctl start docker # Linux
# or open Docker Desktop (Mac/Windows)
# Verify Docker is running
docker psIf you run low on disk space:
# Remove all stopped containers and unused volumes
docker system prune -a --volumes
# Check Docker disk usage
docker system dfTo stop services and preserve data:
docker compose downTo stop services and remove all data:
docker compose down -vTo remove everything and start fresh:
docker compose down -v
docker system prune -aIf you want to contribute to this repository:
-
Fork and clone the repository
-
Install pre-commit hooks for code quality:
pip install pre-commit pre-commit install
-
Make your changes to docker compose files, documentation, or configurations
-
Test your changes by running the affected stack(s)
-
Submit a Pull Request with a clear description
This repository uses pre-commit hooks to maintain code quality:
- check-yaml: Validates YAML syntax
- end-of-file-fixer: Ensures files end with newline
- trailing-whitespace: Removes trailing spaces
- black: Python code formatter
- isort: Sorts Python imports
- flake8: Python linter
To run manually before committing:
pre-commit run --all-filesThis repository includes automated testing to ensure all stacks work correctly.
GitHub Actions automatically tests all three stacks on every push and pull request:
- ✅ YAML validation
- ✅ Each stack starts successfully
- ✅ Cluster health checks pass
- ✅ Index operations work (create, insert, search)
- ✅ UI (Kibana/Dashboards) is accessible
Test all stacks locally using the validation script:
Install dependencies:
pip install -r requirements.txtRun validation:
# Test all stacks
python validate.py --stack all
# Test specific stack
python validate.py --stack elk-oss
python validate.py --stack opensearch
python validate.py --stack elasticThe validation script checks:
- Stack starts successfully
- Cluster responds and is healthy
- Can create indices
- Can index documents
- Can search documents
- UI is accessible
Note: The script automatically cleans up Docker volumes after testing. Use --no-cleanup to preserve volumes.
flavours-of-elastic/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI pipeline
├── docker/
│ ├── elk/ # Elastic Stack (latest)
│ ├── opensearch/ # OpenSearch
│ └── elk-oss/ # Elastic OSS (7.10.2 legacy)
├── benchmarks/ # Benchmark results
├── .env # Environment configuration
├── .env.example # Template for configuration
├── validate.py # Validation script for local testing
├── requirements.txt # Python dependencies
└── ISSUES.md # Tracked issues and improvements
When updating Elastic or OpenSearch versions:
- Update version in
.envfile - Update version in
README.md(Versions section) - Test all three stacks to ensure compatibility
- Update
ISSUES.mdif new issues are discovered - Commit with clear message:
feat: update <stack> to <version>
- Elasticsearch Official Documentation
- OpenSearch Documentation
- Kibana Guide
- OpenSearch Dashboards
- Docker Compose Documentation
See LICENSE file for details.