PrintBase
  • Product
  • Pricing
  • Docs
  • Resources
PrintBase/Guides/Printing troubleshooting

Print from AWS to a printer behind a firewall

A server on AWS does not need a path to the printer's private IP. The office agent connects outbound and your server posts a job.

For Backend developers printing from a VPC

This page in another language: 中文

Overview

From a VPC, the printer's 192.168.x.x address does not exist. A VPN or a port forward would create a path, and a port forward would publish the printer. The agent removes that requirement: it runs in the office and opens an outbound WebSocket.

The AWS service needs outbound HTTPS to the API and the API key. It does not need a security-group rule toward the office. The office firewall needs to allow the agent out. It does not need an inbound rule for PrintBase.

Use the job status to see AGENT_OFFLINE when that office PC is asleep. That is a clearer signal than a VPN tunnel that is up while the printer is not.

Integration steps

  1. 01

    Install the agent in the office

    Not on the EC2 instance, unless the printer is somehow on that instance.

  2. 02

    Allow the agent outbound

    To api.printbase.cloud or the China host if you selected it.

  3. 03

    POST from the VPC

    No private IP in the JSON. printer_code only. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.

  4. 04

    Do not port-forward 9100

    That exposes a printer protocol. It is unnecessary here. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.

Node.js

// Job from a cloud server, no printer IP
const res = await fetch('https://api.printbase.cloud/v1/print-jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': idempotencyKey,
  },
  body: JSON.stringify({
    printer_code: Number(process.env.PRINTER_CODE),
    content_type: 'pdf',
    content: pdf.toString('base64'),
    copies: 1,
  }),
});
if (!res.ok) throw new Error(`PrintBase ${res.status}: ${await res.text()}`);
const job = await res.json();
// { id: "job_abc", status: "queued" }

Details for this setup

content_url and private buckets

The agent downloads content_url. A URL that only resolves inside the VPC will fail with DOWNLOAD_FAILED. Use base64 or a presigned URL the agent can reach.

Same for Azure or a local server

The caller only needs HTTPS. The network you deploy on does not change the JSON.

Questions

Should the EC2 instance join the office VPN?

Not for printing. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.

Which security group port?

Outbound 443 to the API. No inbound from the printer. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.

Can I pass the printer IP as printer_code?

No. printer_code is the integer from GET /v1/printers. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.

The job stays queued.

The agent is not connected, or the printer is offline. Read the reason.

Related guides

  • Print from a cloud app to an office without a VPN

    An app on AWS or Azure can print to a branch office by posting a job. The office runs the agent. You do not merge the networks for printing.

  • The print agent keeps going offline

    AGENT_OFFLINE means the computer's agent is not connected. Sleep, network, and a stopped process are the usual causes. The printer itself is a different code.

  • Print from cloud-hosted SAP without a site-to-site VPN

    Send a SAP document PDF to an on-prem printer without a VPN to that printer. Your integration layer calls the API; the agent connects outbound.

Free plan: 100 jobs a month on one computer, no card.

Create a free accountRead the API docs
PrintBase

PrintBase connects your applications to physical printers anywhere - securely, reliably, and in real time.

Product
Receipt PrintingLabel PrintingDashboardDevicesWebhooks
Resources
DocsBlogStatusAPI ReferenceDownloadPrintBase vs PrintNodePrintNode PricingFAQ
Guides
All guidesIntegrationsPrintersCode samplesComparisonsUse casesTroubleshooting
Company
ContactSecurityPrivacy

© 2026 Aveniq Technologies OÜ. All rights reserved. PrintBase is a service of Aveniq Technologies OÜ.

PrivacyTermsRefunds