How to Download and Install Htpasswd in Debian, Ubuntu Latest Version, Alpine, Arch, Kali Distro, CentOS, Fedora & Raspbian From Terminal

How to Download and Install Htpasswd in Debian, Ubuntu Latest Version, Alpine, Arch, Kali Distro, CentOS, Fedora & Raspbian From Terminal

htpasswd

This is the best utility for managing passwords. We can use Htpassword to create and manage htpasswd files to protect web server directories using basic authentication rules of your choice.

Maintainer: Debian Apache Maintainers



Section: httpd

Install htpasswd

  • Debian apt-get install apache2-utils Click to copy
  • Ubuntu apt-get install apache2-utils Click to copy
  • Alpine OS apk add apache2-utils Click to copy
  • Arch Linux pacman -S apache Click to copy
  • Kali Linux apt-get install apache2-utils Click to copy
  • CentOS yum install httpd-tools Click to copy
  • Fedora dnf install httpd-tools Click to copy
  • Raspbian apt-get install apache2-utils Click to copy

Create and manage htpasswd files to protect web server directories using basic authentication.

How to use htpasswd?

Below are few example commands for htpasswd that you can use in the terminal.

Create/overwrite htpasswd file:
htpasswd -c path/to/file user_nameClick to copy
Add user to htpasswd file or update existing user:
htpasswd path/to/file user_nameClick to copy
Add user to htpasswd file in batch mode without an interactive password prompt (for script usage):
htpasswd -b path/to/file user_name passwordClick to copy
Delete user from htpasswd file:
htpasswd -D path/to/file user_nameClick to copy
Verify user password:
htpasswd -v path/to/file user_nameClick to copy
Htpassowrd is the best linux utility to manage our passwords and directories. In order to To download the latest version of htpasswd in your favorite operating system just copy the htpasswd installation command from above and paste it into terminal. It will download the latest version of htpasswd 2026 from the repo and that would be the updated one that is what exactly you need to manage your directories and passwords.