Sharing a printer can be tricky due to complex setups or software compatibility issues. However, with an old computer, you can repurpose it as a Linux print server, simplifying network printer sharing into a cost-effective solution.
I custom-ordered an old PC back in 2015, which served me as a Windows desktop for productivity and light gaming. Since 2020, I’ve transitioned to Macs, and the PC became a headless Plex/print server. While administering it using remote desktop made this doable, it seemed like I was always running into weird network permissions quirks and frequent updates requiring reboots.
Tired of all this and just the sheer bloated nature of Windows, I set out to repurpose this old PC into a steady, reliable file server, that I could also use not just for Plex and sharing files, but also to print to it, from any computer or device, regardless of platform.
CUPS (Common UNIX Printing System) is the standard printing system for Unix-like operating systems, allowing a computer to act as a print server that processes print jobs for various printers. CUPS supports a wide range of printer models and is compatible with Internet Printing Protocol (IPP), enabling functionality across Windows, macOS, Android, and iOS.
After you've installed a Linux distribution, install CUPS by following the steps for your distribution, then start and enable it, and add your user to the lpadmin group, for example: sudo usermod -aG lpadmin matt.
Members of the lpadmin group have permission to manage printers and print jobs, which includes adding and configuring printers through the CUPS web interface.
Once you install CUPS, you need to configure it to, among other things, enable printer sharing and the CUPS web interface. Back up the existing default configuration.
sudo mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bakThen, start a new configuration file.
sudo vim /etc/cups/cupsd.confNext, add or modify the following lines to the configuration file.
# Basic server settingsRestart CUPS to apply the changes.
sudo systemctl restart cupsFinally, confirm CUPS is up and running properly.
sudo systemctl status cupsNext, we need to configure Samba to act as a sort of intermediary between the CUPS server and client devices. Edit your smb.conf file:
sudo vim /etc/samba/smb.confAdd the following lines to the [global] section.
load printers = yesAdd the following [printers] section and the printer drivers [print$] section.
[printers]Your smb.conf will somewhat resemble the following:
[global]You can enter the testparm command to test your configuration.
If everything passes, restart Samba:
sudo systemctl restart smbd nmbdFinally, confirm Samba is up and running properly
sudo systemctl status smbd nmbdWe're almost done! It's time to log into your new CUPS server, then add and share your printer.
Point your web browser at your server IP or hostname, such as 192.168.1.100:631 or hostname:631. Using the CUPS configuration you added earlier, you should be prompted to enter your credentials to access the web interface.
Select the "Administration" tab in the top row,
Select "Add Printer," then the server should already recognize your hardware and have it listed as a local printer. You can change your printer's details, but don't forget to select the "Share This Printer" option before proceeding to the driver selection screen. Select your printer manufacturer, the appropriate driver for your printer model, then select "Add Printer."
CUPS uses PostScript Printer Description (PPD) files, which describe the capabilities and features of your specific printer model, but we'll just call them drivers.
If you don't find your printer represented, you can try the Generic (Generic PostScript) driver. If you look around, you will probably find a PPD file on your printer manufacturer's website, then you can use the "Provide a PPD File" option to upload it to the CUPS server from your computer.
That said, in the case of Brother printers, you might not get optimal results with Brother's own drivers. I've found the brlaser drivers yield far better results than Brother's own drivers. The brlaser drivers can be easily added to your system with the printer-driver-brlaser package, for example: sudo apt install printer-driver-brlaser.
Getting this right the first time can be tricky, and you won't know if it's right until you submit your first print job. If your print output is mangled or gibberish, then you can modify your printer in the web interface and try a different driver.
At this point, your CUPS printer should be accessible to network clients, it's time to connect your network devices to your shared printer.
Open the Settings, and select Bluetooth & Devices > Printers & Scanners. To add the printer, select "Add Device," and wait for Windows to scan to find it, then "Add Device."
Open System Settings, then select "Add Printer, Scanner, or Fax." On the Add Printer screen, select your printer, then select "Add."
Android does things a bit differently in that you probably need to install a print service that corresponds to your printer manufacturer. Open the Settings, then More Connectivity Options > Printing > Add Service. This will open the Play Store and allow you to choose a print service for your printer manufacturer (the Brother print service didn't work for me, but the Mopria print service works flawlessly).
Once the print service found the shared printer, I just selected it and then "Print Test Page" to make sure it was working correctly.
On iPhone and other iOS devices, it is very simple to print with little to no setup. Simply tap the share icon in whatever app you're using, then select "Print" from the menu. You should see your printer, but if not, just select the "Printer" field, your printer, then Print.
Congratulations! You’ve successfully turned your old PC into a reliable Linux print server, making printer sharing across different platforms easy and seamless. This setup is streamlined, efficient, and saves time, allowing you to print from any device with ease. Enjoy the simplicity and control you’ve gained over your printing environment!
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.
Comments