Weblink certificate deployment

Install a printer's Weblink certificates with one-liners - Windows with PowerShell, macOS/Linux/Raspberry Pi with bash.

What is Zebra "Cloud Connect" / "Weblink"?

Weblink (newer name: Cloud Connect) is the built-in cloud connectivity of modern Zebra industrial printers (ZPL printers from the ZT/ZD and ZQ series). The printer includes its own HTTPS/WebSocket client directly in the firmware and connects outbound to a central endpoint - the "Location" URL in its Weblink configuration. This makes the printer reachable behind NAT, corporate firewalls or in pure Wi-Fi, without opening a single inbound port (TeamViewer principle, just reversed: the printer is the client).

The printer picks one of two configuration slots (weblink.ip.conn1.location / weblink.ip.conn2.location), in which the relay URL is stored, and registers there. Print jobs, SGD commands and configuration changes can then be sent to the printer over this connection - which stays open permanently from the printer outbound.

For the printer to trust the relay server over TLS, the relay's certificate must be installed on the printer. Exactly for this, zplCloud generates the three files WEBLINK2_CA.NRD, WEBLINK2_CERT.NRD and WEBLINK2_KEY.NRD per domain + printer (certificates tab or POST /api/certificates/generate) - and exactly these files are installed on the printer by the deploy script below.

zplCloud's Weblink relay (e.g. weblink.zplcloud.com or live.zplcloud.com) is such an endpoint: your printers connect outbound there, and via the zplCloud platform ("Weblink" tab, Remote Printers, CLI) you can then address them like local devices - send ZPL, apply profiles and watch the connection status live. The script documented here is the last step of this setup: it brings the certificates to the printer and sets the Weblink slot configuration (URL, NTP, time), so the connection can start.

What does this script do and what is it good for?

For a Zebra printer to connect securely via TLS to your Weblink relay, it needs three certificate files (WEBLINK2_CA.NRD, WEBLINK2_CERT.NRD, WEBLINK2_KEY.NRD). These files are managed in zplCloud per domain + printer. The deploy script fetches them via API key from the backend and installs them directly on the printer - fully self-contained, without extra tools:

  • Download the NRD files (API-key protected) for domain + printer.
  • Delete old files on the printer (SGD file.delete).
  • Upload via ~DYE over TCP 9100 (standard Zebra upload).
  • Configure the Weblink slot + clock - weblink.ip.conn2.location, NTP server, timezone, RTC date/time.
  • Reset the printer (device.reset) so the new configuration becomes active.

Prerequisites

  • The certificates for the printer must have been generated in zplCloud (certificates tab or POST /api/certificates/generate).
  • An API key with access to the domain.
  • The printer must be reachable via TCP 9100 (IP or hostname).

Parameters

ParameterRequiredMeaning
hostnameyesPrinter name - determines the NRD storage (domain folder) and is the default TCP target.
apikeyyesAPI key (db.apikeys); authorizes the download of the NRD files. Validated server-side.
ipnoTCP target (IPv4 or hostname) that actually establishes the connection. Default: hostname.

Windows - PowerShell (weblink-deploy.ps1)

The script is generated server-side for your printer. Run it directly (PowerShell 5.1+):

powershell -c "irm https://zplcloud.com/weblink-deploy.ps1?hostname=printer01&apikey=sk_zplcloud_XXXX | iex"
# with explicit TCP target:
powershell -c "irm https://zplcloud.com/weblink-deploy.ps1?hostname=printer01&apikey=sk_zplcloud_XXXX&ip=10.0.0.5 | iex"

The command is idempotent: old files are deleted before the upload, and the printer is reset at the end.

macOS / Linux / Raspberry Pi - bash (weblink-deploy.sh)

The same logic as a bash script (needs only bash + curl or wget):

curl -fsSL "https://zplcloud.com/weblink-deploy.sh?hostname=printer01&apikey=sk_zplcloud_XXXX" | bash
# with explicit TCP target:
curl -fsSL "https://zplcloud.com/weblink-deploy.sh?hostname=printer01&apikey=sk_zplcloud_XXXX&ip=10.0.0.5" | bash

Supports x64 and arm64 (also Raspberry Pi / Pi OS), uses /dev/tcp for the TCP connection and mktemp for temporary files.

What happens in detail (both variants)

1) Load NRD files
   GET {api}/api/certificates/deploy/domain/{domain}/printer/{printer}/WEBLINK2_CA.NRD?apikey=...
   GET .../WEBLINK2_CERT.NRD?apikey=...
   GET .../WEBLINK2_KEY.NRD?apikey=...

2) Delete old files
   ! U1 do "file.delete" "E:WEBLINK2_CA.NRD"   (and CERT/KEY)

3) Upload (~DYE, TCP 9100)
   ~DYE:WEBLINK2_CA.NRD,B,NRD,<len>,,  + file bytes
   (same for CERT and KEY)

4) Configure Weblink slot + clock
   setvar weblink.ip.conn2.location  {weblink-URL}
   setvar ip.ntp.enable on
   setvar ip.ntp.server  ptbtime1.ptb.de
   setvar rtc.time_zone  CET-1CEST,M3.5.0/2,M10.5.0/3
   setvar rtc.date / rtc.time  (from the executing machine)

5) Reset the printer (activate configuration)
   ! U1 do "device.reset" ""

Notes

  • The API key is in the URL parameter - this authorizes the download; the script itself cannot be fetched without a key (server-side validation).
  • Error messages appear in the script output ("ERROR ..."); for problems, first check TCP reachability (port 9100) and whether the certificates were generated.
  • Both scripts write their progress log to the console - so you see every file and every SGD response.