I will discuss the role of string gases in early universe cosmology. We will see that the 1-loop free energy for a string gas at finitie temperature will be enough to stabilize many of the moduli from the ten dimensional perspective. At late times such stabilization mechanisms will generically fail and the moduli will begin to roll, but a natural hierarchy of scales will remain. We will see that it is possible to regain stabilization by invoking the idea of moduli trapping, which results from considering the consequences of particle production in the time-dependent background. This also leads to exciting new possibilities for realizing dark energy and dark matter in the context of string theory model building.