Cookbook · 1 of 3

Develop and test

In this tutorial we run your LuCI package on throwaway OpenWrt routers in Docker, so you see it working before anyone else does. You need Docker and nothing else.

You want toGo to
Get a router runningStart a router
See edits liveSee your changes without rebuilding
Test on 25.12 and 24.10Cover both release lines
Fill the router with dataMake the router look inhabited
Run the check CI runsThe whole check in one command
Test a kernel moduleWhen a kernel module is involved

Start a router

go install owfeed.org/owlab/cmd/owlab@latest

cd my-luci-app
owlab up                  # start it
owlab open owrt2512       # LuCI in your browser

Log in as root with an empty password.

The router is disposable. If you break it, run owlab up --rebuild.

See your changes without rebuilding

owlab sync --watch

owlab copies your sources into the running router on every save and reloads LuCI. You spend the day in this loop. Building a package comes later.

owlab copies the same directories luci.mk installs: htdocs, ucode, luasrc, root. If your package lives in a subdirectory, say so:

project:
  install:
    my-package/htdocs: /www
    my-package/ucode:  /usr/share/ucode/luci
    my-package/root:   /

Cover both release lines

version: 1
routers:
  - id: owrt2512
    release: "25.12.5"
  - id: owrt2410
    release: "24.10.8"

25.12 uses apk and 24.10 uses opkg. They agree on almost nothing, so a package that works on one can fail on the other. Keep both open.

Pin exact point releases. snapshot images and snapshot feeds are rebuilt daily and independently. Installs start failing within a day. owlab releases tells you when a pin has fallen behind.

Make the router look inhabited

An empty router renders almost nothing: no zone badges, no VLANs, no DHCP leases, no tables with rows in them. That is a poor place to develop a page against. Turn on the fixtures:

defaults:
  fixtures: [all]

Individual profiles: networks, clients, wireguard, portforwards, system, wifi.

The whole check in one command

owlab test --release 25.12.5 --release 24.10.8 \
  --install 'dist/*/luci-app-mine-*' \
  --assert 'http 200 /cgi-bin/luci/admin/services/mine' \
  --assert 'service mined'

The command starts the routers, installs, asserts, tears down, and exits 0 or 1.

CI runs this same command. Run it locally first, and you find out before the pull request does.

Full list of assertion kinds: Commands and config.

What it does that a hand-written curl does not

When a kernel module is involved

routers:
  - id: real
    fidelity: vm
    release: "25.12.5"
    packages: ["+kmod-nft-nat"]

A container shares the host kernel, so kmod-* packages install and do nothing. fidelity: vm is QEMU with OpenWrt's own kernel.