CUPS server with docker

  • Hi,

    I would like to plug my old printer in my rpi4 on which libre-elec is installed and then print

    All the documentation I found about docker can only install images from linuxserver.io

    But I'd like to install this one Docker Hub

    Is there a way ?

    Or should I go with linuxserver/rdesktop with extra port redirection and install CUPS in it ?

    Thanks for any help

    Solved here : CUPS server with docker

    Edited 2 times, last by Exstramonium (July 21, 2020 at 4:28 PM).

  • Linuxserver.io ones can be installed via addons for added convenience and ease of use but you can use any docker image via command line (docker run) or portainer on libreelec (assuming you're using the correct arch)

  • I finally made it, the problem was not that my printer was not recognized but that I did not "give" the usb bus to the container.

    An other problem I encountered was that kodi already used the avahi port and and needed it to advertise my printer on my local network

    I solved that by asking for a second IP for my device

    Code
    ip addr add 192.168.1.32 dev eth0

    Check your printer can be found with

    Code
    lsusb

    Save its location in a variable, my printer is a Canon, change with yours

    Code
    BUS=$(/opt/sbin/lsusb|grep Canon|awk '{print $2}')
    DEV=$(/opt/sbin/lsusb|grep Canon|awk '{print $4}')
    DEV="${DEV%?}"
    PRINTER="/dev/bus/usb/$BUS/$DEV"

    Then I finally ran the docker command

    Code
    docker run -d -p 192.168.1.32:631:631 -p 192.168.1.32:5353:5353 -e ADMIN_PASSWORD=mySecretPassword --name cups-server --device=$PRINTER ydkn/cups:latest

    Now, from another device on the local network try https://192.168.1.32:631, go in the administration panel and add your printer (username admin, password mySecretPassword which you have of course changed)

    Now add a printer, search a printer a the network, host 192.168.1.32 and you should find it

    Many thanks to Setting up a CUPS server with Docker on a Synology NAS for my Brother printer

  • Kodi Libreelec Print server

    It FUNCION!
    I have tested it on Rapsberry Pi 3+ (Kodi / Libreelec) as a print server

    Hello everyone
    I want to share my discovery. I use my Raspberry with Kodi libreelec and I have an old laser printer with USB. Can Kodi be used as a print server?
    Yes!. After searching many forums and testing configurations I managed to get it to work
    Thanks to all your contributions (and other forums too)

    STEP 1:

    First, in my Kodi / Libreelec / Rapsberry I installed the addon “Docker” and the Container “LinuxServer.io’s Docker Add-ons”

    I connected my old laser printer to the USB port of my Rapsberry

    STEP 2:
    On my Windows PC I installed Putty.exe to connect to the Kodi terminal, via SSH
    By default the values are:
    • root user
    • password libreelec

    Then, in Putty/SSH Terminal:...

    Check if your Raspberry recognizes the USB port to which your printer is connected
    # lsusb
    Bus 001 Device 004: ID 043d: 00ee Name_of_my_Printer

    Install CUPS
    The following command installs and starts the CUPS Printer container in Docker. The line “—restart” indicates that CUPS will start automatically (autorun) every time the system is rebooted

    # docker run -d --restart unless-stopped cups ¡-p 631: 631 --privileged -v / var / run / dbus: / var / run / dbus -v / dev / bus / usb: / dev / bus / usb --name cups a0js / rpi-cups

    The a0js / rpi-cups package will be downloaded from the Docker container ... Be patient...

    When the installation is finished, check that the CUPS container is started

    # docker ps -a
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    9ce1205452fc a0js / rpi-cups "/ usr / sbin / cupsd -f" 19 hours ago Up About an hour 0.0.0.0:631->631/tcp cups

    STEP 3:

    Now, in your pc browser enter the CUPS web interface
    http: // MY_KODI_IP: 631 / admin
    • admin print
    • passw print

    STEP 4:

    To add a printer in Windows (Internet Printing Protocol)
    http: // My_Kodi_IP: 631 / printers / Name_of_my_Printer

    STEP 5:
    Lucky!

    W!

    Note: To start or stop CUPS Print server (it will always be in start or Stop in Docker autostart)
    • # docker start cups
    • # docker stop cups
    Note: TO REMOVE container name
    • # docker rm cups