The actor will head to Worthy Farm for the annual three-day music event when it returns over the weekend of June 27-29.
Elba has carved out a career as a DJ in recent years, having played Ibiza last summer and confirming that he will head back to the destination later this year.
Announcing his Glastonbury appearance during a talk with Spotify at Ad Week, Elba also revealed that he is focusing on producing 'character albums'.
The concept recently saw him compile songs into a collection titled Mi Mandela, following his portrayal of the late African leader in Mandela: Long Walk to Freedom.
Elba explained that after living inside the head of a character for his acting career, he then produces music in the spirit of that role.
The star revealed that he may make 'character albums' for some of his past characters, including John Luther.
What's more, he added that he has discussed with Robert de Niro the possibility of creating an album for Vito Corlene from the Godfather trilogy.
Arcade Fire, Dolly Parton, Lily Allen, Disclosure, Lana Del Rey and Blondie are among the other acts so far confirmed for this year's Glastonbury.