title: How to map elasticsearch port from 9200 to 92xx when running in kibana with docker-compose
body: <p>I have a docker-compose.yaml file with elasticsearch and kibana defined.</p>
  
  <p>When I run docker-compose, I will be able to access kibana with the url <a href="http://localhost:8181" rel="nofollow noreferrer">http://localhost:8181</a> with everything running as exepcted. However, my issue is that I do not want to use elasticsearch port 9200 in kibana, I want to use another port (ex. 9201)</p>
  
  <p>How can I make elasticsearch connect in kibana while using a port different than 9200?</p>
  
  <p>I have tried adding the following below but I get an error 
  "Unable to connect to Elasticsearch at <a href="http://elasticsearch:9201" rel="nofollow noreferrer">http://elasticsearch:9201</a>."</p>
  
  <pre><code>elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3
      environment:
          discovery.type: single-node
      ports:
          -"9201:9200"
  
  kibana:
      depends_on:
          - elasticsearch
      image: docker.elastic.co/kibana/kibana-oss:6.2.3
      environment:
          SERVER_NAME: "s_name"
          ELASTICSEARCH_URL: http://elasticsearch:9201
      ports:
          - "8181:5601"
  </code></pre>
  
  <p>The below works fine with port 9200</p>
  
  <pre><code>elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3
      environment:
        discovery.type: single-node
  
  kibana:
      depends_on:
        - elasticsearch
      image: docker.elastic.co/kibana/kibana-oss:6.2.3
      environment:
        SERVER_NAME: "s_name"
        ELASTICSEARCH_URL: http://elasticsearch:9200
      ports:
        - "8181:5601"
  </code></pre>