[10] Allegri started his managerial career in 2004, serving as the manager of Serie C2 team Aglianese, the club where he spent his two final years as a player.
[11] However, this practice proved to be forbidden by the Italian football laws because he was still contracted with the Tuscan club, which caused Allegri to be disqualified for three months in early 2008.
[14] Despite a disappointing start, with five losses in the first five league matches, Allegri was confirmed by club chairman Massimo Cellino and later went on to bring his team up to a mid-table placement in December.
[15] In the 2009–10 season, he managed to confirm Cagliari's high footballing levels despite the loss of regular striker Robert Acquafresca, leading an impressive number of three players from his side—namely Davide Biondini, Federico Marchetti, and Andrea Cossu—to receive Italy national team call-ups during his reign at the club.
On 13 April 2010, Cagliari surprisingly removed Allegri from his managerial duties despite a solid 12th place with 40 points, and youth coach Giorgio Melis—with Gianluca Festa as his assistant—was appointed as his replacement.
[17][18] Allegri was released from his contract by Cagliari on 17 June 2010, under request of Serie A giants AC Milan, who were interested in appointing him as their new manager.
He led Milan to their sixth Supercoppa Italiana title on 6 August 2011, by coming from behind in a 2–1 win over city rivals Inter in a game played at the Beijing National Stadium.
With the departure and retirement of several of the club's key players, Milan struggled at the beginning of the 2012–13 season, and had only collected 8 points from their first 7 games, putting Allegri in danger of getting fired early on.
[15] On 1 June 2013, club president Silvio Berlusconi confirmed Allegri to remain as the manager of Milan, despite numerous speculations that he would be given the sack.
On 31 December 2013, Allegri confirmed he would leave the club at the end of the season, telling Gazzetta dello Sport: "Of course this is my last Christmas at AC Milan".
[27] A week later, on 20 May 2015, Allegri guided Juventus to a domestic double by helping the club win their record tenth Coppa Italia, defeating Lazio 2–1 in extra time.
On 8 August 2015, Allegri led Juventus to a 2–0 victory over Lazio in the Supercoppa Italiana, with new signings Mario Mandžukić and Paulo Dybala scoring the goals.
[39] Four days later on 21 May, following a 3–0 win over Crotone, Juventus secured their sixth consecutive Serie A title, establishing an all-time record of successive triumphs in the competition.
[59] For the first time since 2013–14, Juventus placed third in the group stage, because of a better goal difference with Israeli team Maccabi Haifa, obtaining access to the UEFA Europa League.
Following the game, he was also reported to have angrily attacked the referees, threatened a journalist and waved off sporting director Cristiano Giuntoli during the post-match celebrations.
Under Allegri, Juventus became slightly less aggressive and intense in their pressing off the ball while their playing style became more patient and focused on keeping possession and gaining territorial advantage in order to conserve energy, tactics which he had previously used while at Milan.
[70][71][72][73] Goalkeeper Buffon also continued to primarily play the ball out from the back with short ground passes to the defenders, but he also began to use deeper goal kicks out to the wings.
[79] The fluidity of Juventus' formations under Allegri allowed talented players more freedom and creative licence[70][71] and enabled the midfielders to make attacking runs into the area.
[84] In his second season with the club, Allegri was praised for rebuilding the team following the departure of several key players, such as Pirlo, Vidal and Tevez; and for his role in inspiring Juventus to a comeback to defend the league title, which included a 15-match winning streak after a negative start.
[35][83][85][87] During the 2016–17 season, Allegri drew further praise in the media for his decision to occasionally depart from the team's trademark 3–5–2 formation and instead adopt a new 4–2–3–1 formation, in particular for European matches, a system which better suited the characteristics of the club's new signings—the tactical switch most notably saw Gonzalo Higuaín fielded as the team's main striker while Dybala was used in a more creative role as number 10, backed by two central box-to-box midfielders (usually the more defensive-minded Sami Khedira alongside either Miralem Pjanić or Claudio Marchisio in a deeper playmaking role) and flanked by Juan Cuadrado on the right wing.
The switch to a four-man back-line also allowed Allegri to rotate several players, such as centre-backs Giorgio Chiellini, Andrea Barzagli and Leonardo Bonucci as well as right-backs Dani Alves and Stephan Lichtsteiner, while centre-forward Mario Mandžukić was deployed in a deeper, wider role as a winger or attacking midfielder on the left flank—this new position utilised the Croatian's work-rate, intelligence, hold-up play and ability to cover for teammates making overlapping runs, in particular those of left-back Alex Sandro while Mandžukić's height and ability in the air also enabled him to function essentially as a "target man" in wider areas.
Juventus' tactical versatility was demonstrated by their ability to switch between the 3–5–2 and 4–2–3–1 formations during matches; this trait was particularly evident in the team's first leg fixture of the Champions League semi-final against Monaco.
Ahead of the match, Allegri fielded Dani Alves as a right-sided wing-back in a 3–5–2 formation in lieu of Cuadrado and reverted to the team's trademark back-three composed of Barzagli, Bonucci and Chiellini.
When in possession, Juventus kept the ball and played it out from the back and usually attacked with a 3–2–4–1, 3–4–3 or 4–2–3–1 formation as Dani Alves often made offensive overlapping runs behind the opposition's defence, essentially acting as a winger, which created difficulties for Monaco's back-line while Barzagli moved out wide to cover for the Brazilian, functioning as a makeshift right-back.
When defending behind the ball, the team reverted to an organised 3–5–2 or 5–3–2 formation, which was difficult for Monaco to break down, courtesy of the strength of Juventus' defensive trio, who were dubbed "the BBC" in the media, a reference to the defenders' initials—Juventus' defensive solidity ensured that the club only conceded three goals en route to the 2017 Champions League final and also allowed the Turin side to create goalscoring opportunities from swift, sudden and efficient counter-attacks after winning back possession.