A small container with an updated CUP server including a brother driver installation as optional.
692
šØļø A flexible, self-hosted CUPS print server with optional printer driver support for containerized printing solutions.
docker run -d \
--name cups-server \
-p 631:631 \
--device /dev/bus/usb:/dev/bus/usb \
--privileged \
-e CUPSADMIN=admin \
-e CUPSPASSWORD=yourpassword \
dipi/cups-server:latest
Access CUPS web interface at http://localhost:631
version: '3.8'
services:
cups:
image: dipi/cups-server:latest
ports:
- "631:631"
devices:
- /dev/bus/usb:/dev/bus/usb
privileged: true
environment:
- CUPSADMIN=admin
- CUPSPASSWORD=changeme
volumes:
- cups_data:/etc/cups
volumes:
cups_data:
| Tag | Description | Size |
|---|---|---|
latest | Base CUPS server (no specific drivers) | ~300MB |
brother | Pre-installed Brother printer drivers | ~350MB |
| Variable | Default | Description |
|---|---|---|
CUPSADMIN | admin | Admin username for CUPS web interface |
CUPSPASSWORD | admin | Admin password (change in production!) |
INSTALL_BROTHER_DRIVER | false | Install Brother driver at runtime |
BROTHER_PRINTER_MODEL | HL-1210W | Brother printer model to install |
TZ | UTC | Container timezone |
SKIP_USB_CHECK | false | Skip USB device validation |
docker run -d \
-p 631:631 \
--device /dev/bus/usb:/dev/bus/usb \
--privileged \
dipi/cups-server:brother
docker run -d \
-p 631:631 \
--device /dev/bus/usb:/dev/bus/usb \
--privileged \
-e INSTALL_BROTHER_DRIVER=true \
-e BROTHER_PRINTER_MODEL=HL-1212W \
dipi/cups-server:latest
The installer supports most Brother printer models. Common models include:
Check Brother's Linux support pageā for your specific model.
For USB printers to work, you need to configure udev rules on the host machine.
# Create udev rule
cat > /etc/udev/rules.d/99-brother-printer.rules << 'EOF'
# Brother printers - allow CUPS access
SUBSYSTEM=="usb", ATTR{idVendor}=="04f9", MODE="0666", GROUP="lp"
EOF
# Reload udev rules
udevadm control --reload-rules
udevadm trigger
# Reconnect printer
# Allow all USB printers
cat > /etc/udev/rules.d/99-usb-printers.rules << 'EOF'
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
EOF
udevadm control --reload-rules
udevadm trigger
docker run -d \
--name cups-server \
--network host \
-e CUPSADMIN=admin \
-e CUPSPASSWORD=secure123 \
dipi/cups-server:latest
docker run -d \
--name cups-server \
-p 631:631 \
--device /dev/bus/usb:/dev/bus/usb \
--privileged \
-v cups_config:/etc/cups \
-v cups_spool:/var/spool/cups \
dipi/cups-server:latest
docker run -d \
--name cups-server \
-p 631:631 \
-v $(pwd)/cupsd.conf:/etc/cups/cupsd.conf:ro \
dipi/cups-server:latest
# Clone repository
git clone https://github.com/dipievil/cups-print-server.git
cd cups-print-server
# Build base image
docker build -t cups-server:latest --target cups-server .
# Build Brother variant
docker build -t cups-server:brother --target cups-server-brother .
# Test
docker run -d -p 631:631 cups-server:latest
The container includes built-in health checks:
# Check container health
docker inspect --format='{{.State.Health.Status}}' cups-server
# View validation logs
docker logs cups-server | grep "Validation Summary"
Check USB permissions:
ls -la /dev/bus/usb/*/*
# Should show rw-rw-rw- permissions
Verify USB passthrough:
docker exec cups-server lsusb
# Should list your printer
Check CUPS backends:
docker exec cups-server lpinfo -v
# Should show usb:// devices
Check if CUPS is running:
docker exec cups-server pgrep cupsd
Verify port binding:
docker port cups-server
# Should show 631/tcp -> 0.0.0.0:631
Test connection:
curl -I http://localhost:631
# Check logs
docker logs cups-server | grep "Brother"
# Manual installation
docker exec -it cups-server bash
bash /usr/local/bin/install-brother-printer.sh
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSEā file for details.
Content type
Image
Digest
sha256:9c25c034bā¦
Size
71.2 MB
Last updated
11 months ago
docker pull dipievil/cups-print-server