Producer Samuel Goldwyn, Jr., whose father produced the 1947 film adaptation, conceived the idea of doing a remake in 1994 with Jim Carrey in mind for the title role. Walt Disney Pictures was enthusiastic to purchase the remake rights, but Goldwyn instead chose New Line Cinema, which held a positive working relationship with Carrey on Dumb and Dumber and The Mask (both 1994). The studio bought the rights in 1995 with the understanding that The Samuel Goldwyn Company would be involved in creative decisions. Babaloo Mandel and Lowell Ganz turned in the first draft of the screenplay in July 1997. Ron Howard entered negotiations to direct the same month, and to cover producing duties with Brian Grazer and Imagine Entertainment. Howard and Imagine Entertainment eventually left the project in favor of EDtv, and The Secret Life of Walter Mitty languished in development hell over the challenges of using a contemporary storyline.
In May 1999, New Line hired The Mask director Chuck Russell to rewrite the script and serve as Howard's replacement. Filming was set to begin in early 2000, but was pushed back. Around this time, Peter Tolan worked on rewrites. In May 2001, Goldwyn filed a lawsuit against New Line for breach of contract. Goldwyn claimed that the studio extended their 1995 deal until May 2001, but then announced that it wanted to transfer the rights for the remake to another company and have Goldwyn surrender his creative input. In November 2002, New Line was forced to revert the film rights back to Goldwyn, who won his lawsuit and took the property to Paramount Pictures. During pre-production discussions between Paramount and DreamWorks on Lemony Snicket's A Series of Unfortunate Events (which starred Carrey), Steven Spielberg, head of DreamWorks, rekindled interest in working with Carrey; the duo previously considered Meet the Parents, but the outing fell apart. In May 2003, Spielberg agreed to direct, and brought in DreamWorks to co-finance The Secret Life of Walter Mitty with Paramount (which would acquire DreamWorks in 2006).
By November, Zach Helm was rewriting the script, but Spielberg and DreamWorks vacated the film in April 2004 in favor of War of the Worlds and Munich. "The goal is to go back to the short story and capture not only the content but the original spirit," producer John Goldwyn (son of Samuel) told The Hollywood Reporter. Screenwriter Richard LaGravenese entered discussion to write a new script following Spielberg's departure. Sam Goldwyn commented that LaGravenese's script had a momentous and unique approach compared to others. "I'd always felt that unless we got a great script, the movie disintegrates into a series of wonderful gags," Goldwyn explained. "Writers always fixated on that. [Richard] worked for 10 months on umpteen drafts, and he solved it." In March 2005, Paramount hired Mark Waters to direct LaGravenese's script for Walter Mitty, but Carrey had to drop out due to scheduling conflicts. He was soon replaced by Owen Wilson.
Despite not having a final budget, Paramount scheduled a December 12, 2005 start date because their option on the remake rights was to end one week later; they would lose the rights if they did not start filming before December 20. Wilson dropped out in October 2005 over creative differences. The Hollywood Reporter also speculated that Walter Mitty began to falter after Paramount failed to cast a female lead to star opposite Wilson. Scarlett Johansson had reportedly emerged as the front-runner after screen testing with Wilson earlier in October, but a deal was never signed with the actress. Paramount executives Brad Grey and Gail Berman decided to put Walter Mitty in turnaround in November 2005. Goldwyn found favor at 20th Century Fox and, in May 2007, it was announced that Mike Myers was attached to star in the title role. Jay Kogen was hired to write a new script that would be specifically tailored for Myers.
In April 2010, Sacha Baron Cohen was offered and accepted the lead role. Later that month, The Pursuit of Happyness writer Steven Conrad was hired to pen the screenplay, with Gore Verbinski announced as director in June 2010.
In April 2011, it was announced that Ben Stiller had been cast in the lead role, though no director was attached. The following July, it was announced that Stiller was also due to direct the film.
In January 2012, it was announced that Kristen Wiig would play the female lead, with Shirley MacLaine attached to play the mother of Ben Stiller's character. This was followed by reports in February that Patton Oswalt and Adam Scott joined the film. In April 2012, Kathryn Hahn was cast as Odessa, Walter's sister, and Josh Charles was cast as the ex-husband of Kristen Wiig's character, though he was replaced by Kai Lennox. Later that month, Sean Penn was cast in what was described as a "small but pivotal supporting role" as photojournalist Sean O'Connell.
The portions of the film set in Nuuk, Greenland, were in fact shot in Stykkishólmur, a village on the Snæfellsnes peninsula in Iceland, and Höfn, a village in southeast Iceland. Later sequences set in Stykkishólmur were actually filmed in Seyðisfjörður. The sequences where Walter Mitty follows Sean to Afghanistan were also filmed in Iceland, at the Skogafoss waterfall and in Vatnajökull National Park.
During the skateboarding scene in Central Park, pro skater Rodney Mullen served as Ben Stiller's stunt double.