Get started

From the release downloads to your first tap

Set up a tag, check it, let phones reach it and make it do something. No building from source. Pick your system and fill in your details, and every command below updates to match.

0 of 8 steps done
Easier way: the installers for Windows, Ubuntu, Debian, Fedora and Raspberry Pi include Java and open a setup page that does these steps for you. This guide is for the plain downloads and the terminal.
Alpha. Knura is early software. Don't use it to protect anything that matters yet. Prefer plain text? The same guide is in the repository.

Your setup

Computer that runs Knura

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

Terminal
sudo dnf install java-21-openjdk pcsc-lite pcsc-lite-ccid
sudo systemctl enable --now pcscd.socket
Terminal
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.

Terminal
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.

Terminal
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:

Command Prompt
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

~/knura/home
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.

Back this file up somewhere safe and private, such as a password manager or an encrypted USB stick. Without it you can't verify or reset your tags. Never share it or put it in Git.

4. Set up a tag

Plug in the reader, then:

~/knura/home
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

~/knura/home
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:

second terminal
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.

  1. Install Tailscale on knurd's computer and sign in. Turn on HTTPS and Funnel for your tailnet when it asks.
  2. Start the funnel to knurd's port. It prints your address, ending in .ts.net. Enter it above.
    Terminal
    sudo tailscale funnel --bg 8424
    tailscale funnel status      # shows your address again
  3. Add your address to knurd.properties:
    knurd.properties
    public.url=
  4. Restart knurd (Ctrl+C, then knurd).
  5. Rewrite the tag's link to use the new address:
    ~/knura/home
    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.

~/knura/home
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:

knurgn.properties
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.

~/knura/home
(umask 077; printf 'test-hook=whsec_%s\n' "$(openssl rand -base64 32)" > knurgn-secrets.properties)
echo 'actions.file=knurgn.properties' >> knurd.properties
PowerShell, in C:\knura\home
$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:

Terminal
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.

Troubleshooting

What you seeWhat to do
knurctl readers lists nothingCheck the reader is plugged in and pcscd is running (systemctl status pcscd).
SELECT NDEF file failed with status 6A82 or another card errorThe tag moved or hadn't settled. Leave it flat on the reader and run the command again.
java: command not found or a version errorInstall Java 21 and open a new terminal.
knurd can't find knurd.propertiesRun knurd from your settings folder, where knurctl init wrote it.
knurd refuses a secrets or key fileOnly you may read it: chmod 600 <file>.
Every tap is rejectedThe 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 pageA new Funnel address can take up to 15 minutes to appear. Try curl /health from another network.
"Link already used" on the first tapSomething 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.