Would you like to learn how to configure Grafana Radius authentication on Apache? In this tutorial, we are going to show you how to authenticate Grafana users using the Apache Radius module for HTTP authentication.

• Ubuntu 18
• Ubuntu 19
• Grafana 6.4.4
• Freeradius 3.0.17

Grafana Tutorial:

On this page, we offer quick access to a list of Grafana tutorials.

Tutorial Grafana – FreeRadius Server Installation

• IP – 192.168.15.10.
• Operational System – Ubuntu 19.10
• Hostname – UBUNTU

On the Linux console, use the following commands to install the FreeRadius service.

Copy to Clipboard

Now, we need to add FreeRadius clients to the clients.conf;.

Locate and edit the clients.conf.

Copy to Clipboard

Add the following lines at the end of the clients.conf file.

Copy to Clipboard

In our example, we are adding 1 client device:

The client device was named GRAFANA and has the IP address 192.168.15.11.

Now, we need to add FreeRadius users to the USERS configuration file.

Locate and edit the Freeradius users configuration file.

Copy to Clipboard

Add the following lines at the end of the file

Copy to Clipboard

We created a Radius account named admin.

Restart the Freeradius server.

Copy to Clipboard

Test your radius server configuration file.

Copy to Clipboard

You have finished the Freeradius installation on Ubuntu Linux.

Tutorial – Grafana Installation

• IP – 192.168.15.11
• Operational System – Ubuntu 19.10
• Hostname – GRAFANA

On the Linux console, use the following commands to install the MySQL database service.

Copy to Clipboard

Access the MySQL command-line.

Copy to Clipboard

Create a database named grafana.

Copy to Clipboard

Create a database user account named grafana.

Copy to Clipboard

Give the SQL user named grafana permission over the database named grafana.

Copy to Clipboard

On the Linux console, use the following commands to configure the Grafana APT repository.

Copy to Clipboard

Use the following command to install Grafana.

Copy to Clipboard

Edit the Grafana configuration file grafana.ini.

Copy to Clipboard

Perform the following configuration under the [Database] and [Session] sections.

Copy to Clipboard

Keep in mind that you need to change the MySQL username and password to reflect your environment.

Use the following command to start the Grafana service.

Copy to Clipboard

The Grafana service will start listening on TCP port 3000.

To test your Grafana installation, open your browser and enter the IP address of your server plus :3000.

In our example, the following URL was entered in the Browser:

• http://192.168.15.11:3000

The Grafana web interface should be presented.

grafana default password

On the prompt screen, enter the Grafana Default Password login information.

• Username: admin
• Password: admin

The system will ask you to change the Grafana default password.

Congratulations! You have finished the Grafana basic installation.

Tutorial Grafana – Apache Proxy Installation

• IP – 192.168.15.11
• Operational System – Ubuntu 19.10
• Hostname – GRAFANA

Now, we need to install the Apache webserver and configure it to work as a Proxy to the Grafana service.

Install the Apache web server and the required packages.

Copy to Clipboard

Enable the required Apache modules.

Copy to Clipboard

Now, we need to configure Apache port 80 as a proxy to the Grafana service port 3000.

We also need to configure Apache to request Radius authentication to users trying to acess Grafana.

Edit the Apache 000-default.conf configuration file.

Copy to Clipboard

Here is the 000-default.conf file before our configuration.

Copy to Clipboard

Here is the 000-default.conf file after our configuration.

Copy to Clipboard

Restart the Apache service.

Copy to Clipboard

Edit the Grafana configuration file grafana.ini.

Copy to Clipboard

Perform the following configuration under the [auth.proxy] area.

Copy to Clipboard

Restart the Grafana service.

Copy to Clipboard

The Apache service will listen on TCP port 80, authenticate user on the Radius database and redirect users to the Grafana service on port 3000.

To test your Apache proxy installation, open your browser and enter the IP address of your server.

In our example, the following URL was entered in the Browser:

• http://192.168.15.11

The Apache proxy will request you to authenticate yourself before forwarding you to the Grafana service.

grafana http authentication

On the login screen, use the admin user and the password from the Apache htpasswd file.

• Username: admin
• Password: Enter the admin Radius password. [boss123]

After a successfull login, you will be sent directly to the Grafana dashboard.

Congratulations! You have configured the Apache Proxy authentication to Access the Grafana serice.