The implementation of ideal ballooning stability within an optimization codeis used to determine stable, moderate-β compact stellaratorconfigurations. Due to the large computational requirements of existingballooning codes, such calculations within the optimization process werepreviously impractical. The recently developed COBRA code can efficientlycompute ideal ballooning growth rates on various magnetic surfaces, using theVMEC code to supply equilibrium data. The optimization code has been used tominimize these growth rates, giving rise to new stellarator configurations atlow aspect ratios with good ballooning stability properties, which alsomaintain previously determined desirable physics properties. This particularimplementation is robust due to the enhanced convergence features included inCOBRA, while incurring only a small overhead on the total computational time.