---
title: "Managing FreeRADIUS Deployment with daloRADIUS"
description: "Learn how to centralize authentication and authorization of users in your FreeRADIUS server with daloRADIUS in this step-by-step tutorial!"
canonical: "https://adamtheautomator.com/freeradius/"
---

# Managing FreeRADIUS Deployment with daloRADIUS

> Learn how to centralize authentication and authorization of users in your FreeRADIUS server with daloRADIUS in this step-by-step tutorial!

Source: https://adamtheautomator.com/freeradius/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Managing FreeRADIUS Deployment with daloRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/Managing-FreeRADIUS-Deployment-with-daloRADIUS.jpg)

# Managing FreeRADIUS Deployment with daloRADIUS

[![](https://secure.gravatar.com/avatar/572a248f516b6d0cd566cb44fdbd9336f30ef95aa0f6d78f118c1f47b1b6d6b7?s=192&d=mm&r=g)Arvid Larson](https://adamtheautomator.com/author/arvid-larson/)14 April 20228 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[FreeRADIUS](/tag/freeradius/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the FreeRADIUS Server](#installing-the-freeradius-server)
*   [Creating MariaDB Database](#creating-mariadb-database)
*   [Configuring FreeRADIUS with MariaDB Database](#configuring-freeradius-with-mariadb-database)
*   [Installing daloRADIUS](#installing-daloradius)
*   [Verifying daloRADIUS Installation](#verifying-daloradius-installation)
*   [Setting up FreeRADIUS User with daloRADIUS](#setting-up-freeradius-user-with-daloradius)
*   [Setting Up Network Access Server (NAS) on daloRADIUS](#setting-up-network-access-server-nas-on-daloradius)
*   [Conclusion](#conclusion)

Authentication and authorization are the most critical components nowadays, and setting them up for security is good practice. And if you’re looking to centralize authentication and authorization for internet users, [FreeRADIUS](https://freeradius.org/) is one you should consider.

FreeRADIUS gives you full monitoring for every event on your users. And in this article, you’ll learn how to install and integrate FreeRADIUS and daloRADIUS on an Ubuntu server.

Read on and start centralizing authentication and authorization!

## Prerequisites

This tutorial will be a hands-on demonstration. To follow along, ensure you have the following requirements:

*   A Linux server – This demo uses the [Ubuntu server 20.04](https://www.releases.ubuntu.com/20.04/) Focal Fossa.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

*   A [LAMP Stack](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04) installed on your Ubuntu server.
    
*   A root user or a non-root user with sudo/root privileges.
    

## Installing the FreeRADIUS Server

FreeRADIUS is a free and open-source RADIUS software suite that provides centralized [authentication, authorization, and accounting (AAA)](https://www.techopedia.com/definition/24130/authentication-authorization-and-accounting-aaa). At the same time, FreeRADIUS supports almost all authentication protocols and is also designed to be modular with high performance.

But before you can take advantage of FreeRADIUS, you’ll first have to install the FreeRADIUS server with additional packages for MariaDB database backend support.

1\. Open your terminal and log in to your server.

2\. Next, run the [`apt update`](https://linuxize.com/post/how-to-use-apt-command/#updating-package-index-apt-update) command below to update and refresh the package index on your system. This command ensures you’re installing the latest version of packages.

```bash
sudo apt update
```

![Updating and Refreshing Package Index](https://adamtheautomator.com/wp-content/uploads/2022/04/image-215.png)

Updating and Refreshing Package Index

3\. Lastly, run the following [`apt install`](https://linuxize.com/post/how-to-use-apt-command/#installing-packages-apt-install) command to install the following packages for the FreeRADIUS server on your Ubuntu system:

*   The `freeradius` package is the main package of the FreeRADIUS server.
    
*   The `freeradius-mysql` package supports the FreeRADIUS to use MySQL/MariaDB as the database backend.
    
*   The `freeradius-utils` package provides additional command-line tools for managing the FreeRADIUS server.
    

```bash
sudo apt install freeradius freeradius-mysql freeradius-utils -y
```

![Installing FreeRADIUS Packages](https://adamtheautomator.com/wp-content/uploads/2022/04/image-216.png)

Installing FreeRADIUS Packages

## Creating MariaDB Database

After installing the FreeRADIUS package with the MySQL/MariaDB backend, you’ll create a new MariaDB database as the backend for FreeRADIUS.

The MariaDB backend lets you keep track of events on the FreeRADIUS environment and store all information permanently inside the database. This feature is useful for generating reports on FreeRADIUS.

To create a MariaDB database:

1\. Run the `mysql` command below to log in to the MariaDB shell using the user `root`.

This command will prompt you for a password, be sure to input the correct password for the MariaDB root user.

```powershell
sudo mysql -u root -p
```

![Logging in to MariaDB Shell](https://adamtheautomator.com/wp-content/uploads/2022/04/image-217.png)

Logging in to MariaDB Shell

2\. Next, run each following MariaDB query to create a new database and user for the FreeRADIUS. Be sure to change the detailed database name, user, and password, as you like.

```bash
# Create a new database named freeradiusdb
CREATE DATABASE freeradiusdb;

# Create a user named freeradiususer and allow to access freeradiusdb
GRANT ALL ON freeradiusdb.* TO freeradiususer@localhost IDENTIFIED BY "RadiusDatabasePassword";

# Reload tables privileges
FLUSH PRIVILEGES;
```

![Creating MariaDB Database and User for FreeRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-218.png)

Creating MariaDB Database and User for FreeRADIUS

3\. Lastly, type `exit` to log out from the MariaDB shell.

![Logging out from MariaDB Shell](https://adamtheautomator.com/wp-content/uploads/2022/04/image-219.png)

Logging out from MariaDB Shell

## Configuring FreeRADIUS with MariaDB Database

You’ve just created the MariaDB database and user for the FreeRADIUS as the backend. But how do you enable the MariaDB database backend for FreeRADIUS? You’ll import the [database schema](https://github.com/FreeRADIUS/freeradius-server/blob/master/raddb/mods-config/sql/main/mysql/schema.sql) to the FreeRADIUS database and edit the SQL configuration module.

1\. Run the `systemctl` commands below to stop and verify the `freeradius` service. Make sure the status is `inactive` before configuring the FreeRADIUS server. Here’s how to [use](https://adamtheautomator.com/ubuntu-systemctl/) Ubuntu systemctl to control systemd.

```bash
# Stop freeradius service
sudo systemctl stop freeradius

# Verify freeradius status
sudo systemctl status freeradius
```

![Stopping and Verifying freeradius Service](https://adamtheautomator.com/wp-content/uploads/2022/04/image-220.png)

Stopping and Verifying freeradius Service

Related:[Correct Way of Using Ubuntu systemctl to Control Systemd](https://adamtheautomator.com/ubuntu-systemctl/)

2\. Next, run the `mysql` command below to import the FreeRADIUS database schema to the database `freeradiusdb`. Be sure to input the correct MariaDB `root` password.

```bash
mysql -u root -p freeradiusdb < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql
```

![Importing the FreeRADIUS Database Schema to the freeradiusdb Database](https://adamtheautomator.com/wp-content/uploads/2022/04/image-221.png)

Importing the FreeRADIUS Database Schema to the freeradiusdb Database

3\. Run the [`mysqlshow`](https://manpages.ubuntu.com/manpages/impish/man1/mysqlshow.1.html) command below to verify the database schema of the `freeradiusdb` database.

```bash
mysqlshow freeradiusdb
```

![Verifying Database Schema in freeradiusdb Database](https://adamtheautomator.com/wp-content/uploads/2022/04/image-222.png)

Verifying Database Schema in freeradiusdb Database

4\. Next, edit the configuration _/etc/freeradius/3.0/mods-available/sql_ using your preferred editor and change the following inside the `sql {...}` section:

*   Change the `dialect` value to `mysql` as the database.
    
*   Be sure to comment out the option `driver = "rlm_sql_null"` by adding the `#` symbol at the beginning.
    
*   Uncomment the `driver = "rlm_sql_${dialect}"` option to enable MySQL/MariaDB backend by removing `#` symbol in front.
    

```powershell
sql {
			dialect = "mysql"
			
			#driver = "rlm_sql_null"
			driver = "rlm_sql_${dialect}"
```

![Enabling MySQL/MariaDB Database Backed for FreeRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-223.png)

Enabling MySQL/MariaDB Database Backed for FreeRADIUS

5\. Look for the `mysql {...}` section, and comment out all TLS options to disable TLS support for the MariaDB database backend, as shown below.

In this tutorial, the FreeRADIUS server and MariaDB database are on the same server, so you do not need the MariaDB TLS support.

![Disabling TLS Support MariaDB FreeRADIUS Module](https://adamtheautomator.com/wp-content/uploads/2022/04/image-224.png)

Disabling TLS Support MariaDB FreeRADIUS Module

6\. Scroll down under the `# Connection info:` line, input your MariaDB database name, user, and password for the FreeRADIUS, as shown below.

![Setting up MariaDB Database for FreeRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-225.png)

Setting up MariaDB Database for FreeRADIUS

7\. Uncomment the **read\_clients = yes** option to allow FreeRADIUS clients to read from the **nas** table inside the FreeRADIUS database.

Save all the changes you made and close the file.

![Enabling Read NAS from Clients](https://adamtheautomator.com/wp-content/uploads/2022/04/image-226.png)

Enabling Read NAS from Clients

8\. Now, run each command below to enable the MySQL/MariaDB module for FreeRADIUS. And change the ownership of the configuration file `/etc/freeradius/3.0/mods-enabled/sql` to the user and group `freerad`.

> _These commands don’t have outputs, but you’ll verify the freeradius service in the following step._

```bash
# Activate MariaDB/MySQL module FreeRADIUS
sudo ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/

# Change ownership to freerad
sudo chown -h freerad.freerad /etc/freeradius/3.0/mods-enabled/sql
```

9\. Lastly, run the following commands to start and verify the `freeradius` service.

```bash
# Start freeradius service
sudo systemctl start freeradius

# Verify freeradius status
sudo systemctl status freeradius
```

At this point, the new FreeRADIUS server is now running with the MariaDB database backend.

If your configuration is correct, you’ll see the freeradius service is active (running). And at the bottom log messages, you’ll see the FreeRADIUS connecting to the MySQL/MariaDB server.

![Starting and Verifying freeradius Service](https://adamtheautomator.com/wp-content/uploads/2022/04/image-227.png)

Starting and Verifying freeradius Service

## Installing daloRADIUS

You now have a FreeRADIUS server running with the MariaDB database as backend support. But wouldn’t it be nice to have a GUI that provides user management for the FreeRADIUS server? Why not install [daloRADIUS](http://daloradius.com/)? daloRADIUS is a PHP-based web application for managing the FreeRADIUS server.

Apart from providing user management, daloRADIUS also provides graphical reporting, accounting and supports GIS (Geolocation).

To install daloRADIUS on your server:

1\. Run each command below to change your current working directory to `/var/www/html` and download (`wget`) the daloRADIUS source code.

> _At the time of writing, the latest version of daloRADIUS is v1.3._

```bash
# Change working directory
cd /var/www/html/

# Download the daloRADIUS source code
wget https://github.com/lirantal/daloradius/archive/refs/tags/1.3.tar.gz
```

Related:[How to Download Files with Python Wget](https://adamtheautomator.com/python-wget/)

2\. Next, run each command below to extract (`tar -xf`) the daloRADIUS source code (`1.3.tar.gz`) and rename the extracted directory to `daloradius`.

```bash
# Extract daloRADIUS source code
tar -xf 1.3.tar.gz

# Verify extracted directory
ls

# Rename directory to `daloradius`
mv daloradius-1.3 daloradius

# Verify changed directory name to daloradius
ls
```

![Extracting daloRADIUS source code and renaming the directory](https://adamtheautomator.com/wp-content/uploads/2022/04/image-228.png)

Extracting daloRADIUS source code and renaming the directory

3\. After extraction, run the below commands to import the database schema for daloRADIUS to the `freeradiusdb` database and verify the list of tables on the FreeRADIUS database.

Input your MariaDB root user password when prompted.

```bash
# import daloRADIUS database schema
mysql -u root -p freeradiusdb < /var/www/html/daloradius/contrib/db/fr2-mysql-daloradius-and-freeradius.sql

# verify database schema
mysqlshow freeradiusdb
```

```powershell
Below, you can see a list of tables for FreeRADIUS and daloRADIUS from the freeradiusdb database.
```

![Importing and verifying the daloRADIUS database schema](https://adamtheautomator.com/wp-content/uploads/2022/04/image-229.png)

Importing and verifying the daloRADIUS database schema

4\. Now, run the [`cp`](https://www.geeksforgeeks.org/cp-command-linux-examples/) command below. This command doesn’t have an output but copies the daloRADIUS configuration to `/var/www/html/daloradius/library/daloradius.conf.php`.

```bash
cp /var/www/html/daloradius/library/daloradius.conf.php.sample /var/www/html/daloradius/library/daloradius.conf.php
```

5\. Edit the _/var/www/html/daloradius/library/daloradius.conf.php_ configuration using your preferred editor to set up the database configuration for daloRADIUS.

Change the database name (freeradiusdb), the user (freeradiususer), and password (RadiusDatabasePassword) below with your details.

Save the changes and close the file.

![Configure database for daloRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-230.png)

Configure database for daloRADIUS

6\. Next, run the below commands to perform the following, but without outputs:

*   Change the ownership (`chown`) of the `/var/www/html/daloradius` directory to `www-data`.
    
*   Allow Apache web-server to access daloRADIUS source code.
    
*   Change the permission (`chmod`) of the file `daloradius.conf.php` to `0664` to secure the configuration file.
    

```bash
# Change ownership to www-data
sudo chown -R www-data:www-data /var/www/html/daloradius/

# Change permission to 0664
sudo chmod 0664 /var/www/html/daloradius/library/daloradius.conf.php
```

7\. Lastly, run the `systemctl` command below to restart the `freeradius` service and apply new changes, but without any output.

```bash
sudo systemctl restart freeradius
```

## Verifying daloRADIUS Installation

You’ve now installed the daloRADIUS web application on your server. But how do you verify it’s working? You’ll access the daloRADIUS service and log in to access the daloRADIUS dashboard on your web browser.

Open your favorite browser and type your server IP address followed by the path _/daloradius_ (i.e., http://172.16.1.10/daloradius). Doing so redirects your browser to the daloRADIUS login page.

Enter the default user (**administrator)** and password (**radius**), and click **Login Please** to access the daloRADIUS dashboard.

![Logging in to daloRADIUS Dashboard](https://adamtheautomator.com/wp-content/uploads/2022/04/image-231.png)

Logging in to daloRADIUS Dashboard

Now, you can tell your daloRADIUS installation works if you get to the dashboard shown below.

![Logged in to the daloRADIUS dashboard](https://adamtheautomator.com/wp-content/uploads/2022/04/image-232.png)

Logged in to the daloRADIUS dashboard

## Setting up FreeRADIUS User with daloRADIUS

You now have access to the daloRADIUS dashboard, so feel free to create a new FreeRADIUS user from the daloRADIUS user manager. Doing so lets you verify that your daloRADIUS and FreeRADIUS installations work side-by-side.

1\. On the daloRADIUS dashboard, click the **Management** menu tab, and click the **New User** menu on the left panel.

Input the new user’s username and password, and click the Apply button. But in this tutorial, the username is alice, and the password is strongpassword.

![Creating New User daloRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-233.png)

Creating New User daloRADIUS

2\. While still on the **Management** page, click the **List Users** menu to check available users on FreeRADIUS. You’ll see the new user **alice** is available on the list.

Click on the new user alice —> Edit User to access the user’s details.

![Checking Available Users on FreeRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-234.png)

Checking Available Users on FreeRADIUS

3\. Now, click the **Test Connectivity** button to verify the user **alice**.

![Testing the FreeRADIUS User (alice)](https://adamtheautomator.com/wp-content/uploads/2022/04/image-235.png)

Testing the FreeRADIUS User (alice)

4\. Lastly, click the **Perform Test** button to verify and authenticate the user against the FreeRADIUS server.

If you get a Received Access-Accept id … message, the new user alice is successfully authenticated against the FreeRADIUS server.

![Authenticating User Against the FreeRADIUS Server](https://adamtheautomator.com/wp-content/uploads/2022/04/image-236.png)

Authenticating User Against the FreeRADIUS Server

## Setting Up Network Access Server (NAS) on daloRADIUS

You’ve learned how to authenticate a user from daloRADIUS against the FreeRADIUS server, indicating they work fine together. But is integrating FreeRADIUS and daloRADIUS to other network services possible? Yes! [Network Access Server (NAS)](https://www.okta.com/identity-101/what-is-a-network-access-server/) will do the trick.

NAS is a gateway for the FreeRADIUS integration to the network services, such as Hotspot Login. So you’ll set up NAS before integrating FreeRADIUS and daloRADIUS to other network services.

In the daloRADIUS dashboard, click the **Management** menu tab —> **Nas** tab to access the **NAS Management** page.

Click the **New NAS** menu and enter NAS configuration details under **New NAS Record** with the following:

*   Set the **NAS IP/Host** address to your router IP address. This tutorial uses a router with an IP address of **172.168.1.20**.
*   Set the **NAS Secret** that matches the **secret** on your router device. This tutorial uses the secret **secretfromrouter** in this tutorial.
*   Select the **NAS Type** as your router device, or you can choose **other**.
*   Set the **NAS Shortname** as your router device name. This tutorial uses the example router name **pfsense.test**.
*   Click the **Apply** button to confirm the details and create a new NAS.

![Creating NAS in daloRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-237.png)

Creating NAS in daloRADIUS

Now, click the **List NAS** menu to check available NAS on FreeRADIUS.

Below, you can see the new NAS with the IP address **172.16.1.20** and **NAS** **Shortname** as **pfsense.test**.

![Checking list NAS FreeRADIUS](https://adamtheautomator.com/wp-content/uploads/2022/04/image-238.png)

Checking list NAS FreeRADIUS

## Conclusion

Throughout this tutorial, you’ve learned how to install the FreeRADIUS server with the MariaDB database backend. You’ve also created a FreeRADIUS user and integrated daloRADIUS with the FreeRADIUS server.

FreeRADIUS is one of the most popular software that provides centralized authentication and authorization, implementing the RADIUS networking protocol. And at this point, you’ve learned the basics of using daloRADIUS for managing FreeRADIUS users and NAS.

Why not integrate the FreeRADIUS server and daloRADIUS as a [Captive Portal](https://en.wikipedia.org/wiki/Captive_portal) to your Network devices, such as [Mikrotik](https://blog.ibill.io/mikrotik-radius-pppoe-server-setup-guide/) and [pfSense](https://www.engisv.info/?p=1846)?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Ffreeradius%2F&text=Managing%20FreeRADIUS%20Deployment%20with%20daloRADIUS)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Ffreeradius%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Ffreeradius%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/publisher/3f95d9c85b2b817aab5dca59f1ca0e14/38378bffb6e067df12a1bd90a3921833213a6e328f7d3baabd1fae698d38ddfd.jpg)

### [Fix Kerberos Clock Skew Logon Failures Using w32tm](/fix-kerberos-clock-skew-w32tm/)

Fix Kerberos clock skew logon failures by checking w32tm sources, pointing the PDC emulator at NTP, and resyncing drifted clients.

![](https://adamtheautomator.com/wp-content/uploads/publisher/3f95d9c85b2b81798ecbd4ce17ad4211/3af27311d4ef00790ee9d17c229fa6097b6ee8b242b0a21e0b024c9807f61639.jpg)

### [Who Really Restarted Windows Server? Event ID 1074 and 6008](/event-id-1074-windows-server-restart/)

Use one Get-WinEvent filter to find which account, process, and reason restarted a Windows Server, from Event ID 1074 and 6008 logs.

![](https://adamtheautomator.com/wp-content/uploads/publisher/3f95d9c85b2b81e69730da4c690758c2/4afeea42b7f854d23285b281664351779f042510f1e3a1d766d02cfa39b711a8.jpg)

### [Find and Disable Every Inactive AD Computer with PowerShell](/find-inactive-computers-active-directory/)

Find inactive computer accounts in Active Directory with Search-ADAccount, then disable and quarantine them with PowerShell in steps you can undo.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
