In this paper we present numerical and theoretical results for characterising the onset of cavitation-type material instabilities in solids. To model this phenomenon we use nonlinear elasticity to allow for the large, potentially infinite, stresses and strains involved in such deformations. We give a characterisation of the set of linear displacement boundary conditions for which energy minimising deformations produce a singleisolated hole inside an originally perfect elastic body, based on a notion of the derivative of the stored energy functional with respect to hole-producing deformations. We conjecture that, for many stored energy functions, the critical linear boundary conditions which cause an isolated cavity to form correspond to the zero set of this derivative. We use this characterisation to propose a numerical procedure for computing these critical boundary displacements for general stored energy functions and give numerical examples for specific materials. For a degenerate stored energy function (with spherically symmetric boundary deformations) and for an elastic fluid, we show that the vanishing of the volume derivative gives exactly the critical boundary conditions for the onset of this type of cavitation.