Skip to content

Commit cec1145

Browse files
committed
Add cups app (LinuxServer CUPS with full filter stack)
Mounts ./ppds into /usr/share/cups/model/custom so custom PPDs appear as available drivers without any restart. State persisted under ../../lib/cups. Exposes cups-net for other containers to join and print via IPP. Made-with: Cursor
1 parent 96ff235 commit cec1145

5 files changed

Lines changed: 121 additions & 0 deletions

File tree

apps/cups/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# UID/GID the CUPS process runs as inside the container.
2+
# Match the host user that owns ../../lib/cups if you care about file permissions.
3+
PUID=1000
4+
PGID=1000
5+
6+
TZ=America/Los_Angeles
7+
8+
#IMAGE_VERSION=latest

apps/cups/.rsync-exclude

Whitespace-only changes.

apps/cups/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# cups
2+
3+
Containerised CUPS print server using the
4+
[LinuxServer CUPS image](https://docs.linuxserver.io/images/docker-cups/),
5+
which ships with a comprehensive set of print filters and supporting programs:
6+
7+
| Package | Purpose |
8+
|---|---|
9+
| `cups` | Core print server and IPP listener |
10+
| `cups-filters` | PDF, PostScript, raster, and text filter chain |
11+
| `ghostscript` | PS/PDF rendering |
12+
| `poppler-utils` | PDF inspection and conversion |
13+
| `qpdf` | PDF linearisation and repair |
14+
| `imagemagick` | Image format conversion (PNG, JPEG, TIFF, …) |
15+
| `foomatic-db` + `foomatic-db-engine` | Generic printer driver database |
16+
| `printer-driver-gutenprint` | High-quality open-source raster drivers |
17+
| `hplip` | HP printer drivers |
18+
| `libcupsimage2t64` | CUPS raster image library |
19+
20+
## Networks
21+
22+
| Network alias | Actual network | Purpose |
23+
|---|---|---|
24+
| `cups` | `cups-net` | Other containers join this to submit print jobs |
25+
| `proxy` | `nginx-proxy-net` | Reverse proxy access to the CUPS web UI |
26+
27+
## Volumes
28+
29+
| Mount | Purpose |
30+
|---|---|
31+
| `../../lib/cups``/config` | All CUPS state: config, spool, logs, per-queue PPDs |
32+
| `./ppds``/usr/share/cups/model/custom` (read-only) | Custom PPD files; any PPD placed here appears as an available driver in the CUPS add-printer wizard |
33+
34+
## Adding custom PPDs
35+
36+
Drop `.ppd` files into the `ppds/` directory next to this file. They are
37+
mounted read-only into CUPS's model directory and appear automatically under
38+
**Administration → Add Printer → Choose Driver** the next time you open the
39+
wizard (no restart required).
40+
41+
Example — adding the Rongta RP326 driver:
42+
43+
```sh
44+
cp /path/to/Printer80.ppd apps/cups/ppds/
45+
```
46+
47+
## First-time setup
48+
49+
```sh
50+
cp .env.example .env
51+
# Edit .env if you need non-default PUID/PGID or TZ
52+
docker compose up -d
53+
```
54+
55+
The CUPS web UI is available at `http://cups:631` from other containers on
56+
`cups-net`, or via nginx-proxy-manager if you set up a proxy host pointing
57+
to `cups:631`.
58+
59+
To allow other containers to print without credentials, open the CUPS web UI
60+
and under **Administration → Server** enable:
61+
62+
- Allow printing from the Internet
63+
- Allow remote administration
64+
65+
## Adding a printer from another container
66+
67+
Any container that needs to print should join `cups-net`:
68+
69+
```yaml
70+
networks:
71+
cups:
72+
external: true
73+
name: cups-net
74+
```
75+
76+
Then configure the app's printer URL as `ipp://cups:631/printers/<queue-name>`.
77+
78+
## Stopping safely
79+
80+
```sh
81+
docker compose down
82+
```

apps/cups/docker-compose.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
services:
2+
cups:
3+
image: lscr.io/linuxserver/cups:${IMAGE_VERSION:-latest}
4+
container_name: cups
5+
hostname: cups
6+
restart: unless-stopped
7+
environment:
8+
PUID: ${PUID:-1000}
9+
PGID: ${PGID:-1000}
10+
TZ: ${TZ:-America/Los_Angeles}
11+
volumes:
12+
- ../../lib/cups:/config
13+
- ./ppds:/usr/share/cups/model/custom:ro
14+
# ports:
15+
# - 631:631
16+
networks:
17+
- cups
18+
- proxy
19+
healthcheck:
20+
test: ["CMD-SHELL", "curl -fSs http://localhost:631/ || exit 1"]
21+
interval: 30s
22+
timeout: 10s
23+
retries: 3
24+
start_period: 15s
25+
26+
networks:
27+
cups:
28+
name: cups-net
29+
proxy:
30+
external: true
31+
name: nginx-proxy-net

apps/cups/ppds/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)