Article Image
read

For my paperless-ngx install, I wanted to be able to easily "print" to it from anywhere in my network. I find this is slightly easier than logging in to the interface or dragging/dropping to the consume folder for some docs.

One of the hardest parts of this setup was making the printer available on the network and visible accepting postscript.

Quick Install

The fastest way to get this running is to check out the repo cups-virtual-printer.

Explanation

This system is composed of two parts:

  • Cupsd printer with printer-driver-cups-pdf configured to output to /mnt/output
  • avahi-daemon, configured to use a custom service file and with dbus disabled (it'd work with dbus, but one less dependency!)

In addition, the docker container needed to be configured with macvlan so that the container had a "real" IP and was able to expose avahi discovery on the network.

Compose file

cups-virtual-printer docker image

version: "3.4"
services:
  printserver:
    build: .
    restart: unless-stopped
    networks:
      - cups-vlan
    volumes:
      - /tmp/output:/mnt/output
    ports:
      - 631:631 # Expose HTTP server

networks:
  cups-vlan:
    driver: macvlan
    driver_opts:
      parent: eth0 # Update as necessary
    ipam:
      config:
        - subnet: "192.168.0.0/24"
          ip_range: "192.168.0.12/32" #static IP
          gateway: "192.168.0.1"

Conclusion

The hardest part of this setup was figuring out all the configuration to make the system work as expected. After that a lot of trial and error, the service now works reliably. I use it to write a pdf to the consume-directory of my paperless-ngx installation, which then ingests the file.

Blog Logo

Christopher LaPointe


Published

Interested in Related Posts from this Site?

Set up your own mailserver with Maddy

February 10, 2022: About a year ago I wanted to expand beyond namecheap's simple "email forwarding" service and...

Extracting a Certificate from Traefik/acme.json

February 04, 2022: It's a fairly common need to extract a certificate and key from traefik to use...

Docker Samba / CIFS Volume (Photoview)

July 12, 2021: Recently I had a need to mount a CIFS volume as a docker volume: The...

Self-Hosted Analytics: Docker & Privacy-First

July 02, 2021: I have a lot of little sites. Probably too many. Includes various personal sites, sites...

Docker Swarm Registry and Auto Garbage Collection on NFS

March 15, 2021: After moving Traefik to v2, I also updated the common registry infrastructure. Namely, this stack...

Image

Chris LaPointe

Another site of Code

Back to Overview