# Can not start Kibana if the default port for elasticsearch is changed

**URL:** <https://discuss.elastic.co/t/can-not-start-kibana-if-the-default-port-for-elasticsearch-is-changed/238697>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [June 25, 2020, 2:31pm UTC](https://discuss.elastic.co/t/can-not-start-kibana-if-the-default-port-for-elasticsearch-is-changed/238697 "2020-06-25T14:31:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashrafuzzaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashrafuzzaman/32/71128_2.png) [@ashrafuzzaman](https://discuss.elastic.co/u/ashrafuzzaman)\
**Post date:** [June 25, 2020, 2:31pm UTC](https://discuss.elastic.co/t/can-not-start-kibana-if-the-default-port-for-elasticsearch-is-changed/238697/1 "2020-06-25T14:31:49Z")

</div>

I am using the composer shared [here](https://www.elastic.co/guide/en/apm/get-started/current/quick-start-overview.html).

The composer works until I change the default port of elasticsearch to something else and updating the port reference.

Here is my compose file,

```auto
version: '2.2'
services:
  apm-server:
    image: docker.elastic.co/apm/apm-server:7.8.0
    depends_on:
      elasticsearch:
        condition: service_healthy
      kibana:
        condition: service_healthy
    cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"]
    cap_drop: ["ALL"]
    ports:
    - 8200:8200
    networks:
    - elastic
    command: >
       apm-server -e
         -E apm-server.rum.enabled=true
         -E setup.kibana.host=kibana:5601
         -E setup.template.settings.index.number_of_replicas=0
         -E apm-server.kibana.enabled=true
         -E apm-server.kibana.host=kibana:5601
         -E output.elasticsearch.hosts=["elasticsearch:9210"]
    healthcheck:
      interval: 10s
      retries: 12
      test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
    environment:
    - bootstrap.memory_lock=true
    - cluster.name=docker-cluster
    - cluster.routing.allocation.disk.threshold_enabled=false
    - discovery.type=single-node
    - ES_JAVA_OPTS=-XX:UseAVX=2 -Xms1g -Xmx1g
    ulimits:
      memlock:
        hard: -1
        soft: -1
    volumes:
    - esdata:/usr/share/elasticsearch/data
    ports:
    - 9210:9200
    networks:
    - elastic
    healthcheck:
      interval: 20s
      retries: 10
      test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'

  kibana:
    image: docker.elastic.co/kibana/kibana:7.8.0
    depends_on:
      elasticsearch:
        condition: service_healthy
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9210
      ELASTICSEARCH_HOSTS: http://elasticsearch:9210
    ports:
    - 5601:5601
    networks:
    - elastic
    healthcheck:
      interval: 10s
      retries: 20
      test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status

volumes:
  esdata:
    driver: local

networks:
  elastic:
    driver: bridge

```

---

<div class="post-metadata">

**Author:** ![ashrafuzzaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashrafuzzaman/32/71128_2.png) [@ashrafuzzaman](https://discuss.elastic.co/u/ashrafuzzaman)\
**Post date:** [June 29, 2020, 7:49pm UTC](https://discuss.elastic.co/t/can-not-start-kibana-if-the-default-port-for-elasticsearch-is-changed/238697/2 "2020-06-29T19:49:06Z")

</div>

Within the docker container the port is 9200, kibana and apm-server needs to point to 9200.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 27, 2020, 7:49pm UTC](https://discuss.elastic.co/t/can-not-start-kibana-if-the-default-port-for-elasticsearch-is-changed/238697/3 "2020-07-27T19:49:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
