The actor, who played Walford's Ryan Malloy, is taking over the role of Lord Farquaad in the production at London's Theatre Royal.
McDermott will appear in the part from February 2012, succeeding current Farquaad actor Nigel Harman.
Meanwhile, West End actor Dean Chisnall is taking over from Nigel Lindsay in the lead role of Shrek.
Shrek: The Musical has been running in the West End since May. Girls Aloud star Kimberley Walsh is currently appearing as Princess Fiona in the show.
McDermott bowed out from EastEnders earlier this year after two years in the role of Ryan.
> Kimberley Walsh: 'Shrek musical more nerve-wracking than Girls Aloud'
> Read all the latest EastEnders news and spoilers
Watch Ryan's EastEnders character trail below: