Locke takes over at the League Two club just over a month after he was sacked by Raith Rovers following a dismal run of form which saw the Kirkcaldy side fail to win in any of his final 14 matches.
The former Hearts manager inherits the job from Liam Fox. The former Jambos youth coach resigned earlier this week after a run of seven successive defeats. The poor form has left them seven points from safety at the foot of the table.
Locke will be reunited with ex-Hearts players Fraser Mullen and Dale Carrick, both of whom played under the manager when he was at Tynecastle.
Ex-Jambos striker Gary Glen is also a member of the squad, while current Hearts youth talent Robbie Buchanan is on loan at Central Park for the remainder of the season.
Locke will be aiming to stop Cowdenbeath from being relegated for the third successive season.