How to Install HPLIP on Ubuntu Linux

HP Linux Imaging and Printing (HPLIP) provides official HP printer and scanner drivers for Ubuntu, similar to HP’s Windows driver software but designed for Linux. Like Windows users expect plug-and-play HP device support with automatic driver installation and a graphical control panel, HPLIP delivers the same experience through automatic printer discovery, GUI management tools (HP Device Manager, similar to HP Smart on Windows), and seamless integration with Ubuntu’s printing system. The software handles printing, scanning, and faxing on over 3,000 HP device models with duplex printing support and regular driver updates directly from HP. HPLIP works through the CUPS (Common UNIX Printing System) printing service, which manages all print jobs and printer queues on Linux.

This guide covers how to install HPLIP on Ubuntu via APT, the official automatic installer, and manual compilation from source, verify the installation, configure printer connections (USB, network, wireless), test print and scan functionality, and troubleshoot common device detection issues.

System Requirements and Compatibility

Before installing HPLIP, verify your system meets the minimum requirements and your HP device is supported. HPLIP supports over 3,000 HP printer and scanner models across all Ubuntu versions currently receiving security updates.

Minimum System Requirements

  • Ubuntu Version: Any currently supported Ubuntu release
  • Disk Space: 200-500 MB for HPLIP packages and dependencies
  • Memory: 512 MB RAM minimum (1 GB recommended for scanning operations)
  • Network: Internet connection required for downloading packages and proprietary plugins

Check Device Compatibility

Not all HP devices work with HPLIP, and newer printer models may require recent HPLIP versions. Before proceeding, verify your specific HP printer or scanner model appears in HP’s official compatibility database. Visit the HP Linux Imaging and Printing supported devices page and search for your device model. The database shows the minimum HPLIP version required, supported features (print, scan, fax), and whether proprietary plugins are needed.

If your device requires a newer HPLIP version than available in Ubuntu’s repositories, use the manual installation method covered later in this guide. Check your device’s minimum version requirement before choosing an installation method.

Choose Your HPLIP Installation Method

HPLIP offers multiple installation paths depending on your Ubuntu version, device requirements, and preference for stability versus latest features. Ubuntu’s APT repositories provide stable, well-tested HPLIP versions that update automatically, while manual installation delivers the newest releases with support for recently launched HP devices.

MethodVersion/ChannelStabilityBest For
APT (Ubuntu Repositories)Stable release (typically 3-6 months behind latest)High – thoroughly tested, automatic updatesMost users with established HP devices, production systems requiring stability
Manual Build (HP Official)Latest release directly from HPMedium – newest features but requires manual updatesNew HP printer models, devices requiring latest HPLIP version, advanced users
Snap (hplip-printer-app)Modern Printer Application (IPP Everywhere)High – sandboxed, automatic updatesFuture-proofing for IPP-based printing environments, containerized systems

Most users should install via APT for automatic updates and proven stability. Choose manual installation only when your device requires a newer HPLIP version than Ubuntu provides, or when troubleshooting indicates repository packages are outdated. The Snap method represents the future of Linux printing with IPP Everywhere emulation but currently offers fewer features than traditional HPLIP.

Update Ubuntu Before Installing HPLIP

Before installing HPLIP, first update your system packages to ensure compatibility and minimize potential conflicts during installation. Run the following command to update and upgrade your packages:

sudo apt update && sudo apt upgrade

Check for Existing HPLIP Installation

Many Ubuntu installations include HPLIP by default. Before proceeding, verify whether HPLIP is already installed and check if the version meets your device requirements:

dpkg -l | grep hplip

If the command returns package information, HPLIP is already installed. Next, check the installed version and compare it against your device’s minimum requirements:

hp-check -v

The output displays the HPLIP version number. Cross-reference this version with your device’s minimum requirement from the HP compatibility database. If the installed version is older than required, you’ll need to use manual installation to get a newer release. If no packages appear, proceed with the installation steps below.

Install HPLIP via APT (Recommended)

Install HPLIP and its related packages using APT. The installation includes four main packages:

  • hplip: Core drivers and command-line utilities
  • hplip-data: Device configuration files and printer definitions
  • hplip-gui: Graphical interface tools (HP Device Manager, setup wizard)
  • hplip-doc: Documentation and help files (optional)

Run the following command to install all packages:

sudo apt install hplip hplip-data hplip-gui hplip-doc

Server users can skip hplip-gui and hplip-doc if graphical tools and documentation are not needed:

sudo apt install hplip hplip-data

Proprietary Plugin Requirements

Certain HP printer models require proprietary binary plugins for full functionality, particularly LaserJet printers that use HP’s proprietary print languages. These plugins provide features such as enhanced print quality modes, advanced color management, and specific paper handling capabilities not available through open-source drivers alone. The plugin must be downloaded directly from HP’s servers after accepting their license agreement.

Printers commonly requiring plugins include:

  • HP LaserJet Pro series (M15, M28, M29, M102, M130, M203, M227, etc.)
  • HP LaserJet MFP series with advanced scanning features
  • Select HP Color LaserJet models
  • HP OfficeJet Pro printers with duplex and fax capabilities

Check the HP compatibility database for your specific model to determine if a plugin is required. Plugin installation will be covered in the post-installation steps section.

Install HPLIP via Manual Build from Source

When Ubuntu’s repository HPLIP version is older than your device requires, or when you need the latest HP-released features, install HPLIP manually from source. HP provides two methods: an automatic installer script that handles dependencies and configuration, or manual tarball compilation for advanced users who need granular control.

Option 1: HP Automatic Installer (Recommended for Manual Installation)

HP’s automatic installer script checks system dependencies, downloads the latest HPLIP version, configures build options for Ubuntu, and installs everything automatically. This method works well for users who need newer versions without manual compilation complexity.

Download and run the automatic installer:

wget https://sourceforge.net/projects/hplip/files/hplip/3.24.4/hplip-3.24.4.run
chmod +x hplip-3.24.4.run
./hplip-3.24.4.run

Replace 3.24.4 with the current version available on the HPLIP download page. The installer script presents an interactive menu that guides you through dependency checks, build configuration, and installation. Follow the on-screen prompts, which will notify you of any missing dependencies and offer to install them automatically.

The automatic installer requires build tools (gcc, make) and development libraries. If dependency installation fails, the installer displays specific package names. Install them manually with sudo apt install <package-name> and re-run the installer.

Option 2: Manual Tarball Compilation

For complete control over build options and installation paths, compile HPLIP from the source tarball. This method suits advanced users who need to customize features or integrate HPLIP into custom distributions.

First, install the build dependencies that every supported Ubuntu release needs:

sudo apt install build-essential libcups2-dev libdbus-1-dev libavahi-client-dev \
libavahi-core-dev libavahi-common-dev libusb-1.0-0-dev libjpeg-dev libsnmp-dev \
libtool libtool-bin python3-dev python3-pyqt5 python3-dbus python3-gi python3-pil \
python-is-python3 libsane-dev sane-utils avahi-utils wget

Download and extract the HPLIP tarball:

wget https://sourceforge.net/projects/hplip/files/hplip/3.24.4/hplip-3.24.4.tar.gz
tar xvzf hplip-3.24.4.tar.gz
cd hplip-3.24.4

Replace 3.24.4 with the current version number listed on the HPLIP download page so every command references the same release.

Configure the build for modern Ubuntu releases (64-bit systems):

./configure --with-hpppddir=/usr/share/ppd/HP --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr \
--enable-network-build --enable-scan-build --enable-fax-build --enable-dbus-build \
--disable-qt4 --enable-qt5 --enable-hpcups-install --enable-cups-drv-install

For 32-bit systems, use --libdir=/usr/lib instead. The configuration script checks dependencies and reports missing packages. Install any missing items with APT before proceeding.

Compile the source code (run as regular user, not root):

make

Install the compiled binaries:

sudo make install

The compilation process takes 5-15 minutes depending on system performance. If compilation fails, check the error output for missing dependencies or configuration issues, install the required packages, and run make clean before trying again.

Install HPLIP via Snap

The HPLIP Printer Application available through Snap represents a modern approach to Linux printing using IPP Everywhere emulation. Unlike traditional HPLIP packages, this Printer Application emulates a driverless IPP network printer, making HP devices appear as modern network printers that Ubuntu discovers automatically.

Install the HPLIP Printer Application:

sudo snap install hplip-printer-app

Because the Snap runs in strict confinement, manually connect the interfaces that grant access to USB printers and your local CUPS service before attempting discovery:

sudo snap connect hplip-printer-app:raw-usb
sudo snap connect hplip-printer-app:cups-control
sudo snap connect hplip-printer-app:avahi-observe

After the interfaces are connected, open the web interface at http://localhost:8000 to add and configure printers. The Snap version updates automatically, runs in a sandboxed environment for improved security, and works across different Linux distributions without distribution-specific packages.

The Snap HPLIP Printer Application currently lacks some features compared to traditional HPLIP, including scanning support, command-line utilities, and certain printer-specific tools. HP plans to release a native Printer Application in the future with full feature parity. Use traditional HPLIP for production environments requiring complete functionality.

Post-Installation Configuration Steps

After installing HPLIP through any method, complete these essential configuration steps to enable proper device access and functionality. These steps are mandatory for HPLIP to work correctly, not optional troubleshooting measures.

Add User to Printer Groups

HPLIP requires your user account to belong to the lp (line printer) and lpadmin (printer administration) groups for permission to access printing hardware and manage printer queues. Add your current user to these groups:

sudo usermod -a -G lp,lpadmin $USER

After running this command, you must log out and log back in (or restart your PC) for group membership changes to take effect. The system only reads group assignments during login, so changes won’t apply to your current session. Verify membership after logging back in with the groups command.

Reconnect USB Printers

If you have a USB printer already connected during HPLIP installation, Ubuntu won’t recognize it properly until you reset the USB connection. This happens because HPLIP’s udev rules (device detection rules) weren’t active when the printer was first plugged in. Reset the connection by doing one of the following:

  1. Unplug the USB cable from your computer and plug it back in, or
  2. Restart your computer (which also reloads all USB devices)

After reconnecting, Ubuntu’s device manager will recognize the printer with HPLIP’s drivers and make it available for configuration.

Install Proprietary Plugin (If Required)

If your device requires HP’s proprietary plugin (check the compatibility database or your printer’s documentation), install it now before configuring your printer:

sudo hp-plugin

The plugin installer downloads the binary plugin from HP’s servers (approximately 2-5 MB) and prompts you to accept HP’s license agreement. Run it with sudo so it can place firmware under /usr/share/hplip. The download requires internet access and may take a few minutes depending on connection speed. If the download fails, check your network connection and firewall settings, then try again.

Corporate or restrictive networks may block access to HP’s plugin servers. If downloads consistently fail after multiple attempts, temporarily connect to a different network (mobile hotspot, home network) to complete plugin installation, or configure proxy settings to allow access to sourceforge.net and HP’s download servers.

Launch HPLIP After Installation

After installation completes, launch HPLIP using either the graphical interface or command line.

Launch HPLIP Graphically

Open your application menu and search for “HPLIP” or “HP Device Manager.” Click the HP Device Manager icon to launch the graphical interface. Alternatively, access the setup wizard by searching for “HP Device Setup.”

Launch HPLIP via Command Line

Open the HPLIP toolbox directly from the terminal:

hp-toolbox

This command opens the HP Device Manager where you can configure printers, check ink levels, and perform maintenance tasks.

Set Up Your HP Printer with HPLIP

After installing HPLIP, you need to configure your HP devices and verify they work correctly. The setup process uses the hp-setup wizard to detect devices, install drivers, and establish connections.

Step 1: Run HPLIP Setup

Run the hp-setup command with administrative privileges so it can create printers under CUPS. Use the GUI flag on desktop systems:

sudo hp-setup -u

On headless or server installs without an X session, switch to the interactive text mode:

sudo hp-setup -i

Step 2: Select Connection Type

When the HPLIP setup window appears, you will be prompted to choose the connection type for your HP device. Available options include USB, Network/Ethernet/Wireless, and Parallel (legacy printers) based on how your device connects. Choose the appropriate connection type for your device and click “Next.”

Parallel port connections are rare on modern systems but still supported for legacy HP LaserJet and DeskJet printers from the 1990s-early 2000s. Most current HP devices use USB or network connections. If your system lacks a parallel port, USB-to-parallel adapters may work but aren’t officially supported by HPLIP.

Step 3: Discover and Select Your Device

HPLIP will now scan for connected HP devices based on the connection type you selected. If your device is not automatically detected, you may need to manually enter its IP address or hostname (for Network/Ethernet/Wireless connections). Once your device appears in the list, select it and click “Next.”

Step 4: Configure Printer Settings

Next, configure basic settings for your HP printer, such as the printer name and description. You can also share the printer on your local network if desired. After configuring the settings, click Next to continue.

Step 5: Install the Printer Driver

HPLIP will now prompt you to install the appropriate printer driver for your device. It will automatically select the recommended driver, but you can also choose a different driver from the list if needed. Click “Next” to begin the driver installation process.

Testing HPLIP Installation

After configuring your HP devices, test the installation to confirm everything works correctly. This section covers discovering connected devices and testing print and scan functionality.

Discover Connected HP Devices

Before testing, verify HPLIP detects your HP devices correctly. The hp-probe command scans for all connected HP printers and scanners regardless of connection type (USB, network, or parallel):

hp-probe

This command outputs device URIs (Uniform Resource Identifiers), connection types, and model information for each detected HP device. USB devices appear with URIs like hp:/usb/DeskJet_2600_series?serial=XXXXX, while network devices show hp:/net/DeskJet_2600_series?ip=192.168.1.100. Use these URIs when manually specifying devices in other HPLIP commands.

Add the -g flag when you need verbose debug output that shows every discovery step and USB query:

hp-probe -g

If you prefer a graphical device list, open HP Device Manager instead of relying on hp-probe:

hp-toolbox

Print a Test Page

First, identify your configured printer name. Run this command to list all available printers:

lpstat -p -d

The output shows your printer names and the default printer. The -p flag lists all printers, while -d displays the default printer. Use this information for the test print commands below.

Print Test Page via Command Line

Print a test page from the terminal using either the HPLIP-specific command or the standard CUPS command. The HPLIP method automatically selects your default printer and sends HP’s test page:

hp-testpage

This command prints a formatted test page showing your printer model, HPLIP version, and color/alignment patterns. Alternatively, use the standard CUPS test print command to target a specific printer, replacing printer_name with your actual printer name from the previous lpstat command:

lp -d printer_name /usr/share/cups/data/testprint

The hp-testpage command is simpler for quick verification, while lp offers more control when managing multiple printers.

Print Test Page via GUI

  1. Open the Printers application on your Ubuntu system.
  2. Locate and select your HP printer in the list of available printers.
  3. Right-click on the printer and choose Properties.
  4. In the printer properties window, click the Print Test Page button.

A successful test page confirms your HP printer is properly configured with HPLIP.

Test Scanning Functionality

For HP all-in-one devices with scanning capabilities, test the scanner using HPLIP’s built-in scan utility. If you have multiple scanners, first list available devices:

hp-scan -i

This command starts interactive mode, lists detected scanners, and prompts you to choose the correct device URI before running a scan.

Test Scan via Command Line

Once you’ve identified your scanner, perform a test scan and save the output:

hp-scan --output=my-test-scan.png

This saves the scanned image as my-test-scan.png in your current directory. Additionally, HPLIP supports multiple output formats including PNG, JPG, and PDF.

Test Scan via GUI

  1. Launch the HPLIP Toolbox by searching for “HPLIP” in your application menu and clicking the HPLIP Toolbox icon.
  2. In the HPLIP Toolbox window, locate and select your HP all-in-one device.
  3. Click the Scan button to open the scanning utility.
  4. Follow the on-screen instructions to perform a test scan, adjusting the scan settings as needed.

A successful test scan confirms your HP all-in-one device’s scanning functionality works properly with HPLIP.

Manage Printers via CUPS Web Interface

The CUPS (Common UNIX Printing System) web interface provides advanced printer management capabilities beyond what HPLIP’s tools offer. Through this browser-based interface, you can configure print queues, modify printer options, view detailed job histories, adjust PPD (PostScript Printer Description) settings, and manage printer sharing across your network. This is particularly useful for server environments, troubleshooting complex configuration issues, or when you need fine-grained control over printer behavior.

Access the CUPS administration panel by opening your browser and visiting http://localhost:631.

The CUPS interface organizes functions under several tabs:

  • Administration: Add/remove printers, manage server settings, enable printer sharing, configure remote administration
  • Printers: View all configured printers, check status, set defaults, access printer-specific options
  • Jobs: Monitor active print jobs, view completed jobs, cancel or hold queued jobs
  • Classes: Create printer pools (groups of printers that share a queue for load balancing)

When you click administrative functions like “Add Printer” or modify printer settings, CUPS prompts for authentication. Enter your Ubuntu username and password (the same credentials you use with sudo). Your user must belong to the lpadmin group to perform administrative tasks.

By default, CUPS only accepts connections from localhost (127.0.0.1), preventing remote access to the web interface. To enable remote administration from other computers on your network, you must explicitly configure CUPS to listen on network interfaces and allow remote connections. This creates security risks; only enable remote access when necessary and implement firewall rules or VPN tunnels to restrict access to trusted networks.

Common CUPS administrative tasks include:

  • Setting default options: Configure paper size, print quality, duplex settings, and color management as defaults for all jobs
  • Enabling printer sharing: Allow other Linux, macOS, or Windows computers on your network to print through your Ubuntu system
  • Viewing error logs: Access detailed logging information when troubleshooting printer communication or driver issues
  • Managing print quotas: Set page limits or implement accounting for shared printers in office environments

The CUPS web interface complements HPLIP’s tools by providing system-level printing configuration, while HPLIP focuses on HP-specific features like ink level monitoring, print head alignment, and scanner access.

Troubleshooting HPLIP Issues

Common HPLIP issues typically involve device detection, permissions, or network connectivity. This section addresses frequent problems and provides solutions to get your HP devices working properly.

Printer Not Detected During Setup

If HPLIP fails to detect your printer during setup, first verify the connection. For USB printers, check the physical connection and run:

lsusb | grep -i hewlett

This command lists connected HP USB devices. If nothing appears, the issue is hardware-related. Check the cable and try a different USB port. For network printers, verify the printer’s IP address is reachable:

ping -c 4 printer_ip_address

Replace printer_ip_address with your printer’s actual IP address. Network discovery failures often indicate firewall issues, incorrect network settings, or the printer being on a different subnet.

Repository HPLIP Version Too Old

When your HP device requires a newer HPLIP version than Ubuntu’s repositories provide, the device may not appear during setup, or certain features may fail even after successful configuration. This commonly affects recently released HP printers that weren’t supported in the HPLIP version packaged with your Ubuntu release.

First, verify your installed HPLIP version and compare it to your device’s minimum requirement from the HP compatibility database:

hp-check -v

If the installed version is older than required, remove the repository version and install from source using HP’s automatic installer or manual compilation method covered earlier in this guide. Newer HPLIP versions add device support and fix compatibility issues that can’t be backported to older releases.

CUPS Service Not Running

HPLIP requires the CUPS (Common UNIX Printing System) printing service to function. This service manages all print jobs and printer communication on Linux systems. First, check if CUPS is running:

systemctl status cups

If CUPS is inactive, start and enable it to launch automatically on boot:

sudo systemctl start cups
sudo systemctl enable cups

Missing Printer Driver or Plugin

Some HP printers require proprietary plugins for full functionality, while others may have missing dependencies that prevent proper operation. First, check for missing dependencies and run a thorough diagnostic:

hp-check -t

This command performs a diagnostic check and reports missing components. The -t flag runs a thorough test of all HPLIP dependencies, checking for Python libraries, scanning tools, and communication libraries. Review the output for error messages or warnings about missing packages.

If dependencies are missing or broken, fix them automatically:

sudo apt-get install -f

The -f flag (fix-broken) attempts to correct broken package installations by installing missing dependencies or removing conflicting packages. This is particularly useful after manual installations or when dependency resolution fails during initial HPLIP installation.

If the diagnostic indicates your printer requires a proprietary plugin, install it:

sudo hp-plugin

Follow the on-screen instructions to download and install the proprietary plugin. The plugin must be downloaded from HP’s servers, requires accepting their license agreement, and needs root privileges so files can be written into system directories.

If the plugin download fails due to network issues or server unavailability, wait a few minutes and try again. Some corporate or restrictive networks may block access to HP’s plugin servers. Temporarily disable proxy settings or try from a different network if the download consistently fails.

Multi-Function Device Partial Failure

Sometimes print functionality works but scanning fails, or vice versa. This typically indicates missing dependencies or incomplete driver installation. Run the diagnostic tool:

hp-check -t

Review the output for missing scanning libraries (python3-pil, libsane-hpaio) or print dependencies. Install any missing packages:

sudo apt install python3-pil libsane-hpaio

After installing missing packages, restart the CUPS service and test both functions again:

sudo systemctl restart cups

Network Printer Hostname Resolution Issues

If network printer discovery fails despite correct network configuration, mDNS (multicast DNS) may not be functioning properly. First, verify the printer responds to its hostname:

ping -c 4 printer-hostname.local

If the hostname doesn’t resolve, install Avahi (the Linux mDNS implementation):

sudo apt install avahi-daemon avahi-utils

Then enable and start the Avahi service:

sudo systemctl enable avahi-daemon
sudo systemctl start avahi-daemon

Alternatively, use the printer’s IP address directly instead of its hostname during setup. Find the IP address from your router’s admin panel or the printer’s network settings menu.

Network Printer Security Considerations

Network printers expose services to your local network and potentially beyond if not properly secured. When configuring network printers, consider these security practices:

  • Restrict firewall rules: Only allow printer ports (631/tcp, 5353/udp) from trusted networks, not all interfaces
  • Verify plugin authenticity: The hp-plugin tool downloads proprietary code from HP servers; ensure you’re on a trusted network during installation
  • Disable remote administration: Access the CUPS web interface at http://localhost:631 and disable remote administration unless specifically needed
  • Use printer authentication: Configure printer passwords or access controls when available to prevent unauthorized print jobs

For public-facing servers, avoid exposing CUPS ports directly to the internet. Use VPN access or SSH tunneling instead.

Network Printer Firewall Configuration

Network printer access requires specific firewall ports. If using UFW firewall, allow CUPS and IPP (Internet Printing Protocol) traffic:

sudo ufw allow 631/tcp
sudo ufw allow 5353/udp

Port 631 handles CUPS/IPP printing, while port 5353 enables Bonjour/mDNS (multicast DNS) printer discovery for automatic network printer detection.

Additional HPLIP Commands

This section covers useful HPLIP management commands including updates and removal.

Update HPLIP

HPLIP updates automatically with your system packages through APT. Desktop systems with automatic updates enabled will receive new HPLIP versions as HP releases them. To manually check for and install updates:

sudo apt update && sudo apt upgrade

After updating, verify the new version:

hp-check -v

For production servers, consider configuring unattended upgrades to keep HPLIP and other system packages current automatically.

Remove HPLIP

If you no longer need HPLIP on your system, remove all HPLIP packages completely:

sudo apt remove hplip hplip-data hplip-gui hplip-doc

This command removes all HPLIP components. Additionally, clean up unused dependencies:

sudo apt autoremove

The autoremove command removes packages that were installed as dependencies but are no longer needed.

Conclusion

HPLIP provides official HP printer and scanner support for Ubuntu through automatic device discovery, GUI management tools, and command-line utilities. The software handles printing, scanning, and faxing across over 3,000 HP device models with regular driver updates from HP. Your Ubuntu system now connects to HP devices through CUPS integration with full multifunction support.

2 thoughts on “How to Install HPLIP on Ubuntu Linux”

Leave a Comment