Your setup
These stay in this browser. Nothing is sent anywhere.
What you need
- NTAG 424 DNA tags. Stickers, cards or key fobs with this exact chip. Plain NTAG 213/215/216 tags won't work.
- A USB NFC reader that speaks PC/SC, such as the ACS ACR122U. You need it only to set up tags; phones do the tapping afterwards. Have an Android phone with NFC? Once knurd works, the Android app can set tags up instead.
- A computer to run knurd (Linux, macOS or Windows) that stays on while you want taps to work.
- Java 21 or newer on that computer.
1. Install Java and the reader driver
sudo dnf install java-21-openjdk pcsc-lite pcsc-lite-ccid sudo systemctl enable --now pcscd.socket
sudo apt install openjdk-21-jre pcscd libccid sudo systemctl enable --now pcscd.socket
Install Java 21, for example with Homebrew, or with the installer from adoptium.net. The reader driver is built in.
brew install openjdk@21
Install Java 21 from adoptium.net and tick Set JAVA_HOME in the installer. The reader driver is built in. Windows hasn't been tested much yet, so please report problems.
Check Java with java -version. It should say 21 or higher.
2. Download and unzip
From the latest release, download the two files under Assets. You can ignore the two "Source code" files GitHub adds to every release.
knurctl-.zip
The tag setup tool. Needed on the computer with the USB reader.
knurd-.zip
The server that checks taps and runs actions, with knurgN built in.
Unzip both and make one folder for your settings. knurctl and knurd both read knurd.properties from the folder you run them in, so always run them from this folder.
mkdir -p ~/knura && cd ~/knura unzip ~/Downloads/knurctl-.zip unzip ~/Downloads/knurd-.zip mkdir -p home && cd home # your settings live here # shortcuts for this terminal (add them to your shell profile to keep them) alias knurctl="$HOME/knura/knurctl-/bin/knurctl" alias knurd="$HOME/knura/knurd-/bin/knurd"
Unzip both into C:\knura with Explorer, make a folder C:\knura\home, and open a Command Prompt there:
cd C:\knura\home doskey knurctl=C:\knura\knurctl-\bin\knurctl.bat $* doskey knurd=C:\knura\knurd-\bin\knurd.bat $*
3. Make your master key
knurctl init
This writes knurd.properties with a new random master key. Every tag you set up gets its own keys worked out from it.
4. Set up a tag
Plug in the reader, then:
knurctl readers # should list your reader knurctl provision # put a new tag on the reader when asked knurctl tap # reads the tag like a phone does and checks the link
Leave the tag on the reader until provision says it's done. knurctl info shows the tag's UID at any time. Enter it above for step 7.
For now the tag's link points at http://127.0.0.1:8424/tap, which only works on this computer. Step 6 changes that.
5. Start knurd and check a tap
knurd
It prints knurd listening on http://127.0.0.1:8424. Leave it running, open a second terminal in the same folder, and check a tap:
knurctl tap # prints the link the tag just wrote curl '<the link knurctl printed>' # {"status":"ok",...} curl '<the same link again>' # {"status":"replay",...}
That second answer is the point of Knura: a copied or reused link is refused.
6. Let phones reach knurd
A phone opens the link on the tag, so knurd needs an HTTPS address the phone can reach. The address must never change, because it's written onto the tag. The free, simplest way is Tailscale Funnel.
- Install Tailscale on knurd's computer and sign in. Turn on HTTPS and Funnel for your tailnet when it asks.
- Start the funnel to knurd's port. It prints your address, ending in
.ts.net. Enter it above.sudo tailscale funnel --bg 8424 tailscale funnel status # shows your address again
- Add your address to
knurd.properties:public.url=
- Restart knurd (Ctrl+C, then
knurd). - Rewrite the tag's link to use the new address:
knurctl provision --from knura
Now tap the tag with your phone. You should see a "Tap verified" page. Refresh it and you'll see "Link already used".
A new Funnel address can take up to 15 minutes to work from phones. If the phone shows a blank page, wait and try again.
Optional: tags that survive a move (tap.knura.io)
If you might move knurd to another computer later, register with the free tap.knura.io forwarder. Tags then carry a tap.knura.io link, and moving means registering the new address instead of rewriting every tag.
knurctl resolver register # creates your owner ID and key # restart knurd, then: knurctl resolver register # points tap.knura.io at knurctl provision --from knura knurctl resolver check # shows where your taps go
Back up knurd.properties again afterwards: it now holds your resolver key too.
7. Make a tap do something
knurgN, built into knurd, runs an action for each verified tap. The first connector is a signed webhook. To try it, open webhook.site, copy your unique URL and enter it above with your tag's UID.
Create knurgn.properties in your settings folder:
knot..name=front-door knot..actions=test-hook webhook.test-hook.url= secrets.file=knurgn-secrets.properties
Make the signing secret. Only you may read this file, or knurd refuses to start.
(umask 077; printf 'test-hook=whsec_%s\n' "$(openssl rand -base64 32)" > knurgn-secrets.properties) echo 'actions.file=knurgn.properties' >> knurd.properties
$b = New-Object byte[] 32; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b) "test-hook=whsec_" + [Convert]::ToBase64String($b) | Set-Content -Encoding ascii knurgn-secrets.properties Add-Content -Encoding ascii knurd.properties "actions.file=knurgn.properties"
Restart knurd. It should print knurgN: 1 knot(s) with actions. Tap the tag with your phone and webhook.site shows the event. A replayed link sends nothing.
When you're ready, point the webhook at your own code, Node-RED or a home server. The README explains the event format and how to check the signature. For Apple Home, Google Home and Alexa, see the Matter bridge. For Home Assistant, follow the Home Assistant guide.
8. Keep knurd running
knurd only works while it's running.
A systemd user service starts it with your computer:
mkdir -p ~/.config/systemd/user cat > ~/.config/systemd/user/knurd.service <<EOF [Unit] Description=Knura tap server [Service] WorkingDirectory=$HOME/knura/home ExecStart=$HOME/knura/knurd-/bin/knurd Restart=on-failure [Install] WantedBy=default.target EOF systemctl --user daemon-reload systemctl --user enable --now knurd sudo loginctl enable-linger $USER # keep it running when you're logged out journalctl --user -u knurd -f # watch its log
For now, keep knurd running in a terminal window. A ready-made background service for macOSWindows is on the roadmap.
Upgrading
Download the new zips, unzip them next to the old ones, and update your shortcuts and the service file. Your settings folder stays as it is: the master key, counters and rules carry over, and tags keep working.
You're set up
Your tag is verified, reachable from phones and runs an action. Next, set tags up from your Android phone, try more connectors or read how Knura keeps taps safe.
Troubleshooting
| What you see | What to do |
|---|---|
knurctl readers lists nothing | Check the reader is plugged in and pcscd is running (systemctl status pcscd). |
SELECT NDEF file failed with status 6A82 or another card error | The tag moved or hadn't settled. Leave it flat on the reader and run the command again. |
java: command not found or a version error | Install Java 21 and open a new terminal. |
knurd can't find knurd.properties | Run knurd from your settings folder, where knurctl init wrote it. |
| knurd refuses a secrets or key file | Only you may read it: chmod 600 <file>. |
Every tap is rejected | The tag was set up with a different master key. Use the knurd.properties it was provisioned with. |
| Phone says "address not found" | The tag's link has the wrong address. Check public.url against tailscale funnel status, restart knurd, and run knurctl provision --from knura again. |
| Phone shows a blank page | A new Funnel address can take up to 15 minutes to appear. Try curl /health from another network. |
| "Link already used" on the first tap | Something opened the link before you did, such as a link preview. Tap again. |
Stuck? Ask in the community forum. Found a bug? Open an issue. Found a security problem? Please report it privately.