How to Share Printers over a Network in Ubuntu
Sharing printers over a network in Ubuntu can be a convenient way to allow multiple users to access a single printer. This process leverages the Common Unix Printing System (CUPS) to manage and share printers effectively. Follow these step-by-step instructions to set up printer sharing in Ubuntu.
Step 1: Install CUPS
First, ensure that CUPS is installed on your Ubuntu system. This can be done through the terminal:
Open the terminal. Update the package list and install CUPS:$ sudo apt update $ sudo apt install cups
Step 2: Add Your User to the lpadmin Group
To manage printers, your user needs to be in the lpadmin group:
Run the following command:$ sudo usermod -aG lpadmin [YOUR_USERNAME]
After executing this command, log out and log back in for the changes to take effect.
Step 3: Enable Printer Sharing in CUPS
Open a web browser and navigate to the CUPS web interface by going to http://localhost:631.
Select the Administration tab. Under the Server Settings section, check the box for Share printers connected to this system. Click Change Settings to save your changes.Step 4: Add a Printer
Still in the CUPS web interface, click on the Administration tab and then click on Add Printer.
Enter your username and password, if prompted. Select the printer you want to share from the list and click Continue. Configure the printer settings as needed and click Add Printer. Set the printer options and click Set Default Options.Step 5: Configure Firewall if Necessary
If you have a firewall running, ensure that it allows traffic on the CUPS port 631:
$ sudo ufw allow 631
Step 6: Access the Shared Printer from Other Devices
On another Ubuntu machine, open the CUPS web interface by navigating to http://IP_ADDRESS_OF_HOST:631.
Go to the Printers tab and you should see the shared printer listed. Click on the printer and set it up on that machine.Step 7: Test the Printer
To ensure everything is working correctly, print a test page from the CUPS interface.
Troubleshooting
If you can't see the shared printer, make sure that both computers are on the same network and that the firewall settings are correct. Check the printer status in CUPS for any error messages.
By following these steps, you should be able to share printers effectively on your Ubuntu network. If you have any further questions or encounter issues, feel free to ask!