<P> How I Met Your Mother is an American sitcom written and created by Carter Bays and Craig Thomas . It was first aired on September 19, 2005 on CBS with a thirty - minute pilot episode, and finished its planned nine - year run on March 31, 2014 after 208 episodes . Set in present - day Manhattan, the series follows the social and romantic lives of Ted Mosby (Josh Radnor) and his four best friends, Marshall Eriksen (Jason Segel), Robin Scherbatsky (Cobie Smulders), Lily Aldrin (Alyson Hannigan), and Barney Stinson (Neil Patrick Harris), as Ted seeks out his future wife (Cristin Milioti). The show tells this story through the framing device of "future" Ted (Bob Saget) as an unreliable narrator who is recounting to his son and daughter the events that led him to their mother . In Seasons 1--8, episodes are typically set to a similar timeline as its real - world airdate, with the season finale generally taking place in the spring and the next season premiere in the fall, usually with a quick recap of the events that took place during the summer . The final season (season 9) deviates from this format by taking place immediately after the end of the previous season and encompassing only the weekend of Barney's and Robin's wedding . The series finale covers several years that follow . </P> <P> How I Met Your Mother premiered to nearly 11 million viewers and maintained a generally steady viewership . The first seven seasons are available on DVD in Region 1, 2, and 4, while the season eight DVD was released in Region 1 and 2 in October 2013 . In addition, all nine seasons are formerly available for streaming on Netflix and Amazon Video, and may be purchased from the US iTunes store . </P>

How many episodes are there in how i met your mother