Using recently developed adjoint methods for computing the shape derivatives of functions that depend on magnetohydrodynamic (MHD) equilibria (Antonsen et al., J. Plasma Phys., vol. 85, issue 2, 2019; Paul et al., J. Plasma Phys., vol. 86, issue 1, 2020), we present the first example of analytic gradient-based optimization of fixed-boundary stellarator equilibria. We take advantage of gradient information to optimize figures of merit of relevance for stellarator design, including the rotational transform, magnetic well and quasi-symmetry near the axis. With the application of the adjoint method, we reduce the number of equilibrium evaluations by the dimension of the optimization space (
${\sim }50\text {--}500$
) in comparison with a finite-difference gradient-based method. We discuss regularization objectives of relevance for fixed-boundary optimization, including a novel method that prevents self-intersection of the plasma boundary. We present several optimized equilibria, including a vacuum field with very low magnetic shear throughout the volume.