An MVP setup for Hotspot Billing using PHPNuxBill and FreeRADIUS
- Clone this repository
git clone --recursive [email protected]:reduzersolutions/radius-billing-system.git
- Create a src folder at the root directory and clone this repository inside the src folder
git clone [email protected]:reduzersolutions/phpnuxbill.git .
- Create a .env file
touch .env
- Copy contents of the .env.example into the newly created .env
cp .env.example .env
- Edit the env file with correct configurations
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=billing
DB_USERNAME=your_username
DB_PASSWORD=your_secure_password
- Start the containers
docker-compose up -d
- Open your browser and navigate to
http://localhost
- Follow the PHPNuxBill installation wizard
- Once logged in, go to:
- Settings → General Settings → FreeRADIUS
- Enable RADIUS integration
- Save changes
- Navigate to Settings → General Settings → FreeRADIUS
- Turn on Radius
- Go to RADIUS → RADIUS NAS
- Add your router details:
- Name: [Your Router Name]
- IP Address: [Router IP]
- Secret Key: [Your Secret] // We will use this when setting up radius on Mikrotik
For detailed MikroTik configuration, watch this tutorial: How to create a Hotspot with Radius Server Authentication
Important: Do not use MikroTik's UserManager as PHPNuxBill will handle user management.
The system includes M-pesa integration for automated payments. Configure your M-pesa credentials in PHPNuxBill's payment settings.
NB: You can use Ngrok for testing M-pesa integration on your local machine.
- PHPNuxBill: Billing and user management
- FreeRADIUS: Authentication server
- MySQL: Database backend
- Nginx: Web server
This is the most basic setup I could put together. I basically combined a bunch of opensource projects to just make it work - PHPNuxBill and FreeRADIUS. Not perfect, but it works.
I really need your help in making this better. My goal is to make it super easy to deploy and run in minimal time.
- Create scripts that auto-configure MikroTik and PHPNuxBill with all the necessary credentials
- Enhance security
- Make customer onboarding and payments smoother
If you choose to use this project, please make internet accessible to your community. Even if you can only offer 1Mbps, do it - but make sure EVERYONE can afford it. Why? Because internet access literally turned my life around. I want to give others the same opportunity.