Numerical simulations of crystal defects are necessarily restricted to finite computational domains, supplying artificial boundary conditions that emulate the effect of embedding the defect in an effectively infinite crystalline environment. This work develops a rigorous framework within which the accuracy of different types of boundary conditions can be precisely assessed. We formulate the equilibration of crystal defects as variational problems in a discrete energy space and establish qualitatively sharp regularity estimates for minimisers. Using this foundation we then present rigorous error estimates for (i) a truncation method (Dirichlet boundary conditions), (ii) periodic boundary conditions, (iii) boundary conditions from linear elasticity, and (iv) boundary conditions from nonlinear elasticity. Numerical results confirm the sharpness of the analysis.