Bastoni progressed through various age groups at Bergamo, including making nearly 30 appearances for the under-17 side, before eventually progressing to the Primavera side, where he established himself as a regular starter at the centre of defence. He was named on the first-team bench for the first time on 30 October 2016, for the game against Genoa, and made his full debut a month later in the Coppa Italia game against Pescara, playing the full game in a 3–0 victory. In Serie A, Bastoni remained as an unused substitute for the six games after Genoa until making his debut in a 1–0 win over Sampdoria on 22 January 2017, playing full 90 minutes.