Nicholas Stoller began his carrier in comedy writing while attending Harvard University, where he worked as a staff member on the Harvard Lampoon. After graduation, Stoller moved to Los Angeles and became a television writer, working on shows like MTV's Head Trip and Comedy Central's Strangers with Candy. He also wrote for Judd Apatow's celebrated Fox television series Undeclared (2001-2002), where he met actor and later collaborator Jason Segel. After Undeclared, Stoller co-wrote the screenplay for Fun with Dick and Jane (2005) with Apatow.
Stoller made his directorial debut with the movie Forgetting Sarah Marshall (2008), a romantic comedy written by Jason Segel. Starring Segel, Mila Kunis, Kristen Bell and Jonah Hill, the film follows Peter (Segel) a struggling musician whose heart is broken when his television star girlfriend (Bell) dumps him. After a nervous breakdown, Peter takes a trip to Hawaii to clear his head, only to find that his ex is on vacation at the same resort with her new rocker boyfriend.