{"id":23069356,"url":"https://github.com/lhsradek/platypus-lhsdock","last_synced_at":"2026-05-09T14:34:08.784Z","repository":{"id":60125536,"uuid":"519616999","full_name":"lhsradek/platypus-lhsdock","owner":"lhsradek","description":"Platypus-lhsdock  - Elasticsearch cluster","archived":false,"fork":false,"pushed_at":"2023-04-16T09:40:50.000Z","size":19344,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T23:23:21.494Z","etag":null,"topics":["apm-server","docker","dokuwiki","elasticsearch","kibana","logstash","nginx-proxy"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/lhsradek.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-30T20:44:13.000Z","updated_at":"2024-01-12T18:34:11.000Z","dependencies_parsed_at":"2023-02-10T06:01:18.347Z","dependency_job_id":null,"html_url":"https://github.com/lhsradek/platypus-lhsdock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsradek%2Fplatypus-lhsdock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsradek%2Fplatypus-lhsdock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsradek%2Fplatypus-lhsdock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsradek%2Fplatypus-lhsdock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lhsradek","download_url":"https://codeload.github.com/lhsradek/platypus-lhsdock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246981136,"owners_count":20863825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["apm-server","docker","dokuwiki","elasticsearch","kibana","logstash","nginx-proxy"],"created_at":"2024-12-16T06:14:51.067Z","updated_at":"2026-05-09T14:34:08.731Z","avatar_url":"https://github.com/lhsradek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### platypus-lhsdock\n\nwith Elasticsearch, Logstash and Kibana ([ELK](https://www.elastic.co/))\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/lhsradek/lhsdock)](https://hub.docker.com/repository/docker/lhsradek/lhsdock)\n\n#### setup\ncreate .env file\n\n```# cp .env.dist .env```\n\n```# bin/install```\n\nThis part will produce volumes. After install elastic itself will run without other services. You can set the users, rights, find out the cluster uuid... I still use ```lhsdock``` on another computer, where it is not necessary to run e.g. Kibana. It is possible that this part is enough.\n\n```# bin/setup```\n\nThis section will add additional services to docker-compose. If you don't want one, just comment out the file in ```bin/setup```. It is important that, for example, Kibana does not start before the Kibana user has a password set. That's why the install part is separate and not all together in one docker-compose. At the moment, e.g. logstash is turned off like this because I have one right in the traefik project and I don't need another one. You may find it useful to uncomment the line to add logstash to docker-compose. If you don't need wiki or cerebro, you can comment these lines. I find it easier to comment out just lines in ```bin/setup``` than entire long sections in docker-compose.\nFor example, when I debug only logstash I don't need to run Kibana and other services. Then I comment out the lines and re-build docker-compose by ```bin/setup```.\n\n```# bin/setup-fleet``` or ```# bin/setup-eps```\n\nIt adds Fleet server or Enterprise search, which I usually don't use and which helped me configure other services. I wondered for a long time why e.g. Kibana tells me to turn on APM when I already had it set up. This was because no one was sending data to the APM server.\n\nThe ```install```, ```setup``` and ```all-remove``` parts first shut down the project and then prompt to delete docker-compose. They don't delete it straight away, because you can have important changes in it which you test with a restart. Running the command again after docker-compose has been deleted will only do the action. Existing docker-compose also works as a lock against unwanted ```all-remove``` for example. The project just stops and can be started again. Make changes in the files that are in the [compose directory](https://github.com/lhsradek/platypus-lhsdock/tree/main/compose) and from which docker-compose is compiled. The docker-compose divided into several parts allows me better scalability.\n\nSee:\n* https://github.com/lhsradek/platypus-lhsdock/tree/main/extras/dokuwiki/config/dokuwiki/data/pages\n* [Lightweight version](https://github.com/lhsradek/platypus-platel)\n\n#### run lhsdock\n```# bin/start```\n\n#### restart lhsdock\n```# bin/restart```\n\n```\n================= STOP =================\nStopping lhsdock-eps       ... done\nStopping lhsdock-fleet     ... done\nStopping lhsdock-cerebro   ... done\nStopping lhsdock-kibana    ... done\nStopping lhsdock-heartbeat ... done\nStopping lhsdock-logstash  ... done\nStopping lhsdock-es03      ... done\nStopping lhsdock-es02      ... done\nStopping lhsdock-wiki      ... done\nStopping lhsdock-web       ... done\nStopping lhsdock-php       ... done\nStopping lhsdock-es01      ... done\nRemoving lhsdock-eps       ... done\nRemoving lhsdock-fleet     ... done\nRemoving lhsdock-cerebro   ... done\nRemoving lhsdock-kibana    ... done\nRemoving lhsdock-heartbeat ... done\nRemoving lhsdock-logstash  ... done\nRemoving lhsdock-es03      ... done\nRemoving lhsdock-es02      ... done\nRemoving lhsdock-wiki      ... done\nRemoving lhsdock-web       ... done\nRemoving lhsdock-php       ... done\nRemoving lhsdock-es01      ... done\nRemoving lhsdock-setup     ... done\nRemoving network nginx.local\nNetwork traefik.local is external, skipping\n================= START ================\nPulling setup       ... done\nPulling weblhs-php  ... done\nPulling weblhs      ... done\nPulling weblhs-wiki ... done\nPulling es01        ... done\nPulling es02        ... done\nPulling es03        ... done\nPulling cerebro     ... done\nPulling heartbeat   ... done\nPulling kibana      ... done\nPulling logstash    ... done\nPulling fleet       ... done\nPulling eps         ... done\nCreating network \"nginx.local\" with driver \"bridge\"\nCreating lhsdock-setup ... done\nCreating lhsdock-php   ... done\nCreating lhsdock-web   ... done\nCreating lhsdock-es01  ... done\nCreating lhsdock-es02  ... done\nCreating lhsdock-es03      ... done\nCreating lhsdock-wiki  ... done\nCreating lhsdock-kibana    ... done\nCreating lhsdock-cerebro   ... done\nCreating lhsdock-logstash  ... done\nCreating lhsdock-heartbeat ... done\nCreating lhsdock-fleet     ... done\nCreating lhsdock-eps       ... done\n```\n\n#### stop lhsdock\n```# bin/stop```\n\n#### remove lhsdock\n```# bin/all-remove```\n\nThis section deletes the created volumes.\n\n#### Reposirories\n\n| REPOSITORY                                            |  TAG       | SIZE        | OPTIONAL\n| ----------------------------------------------------- | ---------- | ----------- | ----------------\n| nginx:alpine                                          | latest     | 40.7MB      | [platypus-lhsdock](https://github.com/lhsradek/platypus-lhsdock/blob/main/context/Dockerfile)\n| [lhsradek/platypus-fpm](https://github.com/lhsradek/platypus-lhsfpm) [![Docker Pulls](https://img.shields.io/docker/pulls/lhsradek/fpm)](https://hub.docker.com/repository/docker/lhsradek/fpm)  | v1         | 488MB       | php:fpm-alpine\n| [docker.elastic.co/elasticsearch/elasticsearch](https://hub.docker.com/_/elasticsearch) | 8.7.0      | 1.33GB      |\n| [docker.elastic.co/kibana/kibana](https://hub.docker.com/_/kibana) | 8.7.0      | 748MB       |\n| docker.elastic.co/enterprise-search/enterprise-search | 8.7.0      | 1.45GB      |\n| [logstash](https://hub.docker.com/_/logstash)         | 8.7.0      | 732MB       |\n| docker.elastic.co/beats/elastic-agent                 | 8.7.0      | 1.54GB      | \n| docker.elastic.co/beats/elastic-agent-complete for [Elastic Synthetics](https://www.elastic.co/guide/en/observability/current/monitor-uptime-synthetics.html#monitoring-synthetics)              | 8.7.0      | 3.22GB      |\n| docker.elastic.co/apm/apm-server                      | 8.7.0      | 169MB       |\n| docker.elastic.co/beats/metricbeat                    | 8.7.0      | 322MB       |\n| docker.elastic.co/beats/heartbeat                     | 8.7.0      | 2.06GB      |\n| docker.elastic.co/beats/filebeat                      | 8.7.0      | 291MB       |\n| lmenezes/cerebro                                      | 0.9.4      | 284MB       |\n| [lscr.io/linuxserver/dokuwiki](https://hub.docker.com/r/linuxserver/dokuwiki) | latest     | 235MB       |\n\nWith [lhsradek/lhsdock](https://hub.docker.com/repository/docker/lhsradek/lhsdock/) You can use the program [platypus.pl](https://github.com/lhsradek/platypus-lhsdock/blob/main/context/root/bin/platypus.pl) for certificates,\nwhich I don't use much anymore, the Elastic Certificate Tool is used by webservice [setup](https://github.com/lhsradek/platypus-lhsdock/blob/main/compose/docker-setup.yml).\n\n```# perl /root/bin/platypus.pl```\n\n-----\n\n| IMAGES               | PORTS                  | NAMES              | HOSTNAMES                            | OPTIONAL  \n| -------------------- | ---------------------- | ------------------ | ------------------------------------ | --------\n| lhsradek/lhsdock:v3  | 80/tcp, 443/tcp        | lhsdock            | ```docker.nginx.local```             |\n| php:fpm-alpine       | 9000/tcp               | lhsdock-php        | ```weblhs-php.docker.nginx.local```  | \n| elasticsearch        |                        | lhsdock-setup      | ```setup.docker.nginx.local```       | *\n| elasticsearch        | 9200/tcp, 9300/tcp     | lhsdock-es01       | ```es01.docker.nginx.local```        |\n| elasticsearch        | 9201/tcp, 9301/tcp     | lhsdock-es02       | ```es02.docker.nginx.local```        | \n| elasticsearch        | 9202/tcp, 9302/tcp     | lhsdock-es03       | ```es03.docker.nginx.local```        |\n| kibana               | 5601/tcp               | lhsdock-kibana     | ```kibana.docker.nginx.local```      |\n| apm-server           | 5066/tcp, 8200/tcp     | lhsdock-apm-server | ```apm-server.docker.nginx.local```  | *\n| metricbeat           | 5066/tcp               | lhsdock-metricbeat | ```metricbeat.docker.nginx.local```  | * \n| filebeat             | 5066/tcp               | lhsdock-filebeat   | ```filebeat.docker.nginx.local```    | *\n| heartbeat            | 5066/tcp               | lhsdock-heartbeat  | ```heartbeat.docker.nginx.local```   | *\n| enterprise-search    | 3002/tcp               | lhsdock-eps        | ```eps.docker.nginx.local```         | *\n| elastic-agent        | 8200/tcp, 8220/tcp ..  | lhsdock-fleet      | ```fleet.docker.nginx.local```       | *\n| logstash             | 5044/tcp, 9600/tcp     | lhsdock-logstash   | ```logstash.docker.nginx.local```    | *\n| cerebro              | 9000/tcp               | lhsdock-cerebro    | ```cerebro.docker.nginx.local```     | *\n| dokuwiki:latest      | 80/tcp, 443/tcp        | lhsdock-wiki       | ```wiki.docker.nginx.local```        | *\n\n-----\n\n##### Cluster uuid\n\nSet ```CLUSTER_UUID```  in the ```.env``` before the first launch of the Fleet Server.\n\n```\n# curl -s -X GET --cacert certs/ca/ca.crt -u elastic:[KIBANA_PASSWORD] https://es01.docker.nginx.local:9200/?pretty | grep cluster_uuid\n```\n\ndisplay such like this:\n```\n  \"cluster_uuid\" : \"Eft1LUxGR5af29XSygQMHA\",\n```\n\nOr see\n```\n# docker logs -f lhsdock-setup\n```\n\nIn case of any change in the environment variables, the volume of the fleet server must be deleted, the fleet server will be created again and will enroll everything by itself. It is naive to think that variables can be changed additionally. It is always necessary to empty the volume\n\nYou will find an integrations when you first start Kibana and they will have polices set. [See settings.](https://github.com/lhsradek/platypus-lhsdock/blob/main/extras/kibana/kibana.yml)\n\n#### My home network\n\nMy home network consists of two computers running docker. I have two elasticsearch nodes on computer ```docker``` and one node is enough for me on the computer ```www```. Applications from computers can therefore write to their nearest node. That one on ```www``` will be yellow when the main ```docker``` computer is not running. As soon as I release it, the nodes communicate with each other and the cluster turns green. Furthermore, I placed logstash in a project with traefik, so it is easily accessible to other projects that have traefik as the default network. Each project, including traefik, has its own filebeat and metricbeat or fleet server, which takes care of its logs and services. So services and logs are not tested if the project is not running. In a production environment, it would be enough to have only one filebeat and one metricbeat each or one fleet server per computer.\n\nSee:\n* https://github.com/lhsradek/platypus-lhsdock/blob/main/png/cerebro02.png\n* https://github.com/lhsradek/platypus-lhsdock/blob/main/png/diagram.png\n\n#### Setting Fleet Server\n\n##### Elasticsearch\n\nElasticsearch - hosts:\n\n```https://es01.docker.nginx.local:9200```\n\nElasticsearch - Advanced YAML configuration:\n\n```\nssl.certificate_authorities: [\"/usr/share/elastic-agent/certs/ca.crt\"]\ntimeout: 20s\n```\n\n##### Logstash\n\nSee https://www.gooksu.com/2022/05/fleet-server-with-logstash-output-elastic-agent/\n\n\nFor Server SSL certificate authorities (optional) output from\n\n```cat ./certs/ca.crt```\n\nSpecify hosts:\n\n```logstash.docker.nginx.local:5045```\n\nFor Client SSL certificate output from\n\n```cat ./certs/logstash.docker.nginx.local/logstash.docker.nginx.local.crt```\n\nFor Client SSL certificate key output from\n\n```cat ./certs/logstash.docker.nginx.local/logstash.docker.nginx.local.key```\n\nTo logstash output - Advanced YAML configuration add:\n\n```\nssl.verification_mode: none\ntimeout: 20s\n```\n\nDefault for agent integrations interferes with APM, don't change it\n\nSet Make this output the default for agent monitoring.\n\n##### Enrollment token\n\nFor this project In ```.env``` set ```FLEET_ENROLLMENT_TOKEN``` from Enrollment tokens - Agent Nginx policy 1\n\n##### Fleet Server\n\nIn Fleet - Agents add a Fleet Server. Select Advanced Agent Nginx policy 1\nas Fleet Server host select ```https://fleet.docker.nginx.local:8220``` and Add host\n\nGenerate a service token and copy the token to ```FLEET_SERVER_SERVICE_TOKEN``` in ```.env```\nFor this policy set ```FLEET_SERVER_POLICY_ID=agent-nginx-policy-1``` in ```.env```\nIf you would make a new police (for example Agent Nginx policy 2) you need to create a fleet server with a new police\nand edit the .env and set it.\n\nIgnore other advice about enrollment (as curl and sudo elastic-agent enroll...) if the volume for the Fleet Server is empty,\neverything will be created by itself thanks to how the environment variables of the Fleet Service are set in\n[docker-compose file](https://github.com/lhsradek/platypus-lhsdock/blob/main/compose/docker-fleet.yml).\n\nSee:\n* https://github.com/lhsradek/platypus-lhsdock/blob/main/png/fleet01.png\n* https://github.com/lhsradek/platypus-lhsdock/blob/main/png/fleet02.png\n* https://github.com/lhsradek/platypus-lhsdock/blob/main/png/fleet03.png\n* https://github.com/lhsradek/platypus-lhsdock/blob/main/png/fleet04.png\n\nRestart and see how Fleet Server start and enroll.\n\n-----\n\n* https://www.facebook.com/radek.kadner/\n* https://www.linkedin.com/in/radekkadner/\n* mailto:radek.kadner@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhsradek%2Fplatypus-lhsdock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flhsradek%2Fplatypus-lhsdock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhsradek%2Fplatypus-lhsdock/lists"}