Jelly
Jelly

Reputation: 1296

Grafana from docker image: can't enter grafana homepage at localhost

I successfully run Grafana-server from image. Docker-compose:

version: '2.1'

   services:

      grafana:
        image: grafana/grafana:6.7.2
        container_name: grafana
        ports:
        - '3000:5432'

Last entry of log output:

HTTP Server Listen    logger=http.server address=[::]:3000 protocol=http subUrl= socket=

But I can't enter in Grafana-IU at http://localhost:3000. Error: "Cant connect to server localhost"

Upvotes: 1

Views: 1607

Answers (1)

Hans Kilian
Hans Kilian

Reputation: 25070

By default, the Grafana image listens on port 3000, so you need to map port 3000 to whatever port you want to use on the host. If you want to use port 3000 like it looks like from what you've tried, both port numbers should be 3000 like this

version: '2.1'

   services:

      grafana:
        image: grafana/grafana:6.7.2
        container_name: grafana
        ports:
        - '3000:3000'

Upvotes: 2

Related Questions