Run Dockerised Printer server to share USB printers over the network.
Built to be used with Raspberry Pi's.
Tested and confirmed to be working on:
- Raspberry Pi 5 (
arm64/AArch64)
- Clone this repository:
git clone https://github.com/CXDezign/docker-cups.git- Build the Docker image:
docker build -t docker-cups .- Create a
docker-compose.ymlfile with the following content, adjusting parameters as needed:
services:
cups:
container_name: cups
image: docker-cups
restart: unless-stopped
ports:
- 631:631
volumes:
- /etc/cups:/etc/cups
devices:
- /dev/bus/usb:/dev/bus/usb
environment:
- USERNAME="username"
- PASSWORD="password"
- TIMEZONE="Europe/Warsaw"- Use Docker Compose to run the Docker image in a container.
docker-compose up -dConfigure the docker-compose.yml file accordingly.
| Parameter | Default | Description |
|---|---|---|
container_name |
cups |
Preferred Docker container name. |
ports |
631 |
CUPS network port. |
volumes |
/etc/cups |
Persistent Docker volume for configuration files (Persistence, migration, or backup purposes). |
devices |
/dev/bus/usb:/dev/bus/usb |
Add host device (USB printer) to container. Default passes the whole USB bus in case the USB port on your device to a fixed USB port if it will remain unchanged, example: /dev/bus/usb/001/005. |
USERNAME |
username |
Environment username. |
PASSWORD |
password |
Environment password. |
TIMEZONE |
Europe/Warsaw |
Environment timezone. Use your preferred TZ identifier. |
CUPS web app is accessible on the defined port of the host machine.
http://<DOCKER_HOST_IP>:631