Moqui-cups in Docker

CUPS is a network protocol for printing. There needs to be a CUPS server running with a server attached to use it for printing.

If I run

$ nmap localhost
Starting Nmap 7.92 ( https://nmap.org ) at 2024-08-30 12:27 MDT
Nmap scan report for localhost (127.0.0.1)
...
PORT    STATE SERVICE
631/tcp open  ipp

Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds

The port 631 on localhost is open on my development machine.

If I go to http://localhost:631, I get the following.

Then if I run Moqui with moqui-cups installed and run the get#ServerPrinters service, I get the printers configured in cups:

When you build a server through docker and deploy it, you must have a cups service running on the server that the docker moqui instance can run, and that cups server must have access to the printers that you need to use. You can’t just run one of the off the shelf Docker compose / moqui Docker images and expect CUPS to work. You could modify the existing Moqui docker file to run a cups service (probably easiest). The current Moqui Docker file in docker/simple uses ubuntu: https://hub.docker.com/layers/library/eclipse-temurin/11-jdk/images/sha256-62f1d44e387778699855a7e54ba00195fc275375c8d55d37148903fe0b93f9bc?context=explore, so you can install cups and you should be on your way. Or if you’re running multiple Moqui instances / want to follow microservice best practices you could use something like: GitHub - anujdatar/cups-docker: CUPS server running in a docker container.


Keep in mind I have no idea what you’re printing for. Using CUPS is most often not the most convenient way to setup printers especially for anything close to a SaaS product. If you need to have the customer’s client print out a document or have a workstation used for shipping, I recommend using QZ Tray (setup). QZ Tray requires the client to download the QZ Tray desktop application, but it will connect to printers on the customer’s client side. It’s at least worth looking into for printing.

1 Like