Set up Pingota

Three things get a network selling access: this server running, a router that dials in, and a payment account. Each can be tested on its own, so you can connect the router before you take a shilling.

1. Deploy the server

The recommended path is Docker Compose on a server with a domain name. Dokploy uses the same compose file.

  1. 01

    Create the environment file

    Copy .env.example to .env. Generate DJANGO_SECRET_KEY and FIELD_ENCRYPTION_KEY with the commands in the file.

  2. 02

    Set the public address

    Set PUBLIC_BASE_URL to your domain and ROUTER_TUNNEL_HOST to the hostname routers will dial. Attach the domain to the web service on port 8000.

  3. 03

    Start the stack

    The entrypoint runs migrations, collects static files and creates the platform owner from ADMIN_USERNAME.

  4. 04

    Sign in

    Open /admin/login/ with the platform owner account, then approve the first network request under /django-admin/.

cp .env.example .env
docker compose up -d --build

No Docker? The full guide covers a virtual environment, python manage.py migrate, python manage.py bootstrap and runserver. Health check: /healthz/ returns ok.

Read the installation guide

2. Connect the MikroTik

  1. 01

    Name the router

    Use the place it serves, such as Kondele gate, so the panel reads like your network.

  2. 02

    Copy the install block

    It joins the router to TunGuard, creates a restricted API user and allows the API port only from Pingota's tunnel address.

  3. 03

    Paste into New Terminal

    In WinBox or SSH, paste the whole block and press Enter. The router dials out, so CGNAT and a missing public IP do not matter.

  4. 04

    Wait for Connected

    The router reports its model and RouterOS version back to the panel. The block is safe to paste twice; nothing is duplicated.

Point the hotspot login page at your portal. The capture page reads the device identity from the redirect:

https://your-domain/portal/<isp-slug>/?mac=$(mac)&link-login-only=$(link-login-only)

Without the redirect, a guest sees the prices but the payment buttons stay disabled. The full guide also shows the hotspot profile, walled-garden and bandwidth profile settings.

3. Connect payments

Paystack

Add the secret and public keys, plus a subaccount code if you use one. Paste the webhook URL from Settings into the Paystack dashboard, then send a small test payment.

M-Pesa

Add your shortcode, consumer key, consumer secret and Lipa na M-Pesa passkey. Register the callback URL shown in Settings with Daraja.

The payment confirmation is verified before the router is touched. A failed or duplicate callback cannot open access twice.

4. Run it day to day

Live access shows every device with a valid pass. Add minutes, revoke a pass, or disconnect a session. A disconnect keeps the pass, so the guest can reconnect until the time runs out.

Vouchers are generated in batches. Print the sheet, sell the codes at the counter, and void a batch if a sheet leaks. Each code works once.

Fair use is read from router byte counters. When a pass reaches its data allowance, the device is moved to a slow profile or cut off, depending on the pass.

The sweeper runs inside the web process. It expires grants, retries provisioning for paid grants whose router was down, and samples router health once a minute. To run it from cron instead, set SCHEDULER_ENABLED=false and run python manage.py tick every 30 seconds.

Backups are the database dump plus the compose volume. Nothing else holds state. Take a dump before every upgrade because migrations are forward-only.