How to set up a MikroTik hotspot with M-Pesa payments

By the WIFI247 team, Kenya · Updated

Short answer

You need a MikroTik router on RouterOS 7, an internet link, access points, and a billing system that talks to the router and takes M-Pesa. Turn on the hotspot on the router, connect the router to the billing system, create your packages and choose how customers pay. Customers then pick a package on the WiFi login page, approve the M-Pesa prompt on their phone and are online within seconds, with no one at the counter.

What do you need?

Five things: an internet link, a MikroTik router, access points, a billing system and a way to take M-Pesa.

ItemWhat it doesNotes
Internet linkThe bandwidth you resellFibre is best. LTE works for small sites. A public IP is not required.
MikroTik routerRuns the hotspot login page and controls who is onlineRouterOS 7 for WireGuard. Check the licence level for user count.
Access pointsSpread the WiFi to customersAny brand, connected to the MikroTik.
Billing systemSells packages, confirms payments, logs customers in and outHosted, so nothing to install on a PC.
M-Pesa collectionWhere customer money landsYour bank's paybill, your own paybill or till.

Check your router's licence before you buy: level 4 allows 200 active hotspot users, level 5 allows 500 and level 6 is unlimited (see MikroTik's licence table).

Step 1: Turn on the hotspot on the router

Use the built-in wizard. In Winbox or WebFig open IP › Hotspot › Hotspot Setup, or run it from the terminal:

/ip hotspot setup

Choose the bridge or port your access points connect to, accept the suggested address pool, and keep the DNS name. Connect a phone to the WiFi: the MikroTik login page should appear. If it already appears, skip this step.

Step 2: Connect the router to the billing system

The billing system must reach the router to log customers in and out. In WIFI247, open Routers › Add, copy the one-line command and paste it into the router's terminal. The router downloads its setup, builds a WireGuard VPN tunnel to the billing server and shows as online within a minute.

Because the router connects out, you need no public IP and no port forwarding. This matters in Kenya, where most LTE and many fibre links sit behind CGNAT. Read MikroTik billing without a public IP for how this works.

The payment page must also open before a customer logs in, which needs a walled-garden entry on the router. WIFI247 adds the billing address to the walled garden automatically each time it syncs the router.

Step 3: Create packages customers will buy

Short, cheap packages sell best. On a WIFI247-billed hotspot in Kenya (August to November 2026):

Package priceShare of purchasesShare of money
Ksh 20 or less54%32%
Ksh 21–5042%54%
Ksh 51–1003.5%10%
Above Ksh 1000.4%4%

The average purchase was Ksh 22, and a typical customer bought again about every 8 days. Keep a cheap entry package (1 hour, for example) for people trying you out, then let the Ksh 21–50 packages (a few hours to a full day) earn most of the money.

For each package, set the price, duration or data cap, speed limit and how many devices can share it. WIFI247 creates the matching hotspot profiles on your router for you.

Step 4: Choose how customers pay

  • STK push into your bank's paybill. The customer approves an M-Pesa prompt and the money goes into your own bank account through your bank's paybill. No Safaricom API application needed. Equity, KCB, Co-op, Absa, DTB, NCBA and I&M are built in, and you can add any other bank.
  • Your own paybill or till. If you already have Safaricom M-Pesa API access for your paybill or till, payments are matched to the customer automatically.
  • Vouchers. Printed codes for cash sales through a shop or agent.

Whichever you choose, the customer is logged in as soon as the payment is confirmed. If the router is briefly unreachable, the activation is retried automatically until the customer is online.

Step 5: Test, then go live

Connect a phone, buy the cheapest package and confirm three things: the M-Pesa prompt arrives, the phone goes online without typing anything, and the sale shows on your dashboard. Then put your support number on the login page so customers can reach you.

Plan for the evening rush. On that network, one in three purchases happened between 7 pm and 11 pm, and 9–10 pm was the busiest hour. Make sure the router and internet link are solid then. A router-offline alert tells you the moment a site drops.

Common problems and fixes

The login page does not appear

Phones show the login page when they detect a captive portal. If it does not pop up, open any http:// address in the browser. Check that the hotspot runs on the interface your access points connect to.

The customer paid but is not online

Usually the router was unreachable at that moment. WIFI247 keeps retrying until the customer is connected, and any payment that was never used is credited to the customer's balance.

One account used on many phones

Limit how many devices can share each package. WIFI247 can also detect customers re-sharing your WiFi through their phone's hotspot.

Questions

Which MikroTik router is best for a hotspot business?

Any MikroTik that runs RouterOS 7 can run a hotspot and connect to billing over WireGuard. Check the RouterOS licence level: level 4 allows 200 active hotspot users, level 5 allows 500 and level 6 is unlimited.

Do I need a public IP address for MikroTik hotspot billing?

Not with WIFI247. The router connects out to the billing server over a WireGuard VPN, so it works behind CGNAT on LTE and most fibre links.

How do customers pay for hotspot packages with M-Pesa?

They join the WiFi, the login page shows your packages, they choose one and enter their phone number, approve the M-Pesa STK prompt, and the billing system logs them in as soon as the payment is confirmed.

Can I sell hotspot vouchers for cash as well?

Yes. Generate voucher codes in the billing system, print them, and sell them through a shop or agent. Customers type the code on the login page.

What price should hotspot packages be in Kenya?

On a WIFI247-billed network in Kenya, the average purchase was Ksh 22 and 96% of purchases were Ksh 50 or less, so short, cheap packages sell best. Packages of Ksh 21 to 50 brought in more than half of the money.

How long does it take to set up?

If the hotspot already runs on your router, connecting it to WIFI247 and creating packages takes under an hour. A new site also needs time to mount and aim access points.

More guides

Try it on one router first

The first month is free, then from Ksh 1,000 a month. If it doesn't suit you, stop. There's no contract.