X

How To Quick Install Grafana Server On Ubuntu 18.04

Now I want to share how to install Grafana server on ubuntu 18.04 local or public vps. This tutorial is for only install process. And I am not grantee all package and repo are available. If you can see some package are missing so you can try from official web site.

My server details :

  • Server OS : Ubuntu 18.04
  • Disk Space : 50GB
  • RAM : 2GB
  • vCPU : 2

How To Install Docker Community Edition On Centos 7

How To Upgrade Zabbix Server 4.0 To 4.4 On CentOS 8

Step #01: Must be server update and upgrade done.

root@Ubuntu-18:~# vi /etc/resolv.conf
nameserver 8.8.8.8

For save press Esc type :wq the press Enter.

Step #02: After complete then goto next step for install Grafana

root@Ubuntu-18:~# apt-get install -y apt-transport-https
root@Ubuntu-18:~# apt-get install -y software-properties-common wget
root@Ubuntu-18:~# apt autoremove
root@Ubuntu-18:~# vi /etc/apt/sources.list.d/grafana.list
root@Ubuntu-18:~# deb https://packagecloud.io/grafana/stable/debian/ stretch main
root@Ubuntu-18:~# curl https://packagecloud.io/gpg.key | sudo apt-key add -
root@Ubuntu-18:~# apt-get update
root@Ubuntu-18:~# apt-get install grafana -y

Step #03: Restart and enable Grafana service using below command.

root@Ubuntu-18:~# /bin/systemctl daemon-reload
root@Ubuntu-18:~# /bin/systemctl enable grafana-server
root@Ubuntu-18:~# /bin/systemctl start grafana-server
root@Ubuntu-18:~# systemctl start grafana-server
root@Ubuntu-18:~# systemctl status grafana-server

Status like below :

 grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-04-26 05:35:51 UTC; 44min ago
     Docs: http://docs.grafana.org
 Main PID: 7358 (grafana-server)
    Tasks: 15 (limit: 1101)
   CGroup: /system.slice/grafana-server.service
           └─7358 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:default.paths.logs

Apr 26 05:35:53 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:35:53+0000 lvl=info msg="Initializing provisioningServiceImpl" logger=server
Apr 26 05:35:53 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:35:53+0000 lvl=info msg="Backend rendering via phantomJS" logger=rendering renderer=phantomJS
Apr 26 05:35:53 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:35:53+0000 lvl=warn msg="phantomJS is deprecated and will be removed in a future release. You
Apr 26 05:35:53 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:35:53+0000 lvl=info msg="Initializing Stream Manager"
Apr 26 05:35:53 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:35:53+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=htt
Apr 26 05:36:25 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:36:25+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET
Apr 26 05:37:33 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:37:33+0000 lvl=info msg="Successful Login" logger=http.server User=admin@localhost
Apr 26 05:39:28 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:39:28+0000 lvl=info msg="Successful Logout" logger=http.server User=admin@localhost
Apr 26 05:39:28 Ubuntu-18.04 grafana-server[7358]: t=2020-04-26T05:39:28+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method
Apr 26 05:45:53 Ubuntu-18.04 

Now goto browser for access Grafana server using default port 3000.

http://10.66.110.30:3000/

Using Grafana default user name and password
User Name : admin
Password : admin

Then change after first time login.

Step #04: I want to switch Grafana default port 3000 to 80.

So now I want to install any web server like nginx or apache.

root@Ubuntu-18:~# apt install nginx

After installation done then backup nginx main config file.

root@Ubuntu-18:~# cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default-back

Then clear all text from main config file and just add below details for nginx config.

server {
    listen 80;

    server_name http://10.66.110.30;

    location / {
        proxy_pass http://10.66.110.30:3000/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Now restart nginx web server.

root@Ubuntu-18:~# service nginx restart

Edit Grafana server config file for switch 3000 to 80. Just comment out two lines from [server] section.

root@Ubuntu-18:~# vi /etc/grafana/grafana.ini
[server]
http_port = 3000
root_url = http://10.66.110.30:3000/

For save press Esc type :wq then press Enter. Then restart Grafana server.

root@Ubuntu-18:~# systemctl restart grafana-server

Now browse your server ip address like http://10.66.110.30/login. I hope you successfully browse using your server ip address. If any problem so please see my YouTube video for more details.

0 0 votes
Article Rating
Admin: I am system administrator as Windows and Linux platform. I have 4 years skilled from the professional period. I have to configure Linux based system such as an Asterisk VOIP system, Network monitoring tools (ZABBIX), Virtualization (XEN Server), Cloud computing (Apache CloudStack) etc. Now share my professional skill each interested person. Thanks to all.
Leave a Comment