I currently have InfluxDB feeding dashboards in Grafana. I will eventually be deploying this stack on a server.
However, the default port for Grafana is 80. I must change this port, but I don't know how. Can anyone help out?
Thanks.
I currently have InfluxDB feeding dashboards in Grafana. I will eventually be deploying this stack on a server.
However, the default port for Grafana is 80. I must change this port, but I don't know how. Can anyone help out?
Thanks.
Not only change in /etc/grafana/grafana.ini
you have to change in
/usr/share/grafana/conf/defaults.ini
and /usr/share/grafana/conf/sample.ini
files. Just search 3000
port(which is default port for grafana) in these three files and replace it with your preferred port.
Here's the easiest way I found.
docker run -d \
-p 2345:2345 \
--name grafana \
-e "GF_SERVER_HTTP_PORT=2345" \
grafana/grafana
See the documentation here.
https://grafana.com/docs/grafana/latest/installation/docker/#configuration
Since Grafana 2.0:
Grafana now ships with its own backend server
You can edit /etc/grafana/grafana.ini (usual location) and change the running port:
[server]
http_port=1234
/etc/grafana.ini
. –
Kurtzman If you are using Linux, you can change the default port by changing the port from /etc/grafana/grafana.ini
. There is no separate custom.ini
for Linux. For Windows, MacOS or any other platform, check the official documentation.
For opening grafana.ini
, you would need sudo
privileges. For changing the port please follow the steps below.
sudo gedit /etc/grafana/grafana.ini
in a new Terminal window.3000
in the `.ini. file and you will find a line similar to the one shown below.# The http port to use
;http_port = 3000
;
) and change the port to the port that you wish to run the grafana server on.sudo systemctl restart grafana-server
.The grafana server should be started on the port that you provided. Please note that you will have to write systemctl
or service
depending upon your init system. To determine your init system, run ps --no-headers -o comm 1
.
For those using Docker:
Create a grafana.ini
:
[server]
http_port = 1234
Update your Dockerfile:
FROM grafana/grafana
EXPOSE 1234
ADD grafana.ini /etc/grafana
Build and run the container:
docker build grafana
docker run \
-d \
-p 1234:1234 \
--name grafana \
grafana/grafana
The EXPOSE
is technically optional but is good practice for documentation.
For Linux, I grab the setup file form here https://grafana.com/grafana/download?platform=linux
Then install it!
You only need to change this one /usr/share/grafana/conf/defaults.ini
:
Replace:
http_port = 3000
With
http_port = YourPortYouWant
Then restart your app:
sudo service grafana-server stop
sudo service grafana-server start
To verify you should run:
sudo service grafana-server status
Then you can see the app lives in your desired port:
Open up localhost:yourport
to see the result.
I think the document from Grafana should be updated.
On windows,
For Windows 10 and Grafana v7.1.1, the following steps made the Grafana to be served in different port:
The Grafana url is now hosted in "http://localhost:3001/?orgId=1"
I know its old thread but for me in Mac i had to make changes at 2 places.
I installed through Brew
/usr/local/etc/grafana/grafana.ini
/usr/local/Cellar/grafana/8.1.5/share/grafana/conf/defaults.ini
Grafana just runs behind a standard web server, like apache. If you are using apache, just update your virtual hosts file to use whatever port you want, and restart apache. Grafana will then be on the new port.
© 2022 - 2024 — McMap. All rights reserved.