> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plato.ae/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and run the PC printer driver.

# Installation

The production artifact is `drivers/pc-printer/plato-printer.zip`. It contains the executable, default configuration, Caddy assets/certificates, and Redis binaries.

## Production Install

1. Copy `plato-printer.zip` to the Windows machine that can reach the printers.
2. Extract the zip into a stable folder, for example `C:\PlatoPrinter`.
3. Edit `config.json`.
4. Run `plato-printer.exe`.
5. Allow Windows Firewall access for the configured HTTP port.
6. Confirm the service is reachable:

```sh theme={null}
curl http://localhost:8080/health
```

Expected response:

```json theme={null}
{
  "ok": true,
  "version": 66,
  "uptime": 12.345
}
```

## Network Install Checklist

* The driver machine can reach every printer IP and printer port.
* POS browsers can reach the driver machine.
* Port `8080` is open for HTTP, unless changed in `config.json`.
* Port `443` is open if HTTPS is enabled.
* Printer IP addresses are static or reserved in DHCP.
* Thermal printers accept raw ESC/POS over TCP.

## HTTPS Install Checklist

When HTTPS is enabled:

1. Keep `features.httpsEnabled` and `caddy.enabled` set to `true`.
2. Make sure `assets/certs/ca.crt`, `server.crt`, and `server.key` exist.
3. Point `caddy.domain` to the driver machine, usually through DNS or a hosts entry.
4. Install the CA certificate from:

```txt theme={null}
http://<driver-ip>:8080/ca.crt
```

5. Use the HTTPS driver URL from Console, usually:

```txt theme={null}
https://plato-printer.local
```

## Auto Launch

On startup, the executable registers auto-launch using the app name `Plato PC Printer`. The executable path is `process.execPath`, and the service is configured to start hidden.

If auto-launch fails, the driver logs the failure and continues running.

## Development Install

From the repository root:

```sh theme={null}
pnpm install
pnpm --filter @plato/pc-printer build
pnpm --filter @plato/pc-printer start
```

The development server reads `config.json` from `drivers/pc-printer` when started in that folder.

## Local Health Check

```sh theme={null}
curl http://localhost:8080/health
curl http://localhost:8080/queue-status
```

If HTTPS is enabled and configured:

```sh theme={null}
curl https://plato-printer.local/health
```
