Skip to main content

Cloudflare

1. Overview​

Cloudflare Tunnel can publish the local web management interface of a PicoKVM or compatible PLC through a domain name without opening inbound ports on the local router. PicoKVM and the PLC include cloudflared; after a Tunnel Token is added to the device, the built-in service establishes an outbound connection to Cloudflare.

Example values used in this guide:

ItemExample
Domain<DOMAIN>
Public hostnamedevice.<DOMAIN>
Device-local servicehttp://127.0.0.1:80
Authorized use

Publish a management interface only for devices that you are authorized to manage. Enable access control before sharing the public hostname.

2. Prepare a Domain​

Cloudflare Tunnel requires a domain that you control and can manage through Cloudflare DNS. You can use a free domain that supports custom nameservers, register a domain with Cloudflare Registrar, or buy one from NameSilo or another registrar.

If the domain is not registered with Cloudflare:

  1. Log in to the Cloudflare dashboard.

  2. Click Add a domain and enter <DOMAIN>.

  3. Follow the Cloudflare wizard to add DNS records.

  4. Change the domain nameservers at the domain provider to the nameservers assigned by Cloudflare.

  5. Wait until the domain status in Cloudflare becomes active.

3. Create a Cloudflare Tunnel​

  1. Open the Cloudflare dashboard and go to Networking -> Tunnels.

  2. Click Create a tunnel. Enter a tunnel name, for example remote-device.

  3. On the connector setup page, select a Debian option to display the connector command. The device already includes cloudflared, so you do not need to run this command manually.

  4. Copy the string after --token in the command, paste it into the Cloudflare Tunnel Token field on the PicoKVM or PLC, and start the built-in cloudflared service.

  5. After the connector starts, the tunnel should show an active connector in the Cloudflare dashboard.

4. Add a Public Hostname​

  1. Open the created tunnel and go to Routes.

  2. Click Add route and select Published application.

  3. Fill in the hostname:

    FieldValue
    Subdomaindevice
    Domain<DOMAIN>
    TypeHTTP
    URL127.0.0.1:80

  4. Save the hostname.

After saving, Cloudflare creates the required proxied DNS record automatically. Access the target device's web management interface from:

https://device.<DOMAIN>

5. Verify Remote Access​

  1. On a device outside the target device's LAN, open:

    https://device.<DOMAIN>
  2. Log in to the target device's web management interface.

If the page cannot be opened, check the following items:

  • The built-in cloudflared service is running on the PicoKVM or PLC, and the Tunnel Token is correct.
  • The tunnel connector is online in Cloudflare.
  • The published application route uses HTTP and points to 127.0.0.1:80.
  • The device's local web management service is available on port 80.
  • The domain status in Cloudflare is active.

6. References​