This episode teaches how to share Linux printers to the Windows network: the [printers] section in smb.conf, the CUPS backend, and installing printer drivers from the Windows side. You also verify the whole flow with smbclient -L localhost and do a real test print from the command-line client.

So far we've focused on files. But Samba was designed from the start for two jobs: file and print sharing. In episode 7 we share printers attached to Linux (managed by CUPS) with Windows users — so the "license-priced Windows print server" can be replaced. It's the same concept as file shares: Samba bridges Windows print protocols to the Linux CUPS backend.
Samba has a special [printers] section that automatically publishes all CUPS printers as shares. The Windows printer name will be the same as the CUPS queue name. There's no need for one section per printer — Samba "asks" CUPS which printers are available. This is what makes Samba print servers so easy to manage: add a printer in CUPS, and it immediately shows up in Windows.
Samba needs CUPS as its backend — Samba doesn't talk to printers directly, it forwards jobs to CUPS:
sudo apt install -y cups
sudo systemctl enable --now cupsMake sure there's at least one active printer in CUPS (e.g. via the web admin http://localhost:631 or lpadmin). Without a printer, the [printers] section won't publish anything.
[global]
printing = cups
printcap name = cups
load printers = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
printable = yes
guest ok = no
writable = noBreaking down the important lines:
printing = cups and printcap name = cups: Samba uses CUPS as the print backend.load printers = yes: automatically publish all CUPS printers.printable = yes: mark the section as a print queue — not a regular file share.browseable = no: printer shares appear as printers, not regular folders.writable = no: print queues don't accept write file operations.Create the required spool directory:
sudo mkdir -p /var/spool/samba
sudo chown root:root /var/spool/sambatestparm -s | grep -A8 "\[printers\]"
sudo smbcontrol all reload-configIf printing = cups is misconfigured, Samba fails to read the printer list — testparm will point to the offending line.
On the Windows client, add a network printer:
\\fileserver\<printer_name>.Samba forwards the job to CUPS, and it's CUPS that talks to the printer via the PPD driver. From Windows' perspective, this looks just like a Microsoft print server.
Tip
For the best experience, keep CUPS queue names short and free of spaces — e.g. hp-laserjet-4200, not HP LaserJet 4200 (Kantor). Names with spaces and parentheses often trigger problems when Windows drivers expand them into a UNC path. The same rule applies to file share names: simpler is more reliable.
From the server side, make sure the printers are actually published:
smbclient -L localhost -U armanIn the output you should see CUPS printers below the share list, with the Disk type for file shares and Printer for printers. If printers don't appear, check the smbd logs and CUPS status:
sudo systemctl status cups --no-pager
lpstat -pThe most convincing way: send a job from the Linux command-line client to a Windows-visible printer, then check the status in CUPS:
smbclient //localhost/hp-laserjet-4200 -U arman \
-c "print /etc/hostname; queue"print /etc/hostname sends the file to the queue; queue shows the print queue. If the job is accepted with a waiting/printing status, the Samba→CUPS flow works. From the Windows side, net use LPT1: \\fileserver\hp-laserjet-4200 also maps the printer as LPT1 for legacy applications.
Warning
Samba doesn't distribute drivers — every Windows client must install its own. The "install driver from print server" feature (rpcclient/ntadmin style) isn't a classic Samba focus and is often troublesome. The cleanest practice: distribute drivers via GPO if you use AD, or simply have users install the official vendor driver.
smbclient -L: make sure printing = cups is set and there's an active printer in lpstat -p./var/log/cups/error_log), often a mismatched PPD driver.guest ok = no and legacy Windows: old Windows clients sometimes don't send credentials to print queues — use a valid user.Key takeaways:
[printers] + printing = cups publishes all CUPS queues as printer shares.smbclient -L localhost verifies printer publication; smbclient ... -c "print file; queue" tests a real print.writable = no + printable = yes makes a section a pure print queue.In episode 8 next, we'll cover SMB3: performance & encryption — SMB3 encryption, oplocks, server signing, server min protocol = SMB3, plus tuning strict locking, socket options, and large file transfers. This is the first episode that lifts Samba from "it works" to "fast and secure".