First you need to install CUPS (common unix printing system) for printer access. In my case the required printer drivers were installed automatically (hplip). If you are using a different printer you might have to check which packages you need on the HP or other vendor website.
sudo apt-get install cups
After cups is installed, enable remote access in the config file.
sudo nano /etc/cups/cupsd.conf
change the localhost to *
# Only listen for connections from the local machine.
Listen *:631
now we’re going to restart CUPS
sudo /etc/init.d/cups restart
Now open your webbrowser on your computer and go to (this ip is for example):
http://192.168.178.4:631/
Click on Administration in the top menu bar:
click the button Add Printer, you will be asked for a user account and password, use your root account.
Make sure your printer is turned on:
Click continue if your printer is listed.
Give your printer a name (without spaces) and click the Continue button.
Select your driver and click the Add Printer button.
Set the default printing options and click the Set Default Options button to confirm.
Your printer is now ready!