Skip to content

Enabling remote access with Tailscale

This guide gets you from "Protequ only works on the site network" to "I can open it from my phone on mobile data". It uses Tailscale, a private network (a tailnet) between your own devices. Protequ joins it with the Tailscale adapter; nothing is opened on your firewall and no traffic is routed through Protequ's servers.

What you end up with

phone (Tailscale app) ──► your tailnet ──► Protequ install ──► web interface
                          outbound connection only, no inbound port
You open https://<node name>.<your tailnet>.ts.net and sign in with your normal Protequ account.

What you need

  • A Tailscale account for the person or organisation that owns the tailnet, and access to its admin console.
  • A Protequ install that can reach the internet over HTTPS (outbound).
  • The Tailscale app on every device you want to connect from, signed in to the same tailnet.
  • Administrator access to the machine running Protequ, because you run the installer once more to add the name; it updates the front door certificate and the sign-in settings for you.

The adapter settings themselves are described on its own page; this guide shows the whole path in order.

1. Create an auth key

In the Tailscale admin console, open Settings → Keys → Generate auth key.

  1. Switch on Reusable.
  2. Switch on Tags and choose a tag for Protequ, for example tag:protequ. A tagged machine does not belong to one person, so it keeps working when that person leaves. The tag must exist under tagOwners in the tailnet policy.
  3. Switch on Pre-approved if your tailnet requires administrators to approve new devices.
  4. Generate the key and copy it. It starts with tskey-auth- and is shown only once.

The key only matters at registration

A key lasts at most 90 days, but it is used once, when the node first joins. After that the node keeps working without it. You need a key again only if the node's saved login is lost, for example when its volume is removed.

2. Add the Tailscale node in Protequ

  1. Make sure the Tailscale adapter is installed and running.
  2. Add a device of type Tailscale node and fill in:

    Setting Value
    Auth key (auth_key) the key from step 1
    Hostname (hostname) a short name, for example protequ-site1

    Leave the other settings at their defaults. The front door is exposed on port 443 of the node. 3. Restart the device. Settings are read when the device connects, not live.

The device goes online in Protequ. In the Tailscale console the machine appears under Machines with your tag. Its full name is shown there and looks like protequ-site1.tail1234.ts.net.

Turn off key expiry for the node

A machine registered with a tag normally has key expiry switched off. If the console shows a different state, open the machine's menu and choose Disable key expiry; otherwise the node drops out of the tailnet after about six months.

3. Let Protequ accept the new name

Protequ signs people in through its identity provider, and it only accepts host names it knows. Tell the installer about the Tailscale name once. It adds the name to the front door certificate, to the trusted hosts and to the allowed sign-in redirect addresses in one go.

  1. Run the installer. On the Network access screen, enter the Tailscale name in Additional names / IPs (optional, comma-separated), together with any addresses you already use, for example 192.168.1.90, protequ-site1.tail1234.ts.net.
  2. Finish the installation.

