HUB
Sign inSign up
cups logo

infra7/cups

By infra7

•Updated 7 days ago

CUPS printing server running in a docker container

Image
Message queues
0

10K+

infra7/cups repository overview

⁠Infra7 CUPS Container (infra7/cups)

A hardened, modern CUPS container designed for two clear use cases:

  1. Print Proxy (proxy variant): A lightweight bridge to expose legacy or network printers over IPP/AirPrint, centralize print queues, or isolate print traffic.
  2. Embedded Print Server (full variant): A complete print server with USB passthrough, Avahi/mDNS discovery, D-Bus, HPLIP, and an extensive collection of printer drivers.

Available on Docker Hub: infra7/cups


⁠Image Variants

TagVariantIncluded ComponentsBest For
latest, <version>Fullcups, cups-filters, avahi-daemon, dbus, hplip, printer-driver-all, foomatic-db, openprinting-ppdsDirect USB printers, embedded print appliances (e.g., Raspberry Pi), and environments requiring local PPD/driver rendering.
latest-proxy, <version>-proxyProxycups, cups-filtersRelaying jobs to IPP/network printers, AirPrint bridging, and minimal-footprint deployments.

⁠Deployment Examples

⁠1. Print Proxy Mode (docker-compose.yml)

Minimal setup using Docker Secrets for administrative credentials and persistent configuration storage:

name: cups-proxy

services:
  cups:
    image: infra7/cups:latest-proxy
    restart: unless-stopped
    environment:
      TZ: America/Sao_Paulo
    ports:
      - "631:631"
    secrets:
      - cups_admin
      - cups_password
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - ./config/cups:/etc/cups

secrets:
  cups_admin:
    file: ./secrets/cups_admin
  cups_password:
    file: ./secrets/cups_password
⁠2. Embedded Print Server Mode (docker-compose.yml)

Full setup with USB hardware passthrough, mDNS/AirPrint discovery (avahi-daemon), and dbus:

name: cups-server

services:
  cups:
    image: infra7/cups:latest
    restart: unless-stopped
    devices:
      - /dev/bus/usb:/dev/bus/usb
    environment:
      TZ: America/Sao_Paulo
      START_DBUS_DAEMON: "ON"
      START_AVAHI_DAEMON: "ON"
    ports:
      - "631:631"
      - "5353:5353/udp"
    secrets:
      - cups_admin
      - cups_password
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - ./config/cups:/etc/cups
      - ./config/avahi:/etc/avahi

secrets:
  cups_admin:
    file: ./secrets/cups_admin
  cups_password:
    file: ./secrets/cups_password

Before starting either stack, create your credential files:

mkdir -p ./secrets
echo 'admin' > ./secrets/cups_admin
echo 'YourStrongPassword' > ./secrets/cups_password
chmod 600 ./secrets/cups_*

Note: Credentials are read exclusively from secret files (CUPSADMINFILE / CUPSPASSWORDFILE). If omitted, CUPS starts without an administrative account and Web UI administration remains locked.


⁠Configuration Reference

VariableDefaultDescription
CUPSADMINFILE/run/secrets/cups_adminPath to the file containing the admin username.
CUPSPASSWORDFILE/run/secrets/cups_passwordPath to the file containing the admin password.
CUPSERRORLOGstderrLog destination (stderr, syslog, or an absolute file path).
CUPS_SERVER_ALIAS*Allowed Host header values (ServerAlias in cupsd.conf).
CUPS_DEFAULT_ENCRYPTIONIfRequestedTLS policy (IfRequested, Required, or Never).
START_DBUS_DAEMONOFFEnable dbus-daemon inside the container (ON / OFF).
START_AVAHI_DAEMONOFFEnable avahi-daemon for mDNS/AirPrint discovery (ON / OFF).
TZEtc/UTCContainer timezone.
HOME/tmpWritable home directory for auxiliary processes.

⁠Web Administration

Access the CUPS Web UI at https://<server-ip>:631 (or http://<server-ip>:631, which automatically upgrades to TLS for administrative routes).

⁠Credits

Originally inspired by anujdatar/cups-docker⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:2b8f3433f…
Size
151.9 MB
Last updated
7 days ago
docker pull infra7/cups:latest