Surface nanobubbles have potential applications in the manipulation of nanoscale and biological materials, waste-water treatment, and surface cleaning. These spherically capped bubbles of gas can exist in stable diffusive equilibrium on chemically patterned or rough hydrophobic surfaces, under supersaturated conditions. Previous studies have investigated their long-term response to pressure variations, which is governed by the surrounding liquid’s local supersaturation; however, not much is known about their short-term response to rapid pressure changes, i.e., their cavitation dynamics. Here, we present molecular dynamics simulations of a surface nanobubble subjected to an external oscillating pressure field. The surface nanobubble is found to oscillate with a pinned contact line, while still retaining a mostly spherical cap shape. The amplitude–frequency response is typical of an underdamped system, with a peak amplitude near the estimated natural frequency, despite the strong viscous effects at the nanoscale. This peak is enhanced by the surface nanobubble’s high internal gas pressure, a result of the Laplace pressure. We find that accurately capturing the gas pressure, bubble volume, and pinned growth mode is important for estimating the natural frequency, and we propose a simple model for the surface nanobubble frequency response, with comparisons made to other common models for a spherical bubble, a constant contact angle surface bubble, and a bubble entrapped within a cylindrical micropore. This work reveals the initial stages of growth of cavitation nanobubbles on surfaces, common in heterogeneous nucleation, where classical models based on spherical bubble growth break down.