• caglararli@hotmail.com
  • 05386281520

Safe or not? Elasticsearch on localhost through Docker

Çağlar Arlı      -    18 Views

Safe or not? Elasticsearch on localhost through Docker

I am learning to run Elasticsearch in a Docker container on a laptop. For a start, I expect running it on localhost. The laptop is connected to the Internet.

Is that unsafe? I remember that ipython/jupyter notebooks also run on localhost. The Elastic docs confuses me:

Note that the above command starts the service with authentication and encryption disabled, which means that anyone who connects to the service will be given access... you should never run the service in this way in production, or in a computer that is directly connected to the Internet. - https://www.elastic.co/search-labs/tutorials/install-elasticsearch/docker

To try out Elasticsearch on your own machine, we recommend using Docker and running both Elasticsearch and Kibana... Starting in Elasticsearch 8.0, security is enabled by default. - https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html

And a previous question seems related but is unclear to me. Or perhaps I am asking How can I securely develop a local webapp at a coffee shop?

edit ad Sir Muffington's comment:

# docker-compose.yml
version: '3'
services:
  elasticsearch:
    build:
      context: .
      dockerfile: Dockerfile
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
    container_name: elasticsearch
    ports:
      - "127.0.0.1:9200:9200"