Creating a print server with a Raspberry Pi

7/14/14, 2:51:17 PM

A own the Raspberry Pi for a while now and played around with it. The latest project was to setup my own cloud solution using a Seafile out of the box image. As this is also based on the Rasbian OS (a Debain derivate) you could also create other services on this machne.

We have a USB printer running on our media PC. The bad thing is that we always had to turn on the PC when we want to use the printer attached. The printer doesn't have a network interface. I once tried a out-of-the-box printer server for the local network but they all sucked. With the Raspberry Pi you can easily create your own.

There are only a few steps to accomplish this, just follow the instructions. Just log in to your Pi as root and perform the upcoming steps:

The first step should be to keep your Pi up to date by issueing the follwing commands:

apt-get update && apt-get upgrade

Your Pi is now updated and ready to perform the installation of all needed packages:

apt-get install cups cups-pdf cups-driver-gutenprint
apt-get install avahi-daemon python-cups
apt-get install samba


This installs the cups and samba server. The first one is the printer service itself, samba is used to share any resource that is connected to the Pi, e.g. your USB printer.

To share the printer open the /etc/samba/smb.conf file e.g. with nano. Search for the [printers] section and add the last line displayed here:

[printers]
 comment = All Printers
 browseable = yes
 path = /var/spool/samba
 printable = yes
 guest ok = yes
 read only = yes
 create mask = 0700
 use client driver = yes # <--


Then open the configuration file of the cups server /etc/cups/cupsd.conf

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow from @LOCAL # <--
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow from @LOCAL # <--
</Location>


Please add the marked lines to both sections.

On the command line type

cupsctl –-remote-admin

to activate the web interface of the cups server to configure your printer.

After restarting the cups server with

service cups restart

you should be able to access the web interface of cups with the URL

http://yourRasberryPi.address:631

to add a printer and share it across your network.






Leave a comment right here