Stellar birth environments are dangerous environments for planetary systems. I will describe how planetary systems are vulnerable to perturbations from passing stars and stellar companions within stellar clusters. These perturbations may lead to a chain of events that result in the ejection of some planets, leaving those remaining on tighter, and eccentric, orbits. Planetary systems may exchange into binary systems and then the stellar companion may perturb planetary orbits via the Kozai mechanism. I will show how this can lead to strong dynamical interactions between planets in a planetary system, with some planets being ejected. In some cases, planets placed on extremely eccentric orbits may form hot jupiters via tidal interactions. By using full N-body calculations of young stellar clusters, I quantify the frequency of both fly-by encounters and binary-exchange encounters, and also the frequency of close encounters involving protoplanetary discs. I compute the fraction of planetary systems likely to emerge unscathed from a stellar cluster.