🚀 FreeRADIUS Installation Guide

Complete Setup for FreeRADIUS with Web Interface, MySQL Backend, and Management Tools

📋 What This Installation Provides

🎯 Core Components:
  • FreeRADIUS Server - Authentication, Authorization, and Accounting (AAA) server
  • MySQL Database - Backend storage for users, clients, and accounting data
  • Apache Web Server - Web interface hosting
  • PHP - Web application backend
  • phpMyAdmin - Database management interface
🌐 Web Interfaces:
  • Main FreeRADIUS Interface - User management, client management, statistics
  • Database Manager - Direct database operations
  • Database Viewer - Read-only database exploration
  • phpMyAdmin - Full database administration
🛠️ Management Tools:
  • Command-line scripts - Add/remove users, clients, view statistics
  • Web-based management - Full GUI for all operations
  • Automated testing - Built-in verification and testing tools

📋 System Requirements

1 Operating System: Ubuntu 18.04+ or Debian 9+
2 System Resources:
  • Minimum 2GB RAM (4GB recommended)
  • 10GB free disk space
  • 1 CPU core minimum
3 Network Access:
  • Internet connection for package downloads
  • Port 1812 (RADIUS authentication)
  • Port 1813 (RADIUS accounting)
  • Port 80/443 (Web interface)
  • Port 3306 (MySQL - internal)
4 User Permissions: Root or sudo access required
⚠️ Important: This installation will modify system configurations and install packages. Ensure you have a backup of your system or are working on a fresh installation.

🚀 Installation Steps

1 Download the Installation Script
# Download the script to your server wget https://freeradius.ispro.pk/FINAL_INSTALL.sh # OR copy the script content to a file named FINAL_INSTALL.sh
2 Make the Script Executable
chmod +x FINAL_INSTALL.sh
3 Run the Installation
# Run as root or with sudo sudo ./FINAL_INSTALL.sh # OR if you're already root ./FINAL_INSTALL.sh
📝 What the Script Does:
  1. Updates system packages
  2. Installs LAMP stack (Apache, MySQL, PHP)
  3. Installs FreeRADIUS and dependencies
  4. Configures MySQL database and tables
  5. Configures FreeRADIUS with MySQL backend
  6. Creates web interfaces and management tools
  7. Adds test users and clients
  8. Starts and enables all services
  9. Runs comprehensive tests
  10. Displays access information
⏱️ Installation Time: The complete installation typically takes 10-15 minutes depending on your system and internet connection.

✅ Post-Installation Verification

1 Check Service Status
# Check if all services are running sudo systemctl status freeradius sudo systemctl status apache2 sudo systemctl status mysql # All should show "active (running)"
2 Test RADIUS Authentication
# Test with the default test user radtest testuser testpass localhost 0 testing123 # Expected output should show "Access-Accept"
3 Access Web Interfaces
Interface URL Default Credentials
Main FreeRADIUS Interface http://your-server-ip/radius/ admin / admin123
Database Manager http://your-server-ip/radius/db-manager/ admin / admin123
phpMyAdmin http://your-server-ip/phpmyadmin/ radius / radius123
4 Check Ports
# Verify FreeRADIUS is listening on correct ports sudo netstat -tlnp | grep radius # Should show ports 1812 and 1813 # Check Apache sudo netstat -tlnp | grep :80 # Should show port 80
🎉 Success Indicators:
  • All services show "active (running)" status
  • RADIUS authentication test returns "Access-Accept"
  • Web interfaces are accessible
  • Ports 1812, 1813, and 80 are listening
  • No error messages in service logs

🔧 Common Issues and Solutions

1 FreeRADIUS Won't Start
# Check FreeRADIUS configuration sudo freeradius -X # Check logs sudo tail -f /var/log/freeradius/radius.log # Common fixes: sudo systemctl restart freeradius sudo systemctl enable freeradius
2 Database Connection Issues
# Check MySQL status sudo systemctl status mysql # Test database connection mysql -u radius -p -h localhost radius # Reset MySQL password if needed sudo mysql -e "ALTER USER 'radius'@'localhost' IDENTIFIED BY 'radius123';"
3 Web Interface Not Accessible
# Check Apache status sudo systemctl status apache2 # Check Apache error logs sudo tail -f /var/log/apache2/error.log # Verify file permissions sudo chown -R www-data:www-data /var/www/html/radius/ sudo chmod -R 755 /var/www/html/radius/
4 Firewall Issues
# Check if ports are blocked sudo ufw status # Allow required ports sudo ufw allow 1812/udp sudo ufw allow 1813/udp sudo ufw allow 80/tcp sudo ufw allow 443/tcp
5 RADIUS Authentication Fails
# Check client configuration mysql -u radius -p radius -e "SELECT * FROM nas;" # Verify user exists mysql -u radius -p radius -e "SELECT * FROM radcheck;" # Test with verbose output radtest testuser testpass localhost 0 testing123 -x
📞 Need More Help?
  • Check the installation log: /var/log/freeradius_install.log
  • Review FreeRADIUS logs: /var/log/freeradius/
  • Check system logs: sudo journalctl -u freeradius

📖 Usage Guide

1 Adding RADIUS Users
# Command line sudo add-radius-user username password # Web interface # Go to http://your-server-ip/radius/ # Navigate to User Management → Add User
2 Adding RADIUS Clients (NAS Devices)
# Command line sudo add-radius-client client-name client-ip secret # Web interface # Go to http://your-server-ip/radius/ # Navigate to Client Management → Add Client
3 Viewing Statistics
# Command line sudo list-radius-users sudo list-radius-clients # Web interface # Go to http://your-server-ip/radius/ # Check the Dashboard for real-time statistics
4 Database Management
# Direct database access mysql -u radius -p radius # Web-based management # phpMyAdmin: http://your-server-ip/phpmyadmin/ # Database Manager: http://your-server-ip/radius/db-manager/
🔑 Default Credentials Summary:
Service Username Password
FreeRADIUS Web Interface admin admin123
MySQL Database radius radius123
Test RADIUS User testuser testpass
Test RADIUS Client testing123 testing123
🔒 Security Recommendations:
  • Change default passwords immediately after installation
  • Use strong, unique passwords for all accounts
  • Configure firewall rules to restrict access
  • Enable HTTPS for web interfaces in production
  • Regularly update system packages