{"id":28299678,"url":"https://github.com/selcuktatar/docker-elk","last_synced_at":"2026-05-08T07:31:57.261Z","repository":{"id":47611386,"uuid":"398597680","full_name":"selcuktatar/docker-elk","owner":"selcuktatar","description":"Basic Version","archived":false,"fork":false,"pushed_at":"2021-10-17T01:02:27.000Z","size":20,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-13T03:44:07.916Z","etag":null,"topics":["docker","docker-compose","elasticsearch","kibana","logstash"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selcuktatar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-21T15:52:05.000Z","updated_at":"2022-01-20T09:05:04.000Z","dependencies_parsed_at":"2022-09-23T13:51:17.945Z","dependency_job_id":null,"html_url":"https://github.com/selcuktatar/docker-elk","commit_stats":null,"previous_names":["selcuktatar/docker-elk"],"tags_count":0,"template":false,"template_full_name":"deviantony/docker-elk","purl":"pkg:github/selcuktatar/docker-elk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuktatar%2Fdocker-elk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuktatar%2Fdocker-elk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuktatar%2Fdocker-elk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuktatar%2Fdocker-elk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selcuktatar","download_url":"https://codeload.github.com/selcuktatar/docker-elk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuktatar%2Fdocker-elk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32770988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","elasticsearch","kibana","logstash"],"created_at":"2025-05-23T10:13:31.721Z","updated_at":"2026-05-08T07:31:57.242Z","avatar_url":"https://github.com/selcuktatar.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elastic stack (ELK) on Docker\n\n[![Elastic Stack version](https://img.shields.io/badge/Elastic%20Stack-7.14.0-00bfb3?style=flat\u0026logo=elastic-stack)](https://www.elastic.co/blog/category/releases)\n[![Build Status](https://github.com/deviantony/docker-elk/workflows/CI/badge.svg?branch=main)](https://github.com/deviantony/docker-elk/actions?query=workflow%3ACI+branch%3Amain)\n[![Join the chat at https://gitter.im/deviantony/docker-elk](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/deviantony/docker-elk?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nRun the latest version of the [Elastic stack][elk-stack] with Docker and Docker Compose.\n\nIt gives you the ability to analyze any data set by using the searching/aggregation capabilities of Elasticsearch and\nthe visualization power of Kibana.\n\n*:information_source: The Docker images backing this stack include [X-Pack][xpack] with [paid features][paid-features]\nenabled by default (see [How to disable paid features](#how-to-disable-paid-features) to disable them). **The [trial\nlicense][trial-license] is valid for 30 days**. After this license expires, you can continue using the free features\nseamlessly, without losing any data.*\n\nBased on the official Docker images from Elastic:\n\n* [Elasticsearch](https://github.com/elastic/elasticsearch/tree/master/distribution/docker)\n* [Logstash](https://github.com/elastic/logstash/tree/master/docker)\n* [Kibana](https://github.com/elastic/kibana/tree/master/src/dev/build/tasks/os_packages/docker_generator)\n\nOther available stack variants:\n\n* [`tls`](https://github.com/deviantony/docker-elk/tree/tls): TLS encryption enabled in Elasticsearch.\n* [`searchguard`](https://github.com/deviantony/docker-elk/tree/searchguard): Search Guard support\n\n---\n\n## Philosophy\n\nWe aim at providing the simplest possible entry into the Elastic stack for anybody who feels like experimenting with\nthis powerful combo of technologies. This project's default configuration is purposely minimal and unopinionated. It\ndoes not rely on any external dependency or custom automation to get things up and running.\n\nInstead, we believe in good documentation so that you can use this repository as a template, tweak it, and make it _your\nown_. [sherifabdlnaby/elastdocker][elastdocker] is one example among others of project that builds upon this idea.\n\n---\n\n## Contents\n\n1. [Requirements](#requirements)\n   * [Host setup](#host-setup)\n   * [SELinux](#selinux)\n   * [Docker for Desktop](#docker-for-desktop)\n     * [Windows](#windows)\n     * [macOS](#macos)\n1. [Usage](#usage)\n   * [Version selection](#version-selection)\n   * [Bringing up the stack](#bringing-up-the-stack)\n   * [Cleanup](#cleanup)\n   * [Initial setup](#initial-setup)\n     * [Setting up user authentication](#setting-up-user-authentication)\n     * [Injecting data](#injecting-data)\n     * [Default Kibana index pattern creation](#default-kibana-index-pattern-creation)\n1. [Configuration](#configuration)\n   * [How to configure Elasticsearch](#how-to-configure-elasticsearch)\n   * [How to configure Kibana](#how-to-configure-kibana)\n   * [How to configure Logstash](#how-to-configure-logstash)\n   * [How to disable paid features](#how-to-disable-paid-features)\n   * [How to scale out the Elasticsearch cluster](#how-to-scale-out-the-elasticsearch-cluster)\n   * [How to reset a password programmatically](#how-to-reset-a-password-programmatically)\n1. [Extensibility](#extensibility)\n   * [How to add plugins](#how-to-add-plugins)\n   * [How to enable the provided extensions](#how-to-enable-the-provided-extensions)\n1. [JVM tuning](#jvm-tuning)\n   * [How to specify the amount of memory used by a service](#how-to-specify-the-amount-of-memory-used-by-a-service)\n   * [How to enable a remote JMX connection to a service](#how-to-enable-a-remote-jmx-connection-to-a-service)\n1. [Going further](#going-further)\n   * [Plugins and integrations](#plugins-and-integrations)\n   * [Swarm mode](#swarm-mode)\n\n## Requirements\n\n### Host setup\n\n* [Docker Engine](https://docs.docker.com/install/) version **17.05** or newer\n* [Docker Compose](https://docs.docker.com/compose/install/) version **1.20.0** or newer\n* 1.5 GB of RAM\n\n*:information_source: Especially on Linux, make sure your user has the [required permissions][linux-postinstall] to\ninteract with the Docker daemon.*\n\nBy default, the stack exposes the following ports:\n\n* 5044: Logstash Beats input\n* 5000: Logstash TCP input\n* 9600: Logstash monitoring API\n* 9200: Elasticsearch HTTP\n* 9300: Elasticsearch TCP transport\n* 5601: Kibana\n\n**:warning: Elasticsearch's [bootstrap checks][booststap-checks] were purposely disabled to facilitate the setup of the\nElastic stack in development environments. For production setups, we recommend users to set up their host according to\nthe instructions from the Elasticsearch documentation: [Important System Configuration][es-sys-config].**\n\n### SELinux\n\nOn distributions which have SELinux enabled out-of-the-box you will need to either re-context the files or set SELinux\ninto Permissive mode in order for docker-elk to start properly. For example on Redhat and CentOS, the following will\napply the proper context:\n\n```console\n$ chcon -R system_u:object_r:admin_home_t:s0 docker-elk/\n```\n\n### Docker for Desktop\n\n#### Windows\n\nEnsure the [Shared Drives][win-shareddrives] feature is enabled for the `C:` drive.\n\n#### macOS\n\nThe default Docker for Mac configuration allows mounting files from `/Users/`, `/Volumes/`, `/private/`, and `/tmp`\nexclusively. Make sure the repository is cloned in one of those locations or follow the instructions from the\n[documentation][mac-mounts] to add more locations.\n\n## Usage\n\n### Version selection\n\nThis repository tries to stay aligned with the latest version of the Elastic stack. The `main` branch tracks the current\nmajor version (7.x).\n\nTo use a different version of the core Elastic components, simply change the version number inside the `.env` file. If\nyou are upgrading an existing stack, please carefully read the note in the next section.\n\n**:warning: Always pay attention to the [official upgrade instructions][upgrade] for each individual component before\nperforming a stack upgrade.**\n\nOlder major versions are also supported on separate branches:\n\n* [`release-6.x`](https://github.com/deviantony/docker-elk/tree/release-6.x): 6.x series\n* [`release-5.x`](https://github.com/deviantony/docker-elk/tree/release-5.x): 5.x series (End-Of-Life)\n\n### Bringing up the stack\n\nClone this repository onto the Docker host that will run the stack, then start services locally using Docker Compose:\n\n```console\n$ docker-compose up\n```\n\nYou can also run all services in the background (detached mode) by adding the `-d` flag to the above command.\n\n**:warning: You must rebuild the stack images with `docker-compose build` whenever you switch branch or update the\nversion of an already existing stack.**\n\nIf you are starting the stack for the very first time, please read the section below attentively.\n\n### Cleanup\n\nElasticsearch data is persisted inside a volume by default.\n\nIn order to entirely shutdown the stack and remove all persisted data, use the following Docker Compose command:\n\n```console\n$ docker-compose down -v\n```\n\n## Initial setup\n\n### Setting up user authentication\n\n*:information_source: Refer to [How to disable paid features](#how-to-disable-paid-features) to disable authentication.*\n\nThe stack is pre-configured with the following **privileged** bootstrap user:\n\n* user: *elastic*\n* password: *changeme*\n\nAlthough all stack components work out-of-the-box with this user, we strongly recommend using the unprivileged [built-in\nusers][builtin-users] instead for increased security.\n\n1. Initialize passwords for built-in users\n\n    ```console\n    $ docker-compose exec -T elasticsearch bin/elasticsearch-setup-passwords auto --batch\n    ```\n\n    Passwords for all 6 built-in users will be randomly generated. Take note of them.\n\n1. Unset the bootstrap password (_optional_)\n\n    Remove the `ELASTIC_PASSWORD` environment variable from the `elasticsearch` service inside the Compose file\n    (`docker-compose.yml`). It is only used to initialize the keystore during the initial startup of Elasticsearch.\n\n1. Replace usernames and passwords in configuration files\n\n    Use the `kibana_system` user (`kibana` for releases \u003c7.8.0) inside the Kibana configuration file\n    (`kibana/config/kibana.yml`) and the `logstash_system` user inside the Logstash configuration file\n    (`logstash/config/logstash.yml`) in place of the existing `elastic` user.\n\n    Replace the password for the `elastic` user inside the Logstash pipeline file (`logstash/pipeline/logstash.conf`).\n\n    *:information_source: Do not use the `logstash_system` user inside the Logstash **pipeline** file, it does not have\n    sufficient permissions to create indices. Follow the instructions at [Configuring Security in Logstash][ls-security]\n    to create a user with suitable roles.*\n\n    See also the [Configuration](#configuration) section below.\n\n1. Restart Kibana and Logstash to apply changes\n\n    ```console\n    $ docker-compose restart kibana logstash\n    ```\n\n    *:information_source: Learn more about the security of the Elastic stack at [Tutorial: Getting started with\n    security][sec-tutorial].*\n\n### Injecting data\n\nGive Kibana about a minute to initialize, then access the Kibana web UI by opening \u003chttp://localhost:5601\u003e in a web\nbrowser and use the following credentials to log in:\n\n* user: *elastic*\n* password: *\\\u003cyour generated elastic password\u003e*\n\nNow that the stack is running, you can go ahead and inject some log entries. The shipped Logstash configuration allows\nyou to send content via TCP:\n\n```console\n# Using BSD netcat (Debian, Ubuntu, MacOS system, ...)\n$ cat /path/to/logfile.log | nc -q0 localhost 5000\n```\n\n```console\n# Using GNU netcat (CentOS, Fedora, MacOS Homebrew, ...)\n$ cat /path/to/logfile.log | nc -c localhost 5000\n```\n\nYou can also load the sample data provided by your Kibana installation.\n\n### Default Kibana index pattern creation\n\nWhen Kibana launches for the first time, it is not configured with any index pattern.\n\n#### Via the Kibana web UI\n\n*:information_source: You need to inject data into Logstash before being able to configure a Logstash index pattern via\nthe Kibana web UI.*\n\nNavigate to the _Discover_ view of Kibana from the left sidebar. You will be prompted to create an index pattern. Enter\n`logstash-*` to match Logstash indices then, on the next page, select `@timestamp` as the time filter field. Finally,\nclick _Create index pattern_ and return to the _Discover_ view to inspect your log entries.\n\nRefer to [Connect Kibana with Elasticsearch][connect-kibana] and [Creating an index pattern][index-pattern] for detailed\ninstructions about the index pattern configuration.\n\n#### On the command line\n\nCreate an index pattern via the Kibana API:\n\n```console\n$ curl -XPOST -D- 'http://localhost:5601/api/saved_objects/index-pattern' \\\n    -H 'Content-Type: application/json' \\\n    -H 'kbn-version: 7.14.0' \\\n    -u elastic:\u003cyour generated elastic password\u003e \\\n    -d '{\"attributes\":{\"title\":\"logstash-*\",\"timeFieldName\":\"@timestamp\"}}'\n```\n\nThe created pattern will automatically be marked as the default index pattern as soon as the Kibana UI is opened for the\nfirst time.\n\n## Configuration\n\n*:information_source: Configuration is not dynamically reloaded, you will need to restart individual components after\nany configuration change.*\n\n### How to configure Elasticsearch\n\nThe Elasticsearch configuration is stored in [`elasticsearch/config/elasticsearch.yml`][config-es].\n\nYou can also specify the options you want to override by setting environment variables inside the Compose file:\n\n```yml\nelasticsearch:\n\n  environment:\n    network.host: _non_loopback_\n    cluster.name: my-cluster\n```\n\nPlease refer to the following documentation page for more details about how to configure Elasticsearch inside Docker\ncontainers: [Install Elasticsearch with Docker][es-docker].\n\n### How to configure Kibana\n\nThe Kibana default configuration is stored in [`kibana/config/kibana.yml`][config-kbn].\n\nIt is also possible to map the entire `config` directory instead of a single file.\n\nPlease refer to the following documentation page for more details about how to configure Kibana inside Docker\ncontainers: [Install Kibana with Docker][kbn-docker].\n\n### How to configure Logstash\n\nThe Logstash configuration is stored in [`logstash/config/logstash.yml`][config-ls].\n\nIt is also possible to map the entire `config` directory instead of a single file, however you must be aware that\nLogstash will be expecting a [`log4j2.properties`][log4j-props] file for its own logging.\n\nPlease refer to the following documentation page for more details about how to configure Logstash inside Docker\ncontainers: [Configuring Logstash for Docker][ls-docker].\n\n### How to disable paid features\n\nSwitch the value of Elasticsearch's `xpack.license.self_generated.type` option from `trial` to `basic` (see [License\nsettings][trial-license]).\n\n### How to scale out the Elasticsearch cluster\n\nFollow the instructions from the Wiki: [Scaling out Elasticsearch](https://github.com/deviantony/docker-elk/wiki/Elasticsearch-cluster)\n\n### How to reset a password programmatically\n\nIf for any reason your are unable to use Kibana to change the password of your users (including [built-in\nusers][builtin-users]), you can use the Elasticsearch API instead and achieve the same result.\n\nIn the example below, we reset the password of the `elastic` user (notice \"/user/elastic\" in the URL):\n\n```console\n$ curl -XPOST -D- 'http://localhost:9200/_security/user/elastic/_password' \\\n    -H 'Content-Type: application/json' \\\n    -u elastic:\u003cyour current elastic password\u003e \\\n    -d '{\"password\" : \"\u003cyour new password\u003e\"}'\n```\n\n## Extensibility\n\n### How to add plugins\n\nTo add plugins to any ELK component you have to:\n\n1. Add a `RUN` statement to the corresponding `Dockerfile` (eg. `RUN logstash-plugin install logstash-filter-json`)\n1. Add the associated plugin code configuration to the service configuration (eg. Logstash input/output)\n1. Rebuild the images using the `docker-compose build` command\n\n### How to enable the provided extensions\n\nA few extensions are available inside the [`extensions`](extensions) directory. These extensions provide features which\nare not part of the standard Elastic stack, but can be used to enrich it with extra integrations.\n\nThe documentation for these extensions is provided inside each individual subdirectory, on a per-extension basis. Some\nof them require manual changes to the default ELK configuration.\n\n## JVM tuning\n\n### How to specify the amount of memory used by a service\n\nBy default, both Elasticsearch and Logstash start with [1/4 of the total host\nmemory](https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html#default_heap_size) allocated to\nthe JVM Heap Size.\n\nThe startup scripts for Elasticsearch and Logstash can append extra JVM options from the value of an environment\nvariable, allowing the user to adjust the amount of memory that can be used by each component:\n\n| Service       | Environment variable |\n|---------------|----------------------|\n| Elasticsearch | ES_JAVA_OPTS         |\n| Logstash      | LS_JAVA_OPTS         |\n\nTo accomodate environments where memory is scarce (Docker for Mac has only 2 GB available by default), the Heap Size\nallocation is capped by default to 256MB per service in the `docker-compose.yml` file. If you want to override the\ndefault JVM configuration, edit the matching environment variable(s) in the `docker-compose.yml` file.\n\nFor example, to increase the maximum JVM Heap Size for Logstash:\n\n```yml\nlogstash:\n\n  environment:\n    LS_JAVA_OPTS: -Xmx1g -Xms1g\n```\n\n### How to enable a remote JMX connection to a service\n\nAs for the Java Heap memory (see above), you can specify JVM options to enable JMX and map the JMX port on the Docker\nhost.\n\nUpdate the `{ES,LS}_JAVA_OPTS` environment variable with the following content (I've mapped the JMX service on the port\n18080, you can change that). Do not forget to update the `-Djava.rmi.server.hostname` option with the IP address of your\nDocker host (replace **DOCKER_HOST_IP**):\n\n```yml\nlogstash:\n\n  environment:\n    LS_JAVA_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=18080 -Dcom.sun.management.jmxremote.rmi.port=18080 -Djava.rmi.server.hostname=DOCKER_HOST_IP -Dcom.sun.management.jmxremote.local.only=false\n```\n\n## Going further\n\n### Plugins and integrations\n\nSee the following Wiki pages:\n\n* [External applications](https://github.com/deviantony/docker-elk/wiki/External-applications)\n* [Popular integrations](https://github.com/deviantony/docker-elk/wiki/Popular-integrations)\n\n### Swarm mode\n\nExperimental support for Docker [Swarm mode][swarm-mode] is provided in the form of a `docker-stack.yml` file, which can\nbe deployed in an existing Swarm cluster using the following command:\n\n```console\n$ docker stack deploy -c docker-stack.yml elk\n```\n\nIf all components get deployed without any error, the following command will show 3 running services:\n\n```console\n$ docker stack services elk\n```\n\n*:information_source: To scale Elasticsearch in Swarm mode, configure seed hosts with the DNS name `tasks.elasticsearch`\ninstead of `elasticsearch`.*\n\n[elk-stack]: https://www.elastic.co/what-is/elk-stack\n[xpack]: https://www.elastic.co/what-is/open-x-pack\n[paid-features]: https://www.elastic.co/subscriptions\n[trial-license]: https://www.elastic.co/guide/en/elasticsearch/reference/current/license-settings.html\n\n[elastdocker]: https://github.com/sherifabdlnaby/elastdocker\n\n[linux-postinstall]: https://docs.docker.com/install/linux/linux-postinstall/\n\n[booststap-checks]: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html\n[es-sys-config]: https://www.elastic.co/guide/en/elasticsearch/reference/current/system-config.html\n\n[win-shareddrives]: https://docs.docker.com/docker-for-windows/#shared-drives\n[mac-mounts]: https://docs.docker.com/docker-for-mac/osxfs/\n\n[builtin-users]: https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-users.html\n[ls-security]: https://www.elastic.co/guide/en/logstash/current/ls-security.html\n[sec-tutorial]: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-getting-started.html\n\n[connect-kibana]: https://www.elastic.co/guide/en/kibana/current/connect-to-elasticsearch.html\n[index-pattern]: https://www.elastic.co/guide/en/kibana/current/index-patterns.html\n\n[config-es]: ./elasticsearch/config/elasticsearch.yml\n[config-kbn]: ./kibana/config/kibana.yml\n[config-ls]: ./logstash/config/logstash.yml\n\n[es-docker]: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html\n[kbn-docker]: https://www.elastic.co/guide/en/kibana/current/docker.html\n[ls-docker]: https://www.elastic.co/guide/en/logstash/current/docker-config.html\n\n[log4j-props]: https://github.com/elastic/logstash/tree/7.6/docker/data/logstash/config\n[esuser]: https://github.com/elastic/elasticsearch/blob/7.6/distribution/docker/src/docker/Dockerfile#L23-L24\n\n[upgrade]: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html\n\n[swarm-mode]: https://docs.docker.com/engine/swarm/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselcuktatar%2Fdocker-elk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselcuktatar%2Fdocker-elk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselcuktatar%2Fdocker-elk/lists"}