Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the port number for Docker image of Kibana

I am running Kibana using Docker

Below is the docker-compose that I am using for running Kibana Fluentd and Elastic-Search.

version: '2'
services:
  elasticsearch:
    image: elasticsearch
    expose:
      - 9200
    ports:
      - "9200:9200"
    networks:
      - cloud      


  fluentd:
    build: ./fluentd
    volumes:
      - ./fluentd/conf:/fluentd/etc
    links:
      - "elasticsearch"
    ports:
      - "24224:24224"
      - "24224:24224/udp"
    networks:
      - cloud  


  kibana:
    image: kibana
    links:
      - "elasticsearch"
    ports:
      - "9201:5601"
    networks:
      - cloud

networks:
  cloud:
   driver: bridge  

My Problem statement is as below:

I want to run the Kibana on 9201 port. I have mention the same in docker-compose.yml still It get run on its default port 5601

enter image description here

Please Let me know what changes I need to do for running Kibana on 9201

like image 244
nikita kakraniya Avatar asked Sep 03 '25 06:09

nikita kakraniya


1 Answers

Use this:

kibana:
image: kibana
links:
  - "elasticsearch"
ports:
  - "9201:5601"
networks:
  - cloud

Edit :

Explanation : Your service kabana is running on the port 5601 of the container. So

ports:
   -"9201:5601"

links the port 5601 of the container to the port 9201 of the host machine.

like image 132
Vamsi Avatar answered Sep 04 '25 21:09

Vamsi