Setting up a Linux Print Server using CUPS

For this tutorial we will be using Debian 7 Wheezy: https://www.debian.org/CD/http-ftp/#stable
CD1 is the only one you need. However, most of this will apply to Raspbian, Ubuntu, ext.


Once you have Debian installed open up a terminal and type in the following:

aptitude update
aptitude install cups cups-client

Now we've got CUPS installed we want to start it by running the following:

/etc/init.d/cups start

Now type in this so we can get out 'inet address':

ifconfig

Once we have our 'inet address' type that into a web browser on another computer on your network with the port 631. For instance:

http://192.168.1.xx:631/

Now we have this webui it's time to plug in our printers:

Go to 'Administration' and then 'Add Printer'

This will ask you to switch over to HTTPS. Enter your username and password.

Choose your printer and click 'Continue':

Enter relavent details for 'Name', 'Description' and 'Location' and then click 'Continue':

Select the correct driver or the one closest to your printers model. Search online if unsure and then click 'Add Printer'

Repeat this printer setup for each printer.


Now at this point your printers will work. But why not make CUPS a more comfortable experience? We're going to make that log useful!

Go to 'Administration' again and then 'Edit Configuration File':

Edit the configuration file as you see fit. My configuration is in this pastebin for anyone interested:

http://paste.ubuntu.com/10802771/

In Raspberry Pi's 'Raspbian' OS you can install CUPS following this command:

sudo apt-get install cups

CUPS uses the group lpadmin to determine who is authorised to administer the printers. You will therefore need to add the lpadmin group to your user to enable you to administer the printers. This can be done by issuing:

sudo usermod -a -G lpadmin pi

Replace "pi" with your own username as appropriate.


Guide made from request by @LinuxMaster9
https://forum.teksyndicate.com/t/multi-platform-print-server/78292/

1 Like

Good guide, only thing to add although ubuntu still has ifconfig, it is dpereciated and replaced by iproute2 so you wont find it on most other distros.

the new command would be

ip a

(a for addr you can use both)

I guess the only question now is when setting up the client machines, what protocol do we use and the address for the server? ipp? http? socket? I assume the Windows machines have the ip address, port, /printers/printer(name of printer)?

For Windows machines you'd copy the link to the printer (right click on printer in web ui and click 'copy link') and paste it in the printer setup. Something like this:

http://print-server:631/printers/Brother_HL-2130_series

As for Linux it should see it automatically, if not you point it to the server:

(In the menu bar go to 'Server' then 'Connect')

1 Like

How do I get this service running?

kungr@desktop:/etc/cups$ /etc/init.d/cups start
* Starting Common Unix Printing System cupsd cupsd: Child exited on signal 15
[fail]
kungr@desktop:/etc/cups$

What's the contents of your /etc/cups/cupsd.conf file?

Also,

sudo /etc/init.d/cups start

That was it. Thanks.

OK new one, what is the default username & Password? Some Tut's on the internets say to create a printeradmin group to address it. Is that the best route?

I did a usermod sudo usermod -aG lpadmin username as noted on the Ubuntu CUPS page here. I am accessing the CUPS admin page via the http://localhost:631/admin

Sorry jumped the gun. Solution here.

1 Like

Thanks for posting both the issue AND the solution in the same post.

Hope it all works out for you.

OK here is one. Say you have an printer unsupported by CUPS. Is there a generic PPD file that can be used?

What printer?

I got my Brother laser printer to work by installing a similar model's driver.

So I have the drivers installed for my printer and got it running on my machine via USB & CUPS. But I try and connect my Wife (Win7) machine and can't get it to recognize.

Did you type in an address somewhat similar to this?

http://print-server:631/printers/Brother_HL-2130_series

Yep, did print-server,localhost (giggles really), and 192.168.1.101, all with :631 and got nothing.

Go to the web interface and right click > copy link on the printer as if you were doing it from another machine on your network (use hostname not localhost).

When you say hostname, I assume it is the ip address.

*eventually i want to clean-up this thread and back delete and consolidate this conversation. Do we continue in a PM conversation?

No this is good troubleshooting information.

Hostname and local IP addresses are basically the same thing don't worry. You know you 'name' your computer when you set it up something like Kungr-PC or Kungr-Desktop, that's your hostname. Your router (should) list them as well as the network IPs.

I went to my router and pulled the IP and Name, used both and failed. Is there an option in CUPS that need sellect to enable network printer sharing?

I read through the product page installation guide and noticed that I might have missed a few steps required to install the drivers.