Hector is a quirky psychiatrist who has become increasingly tired of his humdrum life. He tells his girlfriend, Clara, that he needs to go on a journey to research happiness. On a flight to China, he is seated next to Edward, a cranky businessman. Edward takes Hector to a very exclusive nightclub in Shanghai, where Hector meets a young woman named Ying Li and instantly falls for her.
He asks to meet Ying Li's family. She declines, ashamed of how she makes her living. Their date is interrupted by her pimp, who takes Ying Li away by force. Hector then ventures into the mountains and visits a monastery, where he befriends their leader and talks briefly with Clara via Skype.
Hector departs on a terrifying plane ride to Africa, where a woman invites him to her family's house for sweet potato stew, and gives him a book about happiness written by one Professor Coreman. Hector meets up with his old friend Michael, a physician, with his bodyguard Marcel, and later meets a quick-tempered drug lord named Diego Baresco, who doesn't believe in happiness because his wife is unhappy due to her medication, but loans Hector a pen to write down a prescription for his wife.
Hector discovers that Marcel is Michael’s lover, and they are happy. He Skypes again with Clara, who is going out in a fancy gown and seems uninterested in talking to him. He visits the local woman who he befriended on the plane and her family for dinner. His vehicle is carjacked and Hector is kidnapped and locked in a rat-infested cell. When the kidnappers decide to kill him, Hector claims to be friends with Diego to save himself, but cannot prove it. With a gun pointed at his head, Hector asks if he can make one final note in his book about what brings his captors happiness, revealing the pen engraved with Diego's name to the kidnappers. Upon his release, Hector makes his way back to the village where he celebrates with the locals.
While flying to Los Angeles, Hector attends to a woman with a Brain tumor. Hector then goes to the beach in Santa Monica and encounters Agnes, an old girlfriend, who is now happily married with children. Hector calls Clara and they break up in an argument.
Agnes and Hector meet with Professor Coreman, who is studying the effects of happiness on the brain. During a lecture, Coreman points out that people shouldn't be concerned with the pursuit of happiness, but with the happiness of pursuit. Agnes and Hector check out a project Coreman has been working on, which monitors brain activity in real time and how it reacts to different emotions.
Agnes is instructed to go into an isolated room and think about three things: times when she was happy, sad and scared. Through his brain-scanning technology, Coreman is able to tell in which order she thought about the three emotions. When Hector takes his turn, he thinks about Clara marrying someone else, about his time being kidnapped, and about Ying Li, but his emotions are strangely blocked. He receives a call from remorseful Clara, who tells him she wants to be a mother. Hector explains what he's learned, that the most unhappy thing he could imagine would be to lose her. Suddenly Hector's brain scan erupts with a flurry of activity, mimicking the colored flags from the monastery and revealing that true happiness isn't just one emotion; it's all of them. Having finally achieved his own happiness, Hector rushes home and marries Clara.
On 19 May 2012, Simon Pegg was cast in the title role, Hector. On 6 September 2012, Rosamund Pike and Christopher Plummer joined the cast of the film. Pike played Clara while Plummer played Professor Coreman. On 1 November 2012, Stellan Skarsgård also joined the cast, playing Edward. German actress Veronica Ferres also joined the film, playing a clairvoyant who has lost her ability to see into the future. The film began production in January 2013. On 2 April 2013, Toni Collette and Jean Reno joined the cast of the film, along with Jakob Davies. The film was made on a £9 million ($15 million) production budget.
Relativity Media acquired the US distribution rights to the film, and released the film there on 19 September 2014.
The first trailer was released on 5 February 2014. Another trailer was released on 21 June. An international trailer for the film was released on 15 July 2014. On 22 July, the final trailer for the film was released.
The film was released in the United Kingdom by Koch Film on 15 August 2014. Relativity Media released the film in the United States on 19 September 2014. It was screened in the Special Presentations section of the 2014 Toronto International Film Festival.
Hector and the Search for Happiness has been met with generally mixed to negative reviews. On Rotten Tomatoes, the film holds a rating of 36%, based on 83 reviews, with an average rating of 4.6/10. The consensus states, "Simon Pegg remains as charming as ever, but Hector and the Search for Happiness drowns his appeal in schmaltz." On Metacritic, the film holds a score of 29 out of 100, based on 28 critics, indicating "generally unfavorable reviews".