How to access Grafana from another computer

Hi Everyone,

I am new to Grafana. I have installed Grafana on Centos 7 and then trying to access it from another windows desktop as https:grafana-ip:3000. But, I was unable to reach the grafana home page.

As, am new I have a feeling that am missing some link here. Do I need to do any configuration before accessing the grafana-server from the remote desktop.

I am sorry if it is a basic question. Hope I will get some response.

Best regards and Thanks in advance

Did you mean to specify https? Does it work if you use http?
Presumably you have not literally used grafana-ip but have used the ip address of the machine running grafana.
What do you see in the browser when you try to connect.
Can you ping the grafana machine from the remote machine using the ip?

Firstly it should not be HTTPS, it’s just HTTP.

Secondly, and I’m assuming you literally quoted what you’re typing into the
browser here, it should be HTTP://grafana-ip:3000 The two slashes are
important.

Finally, can you ping the IP address of your Centos machien from your Windows
desktop? Check the basic networking.

Regards,

Antony.

Hi @pooh,
I met the same issue.
And I can ping the IP address and using HTTP also.
But still can’t get into the login page.
Do u know how to solve this?
Cheers
Yang

Hi @pooh,
I met the same issue.
And I can ping the IP address

Good, so basic networking is functional.

and using HTTP also.

Please explain exactly what you mean by that - how are you testing HTTP
connectivity?

But still can’t get into the login page.

What happens when you try? Do you get an error message, do you see some page
which is not the login page, do you get a timeout, what?

Do u know how to solve this?

Firstly, can you make sure that Grafana is listening on the IP address you are
trying to connect to: SSH as root to the machine Grafana is running on and
type “netstat -lptn”. Look for a line with “:3000” in the “Local Address”
column (it should also have “grafana-server” in the “PID/Program name”
column).

What is in front of the “:3000”?

  • if it’s “127.0.0.1”, then Grafana is listening on IPv4 locahost only and
    you need to tell it to listen on the IP address you’re trying to connect to.

  • if it’s “::1”, then it’s doing the same thing but for IPv6

  • if it’s “0.0.0.0” then it’s listening on all IPv4 addresses, so this is not
    the problem (unless you’re trying to connect by IPv6)

  • if it’s “::” then it’s listening on all IPv4 and IPv6 addresses, so again,
    this is not the problem.

Regards,

Antony.

I’m working through the same issue. My grafana server is fit4.local

I can ping fit4.local from my terminal
I can also get its IP and ping that

What I cannot seem to do is get to the hosted grafana page at either
http://fit4.local:3000
or
http://192.168.0.137:3000 (the ip listed is the local address of the server)

When checking netstat I see this in the :3000 line:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp6 0 0 :::3000 :::* LISTEN -

I’m a bit confused as to why. Any ideas?

Welcome @marcagrossman to the Grafana forum.

Can you post the [server] section of your grafana.ini file?

#################################### Server ####################################
[server]
# Protocol (http, https, h2, socket)
;protocol = http

# This is the minimum TLS version allowed. By default, this value is empty. Accepted values are: TLS1.2, TLS1.3. If nothing is set TLS1.2 would be taken
;min_tls_version = ""

# The ip address to bind to, empty will bind to all interfaces
;http_addr =

# The http port  to use
;http_port = 3000

# The public facing domain name used to access grafana from a browser
;domain = localhost

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = %(protocol)s://%(domain)s:%(http_port)s/

# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false

# Log web requests
;router_logging = false

# the path relative working path
;static_root_path = public

# enable gzip
;enable_gzip = false

# https certs & key file
;cert_file =
;cert_key =

# Certificates file watch interval
;certs_watch_interval =

# Unix socket gid
# Changing the gid of a file without privileges requires that the target group is in the group of the process and that the process is the file owner
# It is recommended to set the gid as http server user gid
# Not set when the value is -1
;socket_gid =

# Unix socket mode
;socket_mode =

# Unix socket path
;socket =

# CDN Url
;cdn_url =

# Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming request and closing idle connections.
# `0` means there is no timeout for reading the request.
;read_timeout = 0

# This setting enables you to specify additional headers that the server adds to HTTP(S) responses.
[server.custom_response_headers]
#exampleHeader1 = exampleValue1
#exampleHeader2 = exampleValue2

Ok. I’ve made it a bit farther along and this is what it looks like now:

#################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
;data = /var/lib/grafana

# Temporary files in `data` directory older than given duration will be removed
;temp_data_lifetime = 24h

# Directory where grafana can store logs
;logs = /var/log/grafana

# Directory where grafana will automatically scan and look for plugins
;plugins = /var/lib/grafana/plugins

# folder that contains provisioning config files that grafana will apply on startup and while running.
;provisioning = conf/provisioning

Hi @marcagrossman

Can you try changing root_url to http://fit4.local:3000 and see if that changes anything?

Also, which version of Grafana are you running?

you have commented out every single setting in the ini file

That was true initially and when I noticed that I made some changes. However, there is this confusing line at the top:

##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to
# change

To me that meant that nothing had to be uncommented.

Then copying and pasting into here something went wrong and I seem to have copied the wrong section. Here is what it looks like now:

#################################### Server ####################################
[server]
# Protocol (http, https, h2, socket)
;protocol = http
protocol = https

# This is the minimum TLS version allowed. By default, this value is empty. Accepted values are: TLS1>
;min_tls_version = ""

# The ip address to bind to, empty will bind to all interfaces
;http_addr =

# The http port  to use
;http_port = 3000
http_port = 443
;https_port = 443

# The public facing domain name used to access grafana from a browser
domain = localhost

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://fit4.local:443

# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for com>
;serve_from_sub_path = false

# Log web requests
;router_logging = false

# the path relative working path
;static_root_path = public

# enable gzip
;enable_gzip = false

# https certs & key file
cert_file = /etc/grafana/grafana.crt
cert_key = /etc/grafana/grafana.key

# Certificates file watch interval
;certs_watch_interval =

# Unix socket gid
# Changing the gid of a file without privileges requires that the target group is in the group of the>
# It is recommended to set the gid as http server user gid
# Not set when the value is -1
;socket_gid =

# Unix socket mode
;socket_mode =

# Unix socket path
;socket =

# CDN Url
;cdn_url =

# Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming req>
# `0` means there is no timeout for reading the request.
;read_timeout = 0

# This setting enables you to specify additional headers that the server adds to HTTP(S) responses.
[server.custom_response_headers]
#exampleHeader1 = exampleValue1
#exampleHeader2 = exampleValue2

I noticed you specified http_port (not https_port), indicating you are using http, but you also provided paths for grafana.crt and grafana.key. Have you indeed set up everything required for https?

1 Like