Amblin Partners and New Republic Pictures were announced to have acquired the project in June 2018, with Sam Mendes directing, and co-writing the screenplay alongside Krysty Wilson-Cairns. Tom Holland was reported to be in talks for the film in September 2018, though ultimately was not involved, and in October, Roger Deakins was set to reunite with Mendes as cinematographer. George MacKay and Dean-Charles Chapman entered negotiations to star the same month. Thomas Newman was hired to compose the score in March 2019. The same month, Benedict Cumberbatch, Colin Firth, Mark Strong, Richard Madden, Andrew Scott, Daniel Mays, Adrian Scarborough, Jamie Parker, Nabhaan Rizwan, and Claire Duburcq joined the cast in supporting roles.
In August 2019, Mendes stated, "It's the story of a messenger who has a message to carry. And that's all I can say. It lodged with me as a child, this story or this fragment and obviously I've enlarged it significantly. But it has that at its core." In Time in 2020, Mendes stated that the writing involved some risk-taking: "I took a calculated gamble, and I'm pleased I did because of the energy you get just from driving forward (in the narrative), in a war that was fundamentally about paralysis and stasis." The ideas for a script, which Mendes wrote with Krysty Wilson-Cairns, came from the story that Mendes's grandfather, Alfred Mendes, a native of Trinidad who was a messenger for the British on the Western Front, had told him. Mendes stated: "I felt an obligation to honour my grandfather. It's important to remember they were fighting for a free and unified Europe. Good to be reminded of that now."
Roger Deakins was the cinematographer for the film, reuniting with Mendes for their fourth collaboration, having first worked together on Jarhead in 2005. Filming was accomplished with long takes and elaborately choreographed moving camera shots to give the effect of two continuous takes. Although media accounts often refer to the story as being told in only one shot, the story cuts to black one hour and six minutes into the film, when Schofield is knocked unconscious, and fades in upon his regaining consciousness after night has fallen. Mendes explained, "it was to do with the fact that I wanted the movie to go from afternoon to dusk, and then from night into dawn. I wanted it to be in two movements...I wanted to take it somewhere more like a hallucination. Somewhere more surreal, almost dream-like. And horrifying too".
1917 was the first film to be shot with the Arri Alexa Mini LF digital cinema camera. Deakins wanted to use a camera with a large format image sensor, but thought that the original Alexa LF was too large and heavy to capture the intimate shots he wanted. Arri provided him with a prototype of the Mini LF two months before filming was set to begin, and two more cameras a week before. His lenses were Arri Signature Primes, of which he used three focal lengths: a 40 mm lens for most of the film, a wider 35 mm for scenes in the tunnels and bunkers, to emphasise feelings of claustrophobia, and a narrower 47 mm in the river, to lose some of the background.
Filming began on 1 April 2019 and continued through June 2019 in Wiltshire, Hankley Common in Surrey and Govan, as well as at Shepperton Studios. Concern was raised about filming on Salisbury Plain by conservationists who felt the production could disturb potentially undiscovered remains, requesting a survey before any set construction began. Some shots required the use of as many as 500 background extras.
Sections of the film were also shot near Low Force, on the River Tees, Teesdale in June 2019. The production staff had to install signs warning walkers in the area not to be alarmed at the artificial bodies and body parts strewn around the site. The scenes on the river were mostly shot with a drone and the cast and crew were assisted by a local outdoor adventure provider for safety and stunts.