Magnetic energy is believed to play a major role in powering coronal mass ejections (CMEs). Free magnetic energy is associated with electric currents that give the magnetic field more energy than a purely potential (current-free) field. For magnetic energy alone to power a CME, the energy must be sufficient to open the magnetic field to interplanetary space, to lift the ejecta against solar gravity, and to accelerate the ejecta. However, the coronal magnetic field is very nearly force free, and force-free fields attached to the coronal base cannot contain more energy than that of the fully open field with the same boundary conditions. We therefore explore force-free fields containing detached magnetic flux ropes, with the goal of finding the maximum possible energy stored in such configurations. We use a maximizing algorithm that searches a space of four parameters to find the maximum energy solution. Our results show a broad maximum in parameter space, with energies in excess of the open-field energy by about 18% of the corresponding potential-field energy. Confinement of nonpotential fields close to the solar equator enhances the energy storage, with maximum energies generally corresponding to more extreme confinement. This suggests that overlying potential fields can hold down a nonpotential field, allowing substantial energy buildup.