The Chronicle star will feature alongside members of the band in their upcoming film.
He will play a member of Metallica's crew who "is sent out on an urgent mission while the band is playing a rousing live set in front of a sold-out crowd and unexpectedly finds his world turned completely upside down", according to the filmmakers.
The Nimród Antal-directed project will be the first release from the newly-revived film marketing and distribution company Picturehouse.
"Nim and the band have made a film that really captures the spirit of Metallica and their millions of loyal fans," said Picturehouse CEO Bob Berney.
"It's an entertaining genre film with a concert inside it, a fun ride featuring an exciting young actor, Dane DeHaan. It's a very cool project to reboot Picturehouse with."
DeHaan was recently cast as Harry Osborn in The Amazing Spider-Man 2 and will also feature in indie film Kill Your Darlings.
Metallica: Through the Never will open on August 9.
Watch Dane DeHaan in the Chronicle trailer below: