We use the LDA+U method to study the possibility of exciton condensation in perovskites of transition metals with $d^6$ electronic configuration such as LaCoO$_3$. For realistic interaction parameters we find several distinct solutions exhibiting spin-triplet exciton condensate, which gives rise to a local spin density distribution while the ordered moments are vanishingly small. Rhombohedral distortion from the ideal cubic structure suppresses the ordered state, contrary to the spin-orbit coupling which enhances the excitonic condensation energy. We explain the trends observed in the numerical simulations with the help of a simplified strong-coupling model. Our results indicate that LaCoO$_3$ is close to the excitonic instability and suggest ways to make it order.