A Docker image for CUPS (Common Unix Printing System) print server, providing a complete printing solution in a containerized environment. Includes Kubernetes deployment automation for easy container orchestration.
- Based on Debian 12 Bookworm Slim for minimal footprint
- Includes minimal CUPS installation with printer drivers (No GUI, No Fax, No Scan, No Docs)
- Pre-configured with admin user and remote administration access
- Supports both USB and network printers
- Includes latest HPLIP v3.26.4 for HP printer support (https://github.com/arembez/hplip)
- Persistent configuration through volume mounting
- Kubernetes deployment with automated installation
docker pull arembez/cups:latest
docker run -d \
--name cups-server \
--privileged \
-p 631:631 \
-v ./config:/etc/cups \
arembez/cups:latest
Open your browser and navigate to:
https://localhost/admin:631
Default Credentials:
- Username:
admin - Password:
admin
| Variable | Description | Default |
|---|---|---|
ADMIN_PASSWORD |
Admin user password | admin |
NAMESPACE |
Kubernetes namespace | cups |
APP_NAME |
Application name | cups |
| Path | Description |
|---|---|
/etc/cups |
CUPS configuration directory (persistent) |
| Port | Protocol | Description |
|---|---|---|
| 631 | TCP | CUPS web interface and print service |
# Run with custom admin password
docker run -d \
--name cups-server \
--privileged \
-p 631:631 \
-e ADMIN_PASSWORD=mysecretpassword \
-v cups-config:/etc/cups \
arembez/cups:latest
# Run with custom configuration volume
docker run -d \
--name cups-server \
--privileged \
-p 631:631 \
-v /path/to/cups-config:/etc/cups \
arembez/cups:latest
- Access the CUPS web interface at
https://localhost/admin:631 - Navigate to "Administration" tab
- Click "Add Printer"
- Follow the wizard to configure your printer
Create a docker-compose.yml:
services:
cups:
build: .
container_name: cups-server
privileged: true
ports:
- "631:631"
environment:
- ADMIN_PASSWORD=admin
volumes:
- cups-config:/etc/cups
restart: unless-stopped
volumes:
cups-config:
Then run:
docker compose up -d
This project includes automated Kubernetes deployment with a comprehensive Makefile. The deployment creates:
- Namespace (configurable via
NAMESPACE) - Persistent Volume Claim for CUPS configuration
- Service with LoadBalancer for external access
- Deployment with CUPS container
- Secret for admin credentials
- Kubernetes cluster (v1.19+)
kubectlconfigured with cluster access- Default StorageClass for PVC
- LoadBalancer support (or use port-forwarding)
Run on a host with kubectl installed:
# Clone the repository
git clone https://github.com/arembez/cups.git
cd k8s
# Deploy with default settings
make install
# OR Deploy with custom namespace and app name
# make install NAMESPACE=printing APP_NAME=cups-server
The installation process will:
- Check Kubernetes prerequisites
- Create the namespace
- Generate or prompt for admin password
- Apply all manifests
- Wait for deployment readiness
- Copy custom CUPS configuration (if available)
- Display access information
| Command | Description |
|---|---|
make install |
Full installation with prerequisites check |
make update |
Update/Re-deploy all manifests |
make clean |
Remove everything (requires confirmation) |
make logs |
Show CUPS logs |
make shell |
Open shell in CUPS pod |
make status |
Show deployment status |
You can customize the deployment by setting some variables or create a .env file:
NAMESPACE=printing
APP_NAME=cups-server
ADMIN_PASSWORD=mysecurepassword
After deployment, you can access the CUPS web interface:
If LoadBalancer is available:
http://<loadbalancer-ip>:631
If LoadBalancer is not available:
# Port-forward to access locally
kubectl port-forward -n cups svc/cups 631:631
# Then access at http://localhost:631
To apply custom CUPS configuration during deployment:
- Create a
cupsd.conffile in the same directory as the Makefile - The installation process will automatically copy it to the pod
- CUPS will be reloaded to apply the configuration
The image includes the following driver packages:
foomatic-db-compressed-ppds- Foomatic printer driversprinter-driver-all- All printer driversopenprinting-ppds- OpenPrinting PPD fileshplip- HP printer drivers
- Default admin password should be changed in production
- Consider using HTTPS for remote access
- Restrict network access to trusted hosts when possible
# Docker
docker exec -it cups-server bash -c passwd admin
# Kubernetes
kubectl exec -it -n cups deployment/cups -- bash -c passwd admin
This image is distributed under the MIT license.
Issues and pull requests are welcome!
For issues with this Docker image, please open an issue on GitHub.
For CUPS-related issues, refer to the CUPS documentation.