We report dispersive coupling of an optically trapped nanoparticle to the field of a Fabry–Perot cavity in high vacuum. We demonstrate nanometer-level control in positioning the particle with respect to the cavity field, which allows access to linear, quadratic, and tertiary optomechanical interactions in the resolved sideband regime. We determine all relevant coupling rates of the system, i.e. mechanical and optical losses as well as optomechanical interaction, and obtain a quantum cooperativity of CQ = 0.01. Based on the presented performance, the regime of strong cooperativity (CQ > 1) is clearly within reach by further decreasing the mode volume of the cavity.