Unable to view web UI after running Docker-Compose from tutorial

Hey all,

I’ve recently been following the Graylog tutorial in an attempt to set up a logging system for my company. After copying the segment below from the tutorial into a docker_compose.yml file

version: '2'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongodb:
    image: mongo:3
  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4
    environment:
      - http.host=0.0.0.0
      - transport.host=localhost
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 1g
  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog:3.0
    environment:
      # CHANGE ME (must be at least 16 characters)!
      - GRAYLOG_PASSWORD_SECRET=somepasswordpepper
      # Password: admin
      - GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
      - GRAYLOG_HTTP_BIND_ADDRESS=127.0.0.1:9000
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
    links:
      - mongodb:mongo
      - elasticsearch
    depends_on:
      - mongodb
      - elasticsearch
    ports:
      # Graylog web interface and REST API
      - 9000:9000
      # Syslog TCP
      - 514:514
      # Syslog UDP
      - 514:514/udp
      # GELF TCP
      - 12201:12201
      # GELF UDP
      - 12201:12201/udp

I ran docker-compose up and attempted to view the web UI in mozilla firefox by going to 172.25.0.4:9000/ where 172.25.0.4 is the IP of the docker container which I obtained by doing docker inspect.

When I run curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Requested-By: cli' 'https://172.25.0.4:9000/api/system/sessions' -d '{"username":"admin", "password":"admin", "host":""}' I get a connection refused error as well. I have also attempted doing all of the above with the 127.0.0.1 ip address too but I haven’t had any success.

I wanted to check if anyone happens to know what’s wrong with the above set-up and what I should do to get Graylog to work.
Thanks!

you need to provide some more information …

is the IP 172.25.0.4 something you can reach from your browser? If yes, why you not bind your Interface to that IP?

Where is Graylog running on what host? That UI needs to be reachable by your browser so it needs to listen on an IP that is in a TCP Network reachable.

I am able to ping 172.25.0.4. This IP is the IP that docker has assigned to the Graylog container. Graylog is running on the docker container which I have launched via the sample docker-compose script provided in the tutorial.

      - GRAYLOG_HTTP_BIND_ADDRESS=127.0.0.1:9000
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/

But your docker Container is configured to run in 127.0.0.1 the docker-compose from the documentation is created to make Graylog run and reachable on localhost on your desktop for example. You need to adjust the settings to your local needs.

Yea, sorry I am stuck here too… I’m not entirely sure how to make the greylog web port available to devices on my LAN.

I tried setting what you have in italics above to the IP address of the host running my docker images. But that didn’t seem to work…

if you only have one network interface in your docker container:

GRAYLOG_HTTP_BIND_ADDRESS=0.0.0.0:9000

remove GRAYLOG_HTTP_EXTERNAL_URI

Read the documentation of those two parameters to understand why: http://docs.graylog.org/en/3.0/pages/configuration/server.conf.html#web-rest-api

Yup, figured that out last night (related to why it wasn’t starting up properly for me). Thanks!

This fix worked great for me too. Thanks!

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