Skip to content

Raspberry Pi

Physical Raspberry Pi running two services:

  • Pi-hole — secondary DNS ad-blocker (secondary instance; see pihole-lxc for the primary running as a Proxmox LXC)
  • CUPS print server — shares an HP LaserJet 1012 to the home network over IPP and Samba

Part 1: OS Installation

Format the SD Card (Windows)

Open the Run dialog and launch diskpart:

diskpart
list disk
select disk 1
select partition 1
delete partition
partition
clean
create partition primary

Warning

Confirm disk 1 is the SD card before selecting it.

Format the disk using the Explorer context menu after diskpart completes.

Write the OS Image

Boot the Pi and follow the setup prompts, then update:

apt update && apt upgrade -y

Part 2: Pi-hole (Secondary Instance)

Install Pi-hole

curl -sSL https://install.pi-hole.net | bash

Pi-hole assigns a static IP address during installation. After install completes, note the assigned IP by checking the router's device list.

IPs for this setup:

  • Primary Pi-hole (Proxmox LXC): 192.168.0.15
  • This Pi-hole (Raspberry Pi): 192.168.0.58

Configure Router DNS

Set the router's LAN DHCP/DNS settings to point to both Pi-hole instances:

  • Static DNS 1: 192.168.0.15 (primary — Proxmox LXC)
  • Static DNS 2: 192.168.0.58 (this Pi)

See the Pi-hole docs on configuring devices to use Pi-hole as DNS for router-specific instructions.


Part 3: CUPS Print Server

Install CUPS, HPLIP, and Samba

sudo apt install cups hplip samba

Grant User Printer Permissions

sudo usermod -a -G lpadmin $USER

Make CUPS Accessible on the Home Network

By default CUPS only listens on localhost. This opens it to the LAN:

sudo cupsctl --remote-any
sudo systemctl restart cups

Access the CUPS Web Interface

Open in a browser:

http://192.168.0.58:631

CUPS credentials

Username is jake. Password is stored in your password manager.


Configure Samba for Printer Sharing

Samba is needed so Windows clients can discover and install the printer. Edit the Samba config:

sudo nano /etc/samba/smb.conf

Add to the bottom of the file:

# CUPS printing.
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = no
guest ok = no

Restart Samba:

sudo systemctl restart smbd

Add the Printer in CUPS

Make sure the printer is powered on and plugged into the Pi (may need to restart the Pi first).

In the CUPS web interface at http://192.168.0.58:631:

  1. Go to Administration → Add Printer
  2. Choose local printer: HP LaserJet 1012 USB 00CNFB729336 HPLIP (HP LaserJet 1012)
  3. Click Continue
  4. For the connection URI, find it via terminal:
lpinfo -v | grep hp

Copy the output line and paste it into the connection dialog.

  1. Add name, description, and location
  2. Check Share this Printer and click Continue
  3. Select make: HP
  4. Select model: HP LaserJet 1012, hpcups 3.22.10 (en) (first of the three identical entries)
  5. Click Add Printer and choose default settings

Add the Printer on Windows

Get the printer URL from the CUPS Printers tab — click on the HP LaserJet 1012 and copy the full URL from the browser address bar:

http://192.168.0.58:631/printers/hp_LaserJet_1012

On Windows:

  1. Settings → Bluetooth & devices → Printers & scanners
  2. Click Add device, wait a few seconds, then click The printer that I want isn't listed
  3. Select Select a shared printer by name
  4. Paste the URL and click Next
  5. When prompted for a driver, select HP as manufacturer and find a generic HP LaserJet driver (or browse to the local hp1010 driver files if needed)