Visit Jeremy's Blog.
Go Back > Linux Answers > Networking
User Name


By busbarn at 2005-07-02 21:42
Scope and Purpose
As the description states, this tutorial deals with setting up a network printer with just linux computers. There is already plenty of information in the forums if you have a windows box. I don't have a windows box, so when I hit a snag I had a tough time finding an answer. Also, I will NOT be specifically describing how to install print drivers on the local machine--there's already plenty of documentation out there on that too, so why waste your time! I will go through the extreme basics of installing and starting the cups server. So, if you're having trouble connecting your linux box to your linux print server, this article is for you! While I am using Slackware 10.1 and KDE, these instructions should be nearly universal for any linux distro (the exception is starting and stopping the cups daemon).

I have a simple home network set up with two computers and a wireless router. One computer is in my office, while my wife's is in hers. She is connected wirelessly. We both have printers but after a while, paying for two different types of ink cartridges gets to be a hassle. So I decided to turn my box into a print server, so that we could share a printer.

NOTE: From here on out, I will call the CUPS server (the computer that has the printer physically plugged into it) server and the networked computer (the computer in the other room) client.

Step 1: Make sure your printer works locally
Before trying to get a network printer to work, make sure it works locally. While not specific, here's the basics of it (if your printer already works, skip to Step 2):

Download and install cups and any other driver software that you need (for example, gimp-print). If you are using swaret, it's as simple as
root# swaret --install cups
root# swaret --install gimp-print
Once installed, you need to start the cups daemon (this command will be different if you aren't using Slackware):
root#/etc/rc.d/rc.cups start
This will start the cups server. Next, you'll need to add a printer by using the web interface. To do this, open a web browser and type in localhost:631. If your server is started, a page should load with links to various tasks. Click the first link Do Administration Tasks. A dialog will pop up asking for username and password. You need to log in as root and use your root password to access the administration menu.
Once logged in, click add printers and follow the prompts to set up your printer. When the printer is added, click on the "Configure Printer" to set page size and printing quality. Finally, click "Print Test Page". If a test page prints, you're almost ready to go on to Step 2.

You'll want to double check your network setup. It will be easier on everyone involved if your printer server has a static ip instead of dhcp. This can be done using Slackware's netconfig tool (be sure to restart inet1 to put your changes into effect--this is done by typing: /etc/rc.d/rc.inet1 restart). You may also have to adjust your router for a static ip. A quick not regarding static ip's:when you enter the gateway, enter the ip address of your router, or you won't be able to see the wonderfully wide web of the world!

Once your printer is setup and your ip is static, go on to Step 2.

Step 2: Editing cupsd.conf
WARNING: When editing conf files, always make a backup before making changes. That way, when it gets messed up, you have an easy fix! This is done very simply:
root# cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup
Once your backup is created, open the cupsd.conf file using your favorite text editor (vi, nano, emacs, etc.):
root# nano /etc/cups/cupsd.conf
You will me making only small modifications to this file. First and foremost, look for the line that looks something like this:

If it isn't there, add it!
Note the #. Delete this to uncomment the line. You may either put in your hostname or the static ip address you assigned earlier. The line should look like this:
Note: For simplicity sake, I personally chose ip address (if you couldn't already tell!). That way if I modify my hostname or anything, the ip can stay the same.

The second adjustment you will make is to the line that looks like this(once again if it isn't there, add it):
#BrowseAddress x.y.z.255
#BrowseAddress x.y.255.255
#BrowseAddress x.255.255.255
#BrowseAddress @LOCAL
#BrowseAddress @IF(name)
You can uncomment one of these lines or just add your own. It needs to look like this:
This should your broadcast for your entire network. Adjust the 255 to whatever your netmask is.

Finally look for this section of the cupsd.conf file:
<Location />
Order Deny,Allow
Deny From All
Allow From
Create a new line after Allow From and add the ip addresses or ranges for your network. The <Location /> section should look like this when you are done(the new line is in red):
<Location />
Order Deny,Allow
Deny From All
Allow From
Allow From 192.168.1.*
You should adjust this line according to your network address setup. For example, my network has static ips so I just added the ip address for the client, or networked computer. In networks with many more clients, this is a hassle, so doing the above is more friendly. Save the file and restart the cups server.
root#/etc/rc.d/rc/cups restart
If the server restarts, you are ready to go on to Step 3. If you get an error, make sure that you typed in all of your ip addresses correctly. I ran into trouble when I updated the listen section. It only borked it up, so unless you know what you're doing, only make the changes mentioned above.

Step 3: Setting Up the Client
Your server is ready to roll, so now it's time to set up your client machine. In order for your client to communicate with the server, the client needs to be running the cups daemon. Install cups and any other driver libraries that you needed on the server. In the above example, it was cups and gimp-print. Start cups:
root#/etc/rc.d.rc.cups start
You need to have cups running to access the network printer. You don't need to do anything with the cupsd.conf though, so once the daemon is started, move on to Step 4.

Step 4: Introducing Your Client to Your Server
Many tutorials state that you can just add a printer using the KDE control center. I tried it, and I kept getting an error that said "You don't have access." So try to add a printer and if it works, fantastic. If it doesn't or if you don't use kde, read on.

On the client, open up your web browser and access localhost:631. Login in using root and root's password. Click on manage printers. If your network printer shows up, you are done and ready to go. If it doesn't, keep going!

Click on administration and add printer (de ja vu?).
1. Fill in the name of the printer.
2. Under location, I type in the ip address of the server.
3. You can fill in a description, but you don't have to.
4. Click continue.

The next page comes up called Device with a drop down list. Select Internet Printing Protocol (ipp) and click continue.

Now you need to tell cups the network location of your print server. To do this, you will need the server's ip address, and the name of your printer as cups sees it. (For example, if you go back to the server and access the web interface, click on printers. The name is big and bold.)This is the format: ipp://server_ip_address/printer/printer_name

Change the ip address and printer name accordingly. Your entry should look like:
Click continue.

Choose the correct printer, click continue, choose the correct driver, and click continue again. Be sure to configure the printer so that the driver knows what size paper and print quality to use. Finally, click print test page.

For some odd reason, once I added a printer on the client, cups could then see my network printer. Now in the cups configuration screen, it shows two printers: the one I added manually and the one is sees on the server. However, in kde and, it only shows one printer. Bizarre, but it works.

That's it, your finished. Congratulations and enjoy the network printer!

by dom3lmr on Tue, 2005-07-19 19:01
Yep, that looks very cool: a nice succinct howto I am bound to say! But then there are the obscure hiddens and gotchas like: what do you put in the printer URI if you are using a multi-function printer e.g.: HP Officejet R45 that uses hpoj?

Also you refer to the ipp printer path as ipp://server_ip_address/printer/printer_name which unfortunately is not necessarily always the case. Is that printer singular or printers plural and does that have to match the <Location /Printers>tag in the cupsd.conf file?

I am afraid that I am defeated by it all!

Unable to connect to IPP host

by busbarn on Wed, 2005-07-20 09:22
Good question! Since I don't have a multi-function printer to test, I can offer a big I don't know. My apologies.

However, I do know that the "printer" is singular and the printer_name needs to match the cupsd.conf file on the server machine. I got most of my info from this CUPS System Amdministrator's Guide. That may give you some more info for a muliuse printer.

by username17 on Mon, 2005-07-25 14:51
Good info... but

After installing CUPS, /etc/rc.d/rc.cups is not executable by default.
One needs to "chmod +x /etc/rc.d/rc.cups" then execute it.

Once it is changed to executable, it will start at boot.
If it is not chmodded, you cannot run "/etc/rc.d/rc.cups start" like the tutorial says.
Just a FYI.

by wylie1001 on Sun, 2005-09-04 09:05
Hello all,
This is good info as in most of LQ. I have a printer it is an HP photosmart 2710 with a network connection sitting on my network with an ip of . I have spent numerous hours trying to get it to work. This printer is not connected to any computer on my network. I have cups installed nothing special there. I also removed LPRNG this program conflicts with cups. In cups set up your printer and set it to Device URI: socket:// the ip of the printer also set it for the default printer and mine worked like a champ. After doing hours of reading and hunting I could not find info for stand alone printers on a network. I also used the web browser to set up the printer on cups using use your root account and password and configure the printer. Also start up /etc/rc.d/rc.cups . I wanted to share this because printers have been a real sore spot for me for the past years using Linux.

by ylikone on Wed, 2005-09-07 10:53
I have been running an HP Photosmart 8450 as a stand-alone networked printer... and having no problems printing to it with both my windows and Linux computers.

As a "for example", here are the approximate steps I took to make it work...


Go to

and download / install the latest hpijs and hplip.

Use the command "hp-makeuri" to get a Device URI. Make sure to specify the IP address of the printer you want to setup.

Go to

and download / install the latest cups, if your distro does not already have it setup. Next, go to

and download the appropriate .ppd file for your printer and copy it to /usr/share/cups/model.

Load up a web browser as root and go to

You should now see the cups web interface. Go to add a new printer... when you get to the Device URI field, enter the string given previously by the "hp-makeuri" command, which should look something like


Print a test page and see if it works.

by mitchell1000 on Mon, 2006-09-04 12:10
Very nice article on cups setup.

One error

the ip address of the printer is


notice that you need the :631 port number
as well as
printers not "printer"

with this correction, the "how to" above for cups works!


by tagore on Wed, 2006-09-13 06:56
This howto is great, thanks.

A usefull extension in a LAN-Enviroment could be to mail pdf-output to the user. (mutt can send multipart-mail in batchmode.)

if [ "$2" != "" ]; then
mutt -n -a $OUTPUTFILENAME -s "pdf distilled by cups" $2 < /dev/null

by halw on Sat, 2006-12-02 11:39
This procedure does not work for me. When attempting to 'add printer' using localhost:631 am asked to enter User Name and Password for CUPS. Have tried Administrator(root) and password for host and user id & password for client.

Client system is Kubuntu 6.06.

by pietie on Tue, 2006-12-19 03:58
Originally Posted by halw
This procedure does not work for me. When attempting to 'add printer' using localhost:631 am asked to enter User Name and Password for CUPS. Have tried Administrator(root) and password for host and user id & password for client.

Client system is Kubuntu 6.06.
neither for me well the root + root passwd... I am running SuSE 10.1

by busbarn on Wed, 2007-01-17 20:20
I know that Ubuntu uses users differently. It may work if you use the sudo command. Just a thought.


All times are GMT -5. The time now is 09:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration