A dockerized CUPS (Common Unix Printing System) server specifically configured for Canon LBP-1120 laser printers with automatic network discovery via Avahi.
- Overview
- Features
- Quick Start
- Configuration
- Management Commands
- Advanced Usage
- Troubleshooting
- Technical Details
- About CUPS and Avahi
This project provides a ready-to-use Docker container that runs a CUPS print server with pre-installed Canon CAPT drivers for the LBP-1120 printer. The container includes Avahi daemon for automatic printer discovery on your local network, making it easy to set up network printing for this older Canon laser printer model.
Supported Platforms: Linux (x86_64), macOS (with Docker Desktop)
- CUPS server in a lightweight Docker container
- Canon LBP-1120 printer support with CAPT drivers pre-installed
- Avahi daemon for automatic network discovery (mDNS/Bonjour)
- Web interface for printer management at http://localhost:631
- Optimized settings for monochrome printing with enhanced black output
- Automatic printer configuration on first run
- Persistent configuration support via volume mounts
- Docker installed on your system (Install Docker)
- Canon LBP-1120 printer connected to the network or USB
- Printer IP address (if using network connection)
docker build -t lbp-1120-cups .Before running the container, edit start.sh to set your printer's IP address:
# Change this line in start.sh:
lpadmin -p CanonLBP-1120 -E -v socket://0.0.0.0 ...
# To your printer's IP, for example:
lpadmin -p CanonLBP-1120 -E -v socket://192.168.1.100 ...docker run \
-d \
-p 631:631 \
-p 5353:5353 \
-v /var/run/dbus:/var/run/dbus \
--name lbp-1120 \
lbp-1120-cupsFor USB connection, add the device mapping:
docker run \
-d \
-p 631:631 \
-p 5353:5353 \
-v /var/run/dbus:/var/run/dbus \
--device=/dev/usb/lp0 \
--name lbp-1120 \
lbp-1120-cupsOpen your browser and navigate to: http://localhost:631
Default credentials: root / root (if prompted)
| Port | Protocol | Purpose |
|---|---|---|
| 631 | TCP | CUPS web interface and IPP (Internet Printing Protocol) |
| 5353 | UDP | Avahi mDNS for printer discovery |
| Host Path | Container Path | Purpose |
|---|---|---|
/var/run/dbus |
/var/run/dbus |
Required for D-Bus communication between services |
(optional) /path/to/config |
/etc/cups |
Persist CUPS configuration between container restarts |
The container automatically configures the Canon LBP-1120 with these optimized settings:
- Printer Name:
CanonLBP-1120 - Color Mode: Monochrome
- Enhanced Black Printing: Enabled
- Skip Blank Pages: Enabled
- Default Location: Kitchen (configurable in
start.sh) - Connection Protocol: Socket (AppSocket/JetDirect)
You can modify printer settings in start.sh before building:
# Change printer location
lpadmin -p CanonLBP-1120 -L "Office" ...
# Change printer IP address
lpadmin -p CanonLBP-1120 -v socket://192.168.1.100 ...
# Modify printer options
lpadmin -p CanonLBP-1120 -o Color=Mono -o CNSkipBlank=ON ...docker ps | grep lbp-1120docker logs lbp-1120docker stop lbp-1120docker restart lbp-1120docker stop lbp-1120
docker rm lbp-1120docker stop lbp-1120
docker rm lbp-1120
docker build -t lbp-1120-cups .
docker run -d -p 631:631 -p 5353:5353 -v /var/run/dbus:/var/run/dbus --name lbp-1120 lbp-1120-cupsCreate a docker-compose.yml file:
version: '3.8'
services:
cups:
build: .
container_name: lbp-1120
ports:
- "631:631"
- "5353:5353"
volumes:
- /var/run/dbus:/var/run/dbus
- ./cups-config:/etc/cups # Optional: persist configuration
restart: unless-stopped
privileged: falseThen run:
docker-compose up -dTo preserve printer settings between container restarts:
mkdir -p ./cups-config
docker run \
-d \
-p 631:631 \
-p 5353:5353 \
-v /var/run/dbus:/var/run/dbus \
-v $(pwd)/cups-config:/etc/cups \
--name lbp-1120 \
lbp-1120-cupsTo troubleshoot or make live changes:
docker exec -it lbp-1120 /bin/bashInside the container or via web interface:
# List available PPD files
lpinfo -m | grep -i canon
# Check printer status
lpstat -p CanonLBP-1120 -l
# Test print
echo "Test page" | lp -d CanonLBP-1120
# View printer options
lpoptions -p CanonLBP-1120 -lTo add additional printers, modify start.sh:
# Add a second printer
lpadmin -p CanonLBP-1120-Office -E \
-v socket://192.168.1.101 \
-P /usr/share/ppd/CNCUPSLBP1120CAPTJ.ppd \
-L "Office" \
-o Color=Mono -o CNEnhanceBlkPrt=ON -o CNSkipBlank=ON-
Verify printer is powered on and connected
ping 192.168.1.100 # Use your printer's IP -
Check container logs for errors
docker logs lbp-1120
-
Verify printer IP address in start.sh
grep "socket://" start.sh -
Check firewall settings
# On Linux sudo ufw status sudo ufw allow 631/tcp sudo ufw allow 5353/udp -
Test printer connection manually
docker exec -it lbp-1120 /bin/bash telnet 192.168.1.100 9100 # AppSocket port
-
Confirm container is running
docker ps | grep lbp-1120 -
Check port binding
docker port lbp-1120
-
Verify no port conflicts
# On Linux/macOS lsof -i :631 # Or netstat -an | grep 631
-
Try accessing with explicit localhost
-
Check browser security settings
- Some browsers may block self-signed certificates
- Try using a different browser or incognito mode
-
Verify Avahi is running
docker logs lbp-1120 | grep -i avahi -
Check mDNS port availability
# Ensure port 5353 is accessible docker exec -it lbp-1120 netstat -an | grep 5353
-
Enable mDNS on your network
- Ensure your router/firewall allows multicast traffic
- Check that devices are on the same subnet
-
Test mDNS discovery
# On Linux/macOS avahi-browse -a -t # Or dns-sd -B _ipp._tcp
-
Check CUPS error log
docker exec -it lbp-1120 tail -f /var/log/cups/error_log -
Clear print queue
docker exec -it lbp-1120 cancel -a -x -
Restart CUPS service
docker exec -it lbp-1120 /etc/init.d/cups restart -
Verify printer PPD file
docker exec -it lbp-1120 lpstat -p CanonLBP-1120 -l
-
Check Docker logs
docker logs lbp-1120
-
Verify D-Bus is available
ls -la /var/run/dbus/
-
Remove and rebuild container
docker rm -f lbp-1120 docker rmi lbp-1120-cups docker build -t lbp-1120-cups . docker run -d -p 631:631 -p 5353:5353 -v /var/run/dbus:/var/run/dbus --name lbp-1120 lbp-1120-cups
-
Find USB device
lsusb | grep -i canon ls -la /dev/usb/ -
Check device permissions
sudo chmod 666 /dev/usb/lp0
-
Verify device mapping
docker exec -it lbp-1120 ls -la /dev/usb/
| Error | Solution |
|---|---|
Unable to connect to printer |
Check printer IP address and network connectivity |
cupsd: Child exited with status 1 |
Review /var/log/cups/error_log for details |
Avahi daemon failed to start |
Ensure D-Bus volume is mounted correctly |
lpstat: Bad file descriptor |
Restart CUPS service inside container |
Print job held |
Check printer is ready and has paper/toner |
Built on olbat/cupsd which provides a minimal CUPS installation.
cndrvcups-capt_2.71-1_amd64.deb- Canon CAPT drivercndrvcups-common_3.21-1_amd64.deb- Common Canon utilities
- CUPS daemon: Handles print job processing and IPP protocol
- Avahi daemon: Manages network service discovery (mDNS/Bonjour)
- Automatic printer setup: Configures Canon LBP-1120 on first run
- Canon CAPT driver: Proprietary driver for Canon Advanced Printing Technology
.
├── Dockerfile # Container build instructions
├── start.sh # Startup script for services
├── cndrvcups-capt_2.71-1_amd64.deb # Canon CAPT driver package
├── cndrvcups-common_3.21-1_amd64.deb # Canon common utilities
└── README.md # This file
While this container is optimized for the LBP-1120, the CAPT drivers support multiple models:
- LBP-1120
- LBP-810
- LBP-1210
- LBP-2900
- LBP-3000
- And other CAPT-compatible models
To use a different model, modify the PPD file path in start.sh:
lpinfo -m | grep -i canon # List available PPD filesCUPS (Common Unix Printing System) is a modular printing system for Unix-like operating systems that allows a computer to act as a print server.
Key features:
- Accepts print jobs from client computers via IPP (Internet Printing Protocol)
- Processes print jobs and converts them to printer-specific formats
- Manages print queues and scheduling
- Provides web-based administration interface
- Supports multiple printer drivers and backends
Why use CUPS in Docker?
- Centralized print server for multiple devices
- Isolate printer drivers from host system
- Easy deployment and configuration
- Consistent environment across different hosts
Avahi is a system that facilitates service discovery on local networks via the mDNS/DNS-SD protocol suite (also known as Bonjour on macOS).
Key features:
- Automatic network printer discovery
- Zero-configuration networking
- Compatible with AirPrint and Bonjour
- No manual IP address configuration needed on client devices
In this container:
- Publishes the CUPS server on the local network
- Allows devices to discover the printer automatically
- Enables seamless printing from mobile devices and computers
- Open System Preferences > Printers & Scanners
- Click the + button to add a printer
- The Canon LBP-1120 should appear automatically via Bonjour
- Select it and click Add
- Download and install Bonjour Print Services from Apple
- Open Control Panel > Devices and Printers
- Click Add a printer
- Select the discovered Canon LBP-1120
- Install drivers when prompted
# Install CUPS client
sudo apt install cups-client
# Add printer via IPP
lpadmin -p CanonLBP-1120 -E -v ipp://localhost:631/printers/CanonLBP-1120
# Set as default
lpadmin -d CanonLBP-1120
# Print test page
lp -d CanonLBP-1120 /usr/share/cups/data/testprint- Ensure device is on the same network
- Open any app with print functionality
- Tap Share > Print
- Select the Canon LBP-1120 (should appear automatically)
- The CUPS web interface is accessible without authentication by default
- For production use, consider:
- Enabling authentication in
/etc/cups/cupsd.conf - Using reverse proxy with SSL/TLS
- Restricting network access with firewall rules
- Running container in isolated network
- Enabling authentication in
Example: Enable authentication
# Inside container
cupsctl --remote-admin --remote-any --share-printersContributions are welcome! Please feel free to submit issues or pull requests.
- Add SSL/TLS support for CUPS web interface
- Support for environment variables for configuration
- Multi-architecture builds (ARM support)
- Healthcheck endpoint
- Support for additional Canon printer models
This project uses Canon proprietary drivers. Please ensure compliance with Canon's licensing terms.
- Based on olbat/cupsd Docker image
- Canon CAPT drivers from Canon official repositories
For issues and questions:
- Check the Troubleshooting section
- Review container logs:
docker logs lbp-1120 - Open an issue on GitHub (if applicable)
Last Updated: 2025-10-10 Version: 1.0