hostapd(8)
hostapd is a user-space daemon for access point and authentication server management on Linux.
Synopsis
hostapd [-h] [-d | -dd | -ddd | -dddd] [-P <pid_file>] [-B] [-e <entropy_file>] [-g <global_ctrl_iface>] [-G <group>] [-K] [-T] [-v] <configuration_file> [<configuration_file2> ...]Description
hostapd is a daemon that enables a Linux system with suitable wireless hardware to act as an IEEE 802.11 access point (AP) and authentication server. It implements the IEEE 802.1X/WPA/WPA2/WPA3 protocols for authenticating wireless clients, managing encryption keys, and controlling access to the wireless network.
hostapd reads a configuration file that specifies wireless interface settings, SSID, security parameters, and authentication methods. It communicates with the Linux kernel driver via the nl80211 (netlink) interface and manages the wireless hardware to broadcast the access point and handle client connections.
The daemon is commonly used in enterprise WiFi deployments, network testing environments, and on embedded systems like Raspberry Pi to create software-based wireless access points.
Common options
| Flag | What it does |
|---|---|
-d | Show debug messages (increased verbosity with additional d's: -dd, -ddd, -dddd) |
-B | Daemonize after startup (run in background) |
-P | Write PID to specified file for tracking the daemon process |
-g | Specify global control interface socket directory (default: /var/run/hostapd) |
-G | Set group ownership for control interface sockets |
-e | Read entropy from file to seed random number generator |
-h | Display usage information and exit |
-v | Show version information |
-K | Include key dump in debug output (requires -d and compile-time support) |
-T | Log output to syslog instead of stdout |
Examples
Start hostapd with the default configuration file in foreground with debug output
hostapd /etc/hostapd/hostapd.confStart hostapd as a daemon in the background and write its PID to a file
hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.confStart hostapd with verbose debug output showing detailed information about operations
hostapd -dd /etc/hostapd/hostapd.confStart hostapd managing multiple wireless interfaces with separate configuration files
hostapd /etc/hostapd/wlan0.conf /etc/hostapd/wlan1.confStart hostapd with custom control interface socket directory for hostapd_cli connections
hostapd -d -g /tmp/hostapd_ctrl /etc/hostapd/hostapd.confStart hostapd in background and verify it's running using hostapd_cli
hostapd -B /etc/hostapd/hostapd.conf && hostapd_cli -p /var/run/hostapd ping