Do this on the machine running Protequ, as administrator.

  1. Run the installer again and go to the Network access screen. Additional names / IPs is already filled in with the names the install knows, including names that were added by hand earlier (the installer reads them from the install's .env).
  2. Add the Tailscale name, keeping the entries that are already there. A name stays only as long as it stays in the field.
  3. Apply. The installer recreates the Protequ containers; your data is kept.

Known limitation: your own certificate in the Windows installer

When Use my own TLS certificate is ticked in the Windows installer, the Additional names / IPs field is not shown and no extra names are applied. This is a known limitation. In that case enter the names with the Linux installer's --sans, or use the manual route under "Without re-running the installer (not recommended)" below.

The installer remembers these names, and what is left in the field is what is applied: delete a name there to remove it. On Linux, pqinstall asks the same as the prompt "Additional names / IPs (comma-separated, optional)". When --sans is omitted, the names already in the install's .env are the default, and pqinstall --yes keeps them. --sans replaces the remembered list, so it must carry every name, for example --sans 192.168.1.90,protequ-site1.tail1234.ts.net; --sans "" clears them.

If the install has no remote-access name at all, the adapter logs a warning that mentions Network access and Untrusted host header, and suggests the node's MagicDNS name as an example. Read it with docker logs adapter-tailscale.

Without re-running the installer (not recommended)

The installer picks up names already in the install's .env (OIDC_EXTRA_HOSTS) and keeps them as long as they stay in the Network access field, so this manual route is only for installs that are not managed by the installer, or for the own-certificate limitation described above. A name that is removed from the field, left out of an explicit pqinstall --sans, or not applied because the Windows installer's own-certificate option is used, is lost the next time the installer regenerates the certificate and the sign-in settings.

Do these on the machine running Protequ, as administrator.

  1. Add the name to the trusted hosts in the install's .env file, keeping the existing entries:

    OIDC_EXTRA_HOSTS=,192.168.1.90,protequ-site1.tail1234.ts.net
    
  2. Regenerate the front door certificate and the sign-in settings. Pass every name the install is reached on, including the Tailscale one. openssl must be on PATH.

    .\configure-host.ps1 -Hosts "protequ-host,192.168.1.90,protequ-site1.tail1234.ts.net"
    

    If it fails, check that certs\nginx\nginx.crt and nginx.key still exist before you restart anything; the script replaces them.

  3. The script rewrites the realm file, but a running identity provider does not re-read it. Add the new name to the sign-in client of the running instance. This opens a shell inside its container:

    docker exec -it pq-keycloak bash
    
    K=/opt/keycloak/bin/kcadm.sh
    $K config credentials --server http://localhost:8080/idp --realm master \
       --user "$KC_BOOTSTRAP_ADMIN_USERNAME" --password "$KC_BOOTSTRAP_ADMIN_PASSWORD"
    ID=$($K get clients -r pq -q clientId=pq-server --fields id --format csv --noquotes)
    $K update clients/$ID -r pq \
      -s 'redirectUris=["https://protequ-host/signin-oidc","https://192.168.1.90/signin-oidc","https://protequ-site1.tail1234.ts.net/signin-oidc"]' \
      -s 'webOrigins=["https://protequ-host","https://192.168.1.90","https://protequ-site1.tail1234.ts.net"]' \
      -s 'attributes."post.logout.redirect.uris"=https://protequ-host/*##https://192.168.1.90/*##https://protequ-site1.tail1234.ts.net/*'
    

    Replace the values with the names your install uses and list all of them: these fields are replaced, not appended to. If the bootstrap administrator has been changed, sign in with your own administrator instead.

  4. Recreate the Protequ server so it reads the new trusted hosts, then restart the front door:

    docker compose up -d --no-deps server
    docker restart pq-nginx
    

    Recreating the server makes the adapters announce themselves again, so restart them afterwards.

Optional: use your own DNS name

You can open Protequ on a name of your own, for example pq-site.example.com, instead of the .ts.net name.

  1. Enter your name under Network access as described above, in addition to or instead of the .ts.net name.
  2. Read the node's Tailscale IP from the adapter log with docker logs adapter-tailscale. The connected line looks like this:

    Tailscale connected: dnsName=protequ-site1.tail1234.ts.net, ip=100.101.102.103, tailnet=..., peers=..., keyExpiry=...
    
  3. At your DNS provider, create an A record for your name that points at the ip= value, for example pq-site.example.com A 100.101.102.103.

The node's saved login is kept in a named volume that the installer leaves in place, so the name and the IP do not change when the installer is run again; the record stays valid. This holds once the node runs with the named volume: the first installer run that creates it registers the node again (see the last row of "If it does not work"), so create the A record after that run.

A public record does not expose Protequ

Creating the record does not make Protequ reachable from the internet. Only devices on the tailnet can connect, and the tailnet access rules still decide who. Use an A record: a CNAME to the *.ts.net name does not work, because those names cannot be resolved publicly.

4. Connect from your phone

  1. Install the Tailscale app and sign in to the same account that owns the tailnet.
  2. Turn off Wi-Fi so the phone is on mobile data.
  3. Open https://protequ-site1.tail1234.ts.net and sign in with your Protequ account.

Certificate warning

The front door certificate is signed by the install's own certificate authority, so a phone that has not been told to trust it shows a warning. Either accept the warning for this site, or install the install's root certificate on the phone. The front door serves it at https://<name>/ca.crt.

If it does not work

What you see Cause and fix
Page does not load at all The phone is not on the tailnet, or the access rules do not allow it to reach the Protequ tag on port 443. Check the Tailscale app shows the machine as connected.
Page loads, then an error on sign-in The name is not accepted yet. The server log says Untrusted host header: enter the name under Network access in the installer and apply it (step 3). The adapter log (docker logs adapter-tailscale) also warns when the install has no remote-access name.
Sign-in reports an invalid redirect The identity provider does not know the name yet. Enter the name under Network access and apply it (step 3). A name added without the installer is kept by the installer only while it stays in the field; if it is removed there, an explicit --sans leaves it out, or the Windows installer's own-certificate option is used (no names are applied then), it is lost the next time the installer runs.
Tailscale says you attempted to log in to a different tailnet You are signed in to Tailscale with a different identity (for example another GitHub account) than the one that owns the tailnet. Sign out and sign in with the owner's account, or use a private window.
Device stays offline, log says the node needs login The auth key is missing, expired or revoked. Create a new key, enter it, restart the device.
The node vanished after an upgrade The first run of an installer that keeps the node's login in a named volume starts with an empty volume, so the node registers once more with the auth key stored in the device (create a new key if it has expired). Delete the old machine entry in the console. Later installer runs keep the login, so the name and IP stay the same.
  • Tailscale adapter — settings, security notes and troubleshooting for the adapter itself.