Server Installation Guide

Updated: 27 January 2026

This guide covers the recommended manual installation flow for MKRadius on Ubuntu 24.04. We do not use a one-click installer script. You will install and configure the required services directly: Nginx, PHP 8.5, MariaDB/MySQL, phpMyAdmin, and FreeRADIUS.

Requirements

  • Ubuntu 24.04 LTS (fresh install recommended)
  • Root or sudo access
  • Domain or subdomain pointing to your server
  • Open ports: 80/443 (web), 1812/1813 (RADIUS), 22 (SSH)

Ubuntu 24.04 Required

Install Ubuntu 24.04 LTS before proceeding. You can download the official ISO here:

https://releases.ubuntu.com/noble/ubuntu-24.04.1-live-server-amd64.iso

1) Update the system

Start by updating package lists and upgrading installed packages.

sudo apt update && sudo apt -y upgrade
sudo apt -y install software-properties-common curl unzip git

2) Install Nginx

Install and enable the Nginx web server.

sudo apt -y install nginx
sudo systemctl enable nginx
sudo systemctl start nginx
sudo systemctl status nginx

3) Install PHP 8.5 and required extensions

Install PHP 8.5 with the extensions typically required for ISP billing platforms.

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt -y install php8.5 php8.5-fpm php8.5-cli php8.5-common php8.5-mysql php8.5-curl php8.5-xml php8.5-mbstring php8.5-zip php8.5-gd php8.5-bcmath php8.5-intl
php -v

4) Install MariaDB (or MySQL)

We recommend MariaDB for most deployments. Secure the installation and create the MKRadius database.

sudo apt -y install mariadb-server
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE DATABASE mkradius CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'mkradius'@'localhost' IDENTIFIED BY 'change-this-password';
GRANT ALL PRIVILEGES ON mkradius.* TO 'mkradius'@'localhost';
FLUSH PRIVILEGES;
EXIT;

5) Install phpMyAdmin

phpMyAdmin provides a convenient interface for managing the MKRadius database.

sudo apt -y install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
Open: http://your-server-ip/phpmyadmin

6) Install FreeRADIUS

FreeRADIUS handles AAA (authentication, authorization, and accounting). Install the core server and MySQL/MariaDB support.

sudo apt -y install freeradius freeradius-mysql freeradius-utils
sudo systemctl enable freeradius
sudo systemctl start freeradius
sudo systemctl status freeradius

7) Configure the RADIUS database

Import the FreeRADIUS SQL schema, then point FreeRADIUS to your MKRadius database credentials.

sudo mysql -u root -p mkradius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql
sudo nano /etc/freeradius/3.0/mods-available/sql
Set:
dialect = "mysql"
driver = "rlm_sql_${dialect}"
server = "localhost"
port = 3306
login = "mkradius"
password = "change-this-password"
radius_db = "mkradius"
sudo ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/sql
sudo systemctl restart freeradius

8) Configure Nginx for MKRadius

Create an Nginx site configuration and point it to your MKRadius public directory.

sudo nano /etc/nginx/sites-available/mkradius.conf
server {
    listen 80;
    server_name your-domain.com;

    root /var/www/mkradius/public;
    index index.php index.html;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
sudo ln -s /etc/nginx/sites-available/mkradius.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

9) Tune PHP settings

Adjust key PHP settings to support larger imports and background operations.

sudo nano /etc/php/8.5/fpm/php.ini
memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 120
sudo systemctl restart php8.5-fpm

10) Service management quick commands

sudo systemctl restart nginx
sudo systemctl restart php8.5-fpm
sudo systemctl restart mariadb
sudo systemctl restart freeradius

Firewall (UFW) recommendations

Allow web traffic, SSH, and RADIUS ports.

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw allow 1812/udp
sudo ufw allow 1813/udp
sudo ufw enable
sudo ufw status

Backups

Back up your database regularly. This example creates a timestamped SQL dump.

mysqldump -u mkradius -p mkradius > mkradius-backup-$(date +%F).sql

Troubleshooting tips

  • Check Nginx errors: sudo tail -f /var/log/nginx/error.log
  • Check PHP-FPM: sudo systemctl status php8.5-fpm
  • Check MariaDB: sudo systemctl status mariadb
  • Check FreeRADIUS logs: sudo journalctl -u freeradius -f

Installation checklist

  • Ubuntu 24.04 installed and updated
  • Nginx, PHP 8.5 FPM, and extensions installed
  • MariaDB/MySQL installed and secured
  • Database and user created
  • phpMyAdmin accessible
  • FreeRADIUS installed, SQL schema imported, SQL module enabled
  • Nginx site configured and reloaded
  • Firewall configured for web + RADIUS

Need help?

If you need help validating your server setup or tuning RADIUS/database performance, contact us and we will guide you step-by-step.

Email: [email protected]
Phone: +923070014444