McGhee, who's reign at The Den was ended by mutual contract just over a fornight ago, takes over from Steve Coppell on a two-year contract.
McGhee won the Second Division title with The Lions in 2001 and will be looking for a quick return to the First Division with his new club, who are currently challenging for one of the two automatic promotion places.
Caretaker manager Bob Booker will retain his job as assistant manager and McGhee will also work with the rest of the backroom team that served under Coppell.
Millwall, meanwhile, are no nearer to naming McGhee's successor at The Den. Dennis Wise is still favourite for the position, despite previously stating that he wants to keep playing for at least two more seasons.