Miller wrote All My Sons after his first play The Man Who Had All the Luck failed on Broadway, lasting only four performances. Miller wrote All My Sons as a final attempt at writing a commercially successful play; he vowed to "find some other line of work" if the play did not find an audience.
All My Sons is based upon a true story, which Arthur Miller's then-mother-in-law pointed out in an Ohio newspaper. The news story described how in 1941–43 the Wright Aeronautical Corporation based in Ohio had conspired with army inspection officers to approve defective aircraft engines destined for military use. The story of defective engines had reached investigators working for Sen. Harry Truman's congressional investigative board after several Wright aircraft assembly workers informed on the company; they would later testify under oath before Congress. In 1944, three Army Air Force officers, Lt. Col. Frank C. Greulich, Major Walter A. Ryan, and Major William Bruckmann were relieved of duty and later convicted of neglect of duty.
Henrik Ibsen's influence on Miller is evidenced from the Ibsen play The Wild Duck, where Miller took the idea of two partners in a business where one is forced to take moral and legal responsibility for the other. This is mirrored in All My Sons. He also borrowed the idea of a character's idealism being the source of a problem.
The criticism of the American Dream, which lies at the heart of All My Sons, was one reason why Arthur Miller was called to appear before the House Un-American Activities Committee during the 1950s, when America was gripped by anti-communist sentiment. Miller sent a copy of the play to Elia Kazan who directed the original stage version of All My Sons. Kazan was a former member of the Communist Party who shared Miller's left-wing views. However, their relationship was destroyed when Kazan gave names of suspected Communists to the House Un-American Activities Committee during the Red Scare.