How to Setup Samba Print Server on CentOS

Samba is a free software re-implementation of the SMB/CIFS networking protocol, provides file and print services for various Windows and Linux clients and can integrate with a Windows Server domain.

In this tutorial, we learn how to setup a samba printer server on CentOS Linux.


 A computer with CentOS installed on it.
 Internet Connection.
 Computer with any version of windows installed on it.

Install Samba

The below commands by the order will install the service, run it and make it run in the startup

$ sudo yum install samba
sudo service smb start
sudo chkconfig smb on

Check that cups service is running (CUPS is currently the most widely used spool system in Unix/Linux environments) as below.

$ sudo service cups status

It should print as below:

cupsd (pid 1926) is running...

Configure Printer Server using samba

Smb.conf is the configuration file for the samba program. Now open '/etc/samba/smb.conf' any text editor and change the printers section to match below:

comment = Printer Drivers
path = /var/lib/samba/drivers
browseable = yes
guest ok = yes
read only = no

Two main config consider changing in smb.conf file is "guest ok" set to yes and "browseable" set to yes.

Now restart the samba service

$ sudo service smb restart

The /var/lib/samba/printers' hold all the printer drivers. So you have to copy all driver files to '/var/lib/samba/printers' directory.

Access the printer from windows machine

On window client start the 'run' command and access print server either using ip address or its DNS name.

share access

Right-click on the printer you want to install and choose connect. You will be prompted to install the driver, select the proper driver in the extracted folder and click install. Congrats, you can now print.

2 Comments... add one

  1. To help me understand this, the samba share has the printer drivers required for the windows client to configure the printer correct?

    The samba server does not actually host the printer?


Leave a Comment