Optical fiber acoustic sensors with miniature size and high sensitivity are attractive to develop compact photoacoustic spectroscopy. Here, a compact photoacoustic gas sensor was demonstrated by utilizing a diaphragm-based fiber-optic Fabry-Perot cavity as both the acoustic sensor and the multipass cell. A nanoscale graphite film was used as the flexible diaphragm to increase the acoustic sensitivity of the Fabry-Perot cavity and the cavity inner surface was coated with highly-reflective Au film to form a multipass cell for amplification of the photoacoustic signal. With a laser power of 20 mW at 1532.8 nm, the sensor demonstrated a low detection limit of ∼ 50 ppb for C2H2gas with an integration time of ∼ 100 s. The optical fiber photoacoustic gas sensor with a millimeter-scale diameter and ppb-level detection limit is promising for trace gas sensing in various areas including industrial process and environmental monitoring.