We analyze ecological systems that are influenced by random environmental fluctuations. We first provide general conditions which ensure that the species coexist and the system converges to a unique invariant probability measure (stationary distribution). Since it is usually impossible to characterize this invariant probability measure analytically, we develop a powerful method for numerically approximating invariant probability measures. This allows us to shed light upon how the various parameters of the ecosystem impact the stationary distribution. We analyze different types of environmental fluctuations. At first we study ecosystems modeled by stochastic differential equations. In the second setting we look at piecewise deterministic Markov processes. These are processes where one follows a system of differential equations for a random time, after which the environmental state changes, and one follows a different set of differential equations-this procedure then gets repeated indefinitely. Finally, we look at stochastic differential equations with switching, which take into account both the white noise fluctuations and the random environmental switches. As applications of our theoretical and numerical analysis, we look at competitive Lotka-Volterra, Beddington-DeAngelis predator-prey, and rock-paper-scissors dynamics. We highlight new biological insights by analyzing the stationary distributions of the ecosystems and by seeing how various types of environmental fluctuations influence the long term fate of populations.