Many proteins in the cell fold cotranslationally within the restricted space of the polypeptide exit tunnel or at the surface of the ribosome. A growing body of evidence suggests that the ribosome can alter the folding trajectory in many different ways. In this review, we summarize the recent examples of how translation affects folding of single-domain, multiple-domain and oligomeric proteins. The vectorial nature of translation, the spatial constraints of the exit tunnel, and the electrostatic properties of the ribosome-nascent peptide complex define the onset of early folding events. The ribosome can facilitate protein compaction, induce the formation of intermediates that are not observed in solution, or delay the onset of folding. Examples of single-domain proteins suggest that early compaction events can define the folding pathway for some types of domain structures. Folding of multi-domain proteins proceeds in a domain-wise fashion, with each domain having its role in stabilizing or destabilizing neighboring domains. Finally, the assembly of protein complexes can also begin cotranslationally. In all these cases, the ribosome helps the nascent protein to attain a native fold and avoid the kinetic traps of misfolding.