Install online CUPS printer in Raspberry Pi | Installing CUPS-PDF printer

If we have a usb printer and a Raspberry Pi system, we can easily setup a network printer. In order to make it active, we have to install the CUPS (formerly an acronym for Common Unix Printing System, but now with no official expansion). CUPS is a modular printing system for Unix-like computer operating systems which allows a computer to act as a print server.

Just go through the following steps to install CUPS on Raspberry Pi and enabling remote access.

  1. Install CUPS
    sudo apt-get install cups
  2. Once the base installation is complete, we need to make a few small administrative changes. Execute this command in terminal.
    sudo usermod -a -G lpadmin pi
  3. Now open /etc/cups/cupsd.conf
    sudo nano /etc/cups/cupsd.conf
  4. Inside the file, look for this section:
    # Only listen for connections from the local machine
    Listen localhost:631
  5. Comment out the “Listen localhost:631″ line and replace it with the following:
    # Only listen for connections from the local machine
    # Listen localhost:631
    Port 631
  6. Scroll further down in the config file until you see the “location” sections. In the block below, I’ve bolded the lines you need to add to the config:
    # Restrict access to the server...
    <Location />
    Order allow,deny
    Allow @local
    </Location>
    # Restrict access to the admin pages...
    <Location /admin>
    Order allow,deny
    Allow @local
    </Location>
    # Restrict access to configuration files...
    <Location /admin/conf>
    AuthType Default
    Require user @SYSTEM
    Order allow,deny
    Allow @local
    </Location>
  7. Anytime you make changes to the CUPS configuration file, you’ll need to restart the CUPS server. Do so with the following command:
    sudo service cups restart

Now we can access the cups page ip_address_of_pi:631 and add printers remotely.

As a test printer, I am installing a CUPS-PDF printer with the following steps.

  1. Install CUPS-PDF printer
    sudo apt-get install cups-pdf
  2. Make PDF folder inside home/pi/ to save the pdf files created
    mkdir ~/PDF
  3. Now check whether this printer is installed or not by opening the cups page remotely, ie. ip_address_of_pi:631/printers. If it shows as in the image given below, everything is ok.
    cups

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s