You don’t have to serve as an Associate Justice to become the Chief Justice. The Court has one chief justice and eight associate justices.
When there is a vacancy for the chief justice position, the president usually nominates a judge (or other individual) from the outside with proven leadership skills (Warren Burger, Earl Warren as examples). Occasionally, however, a president will elevate an existing associate justice to become the chief justice (Reagan w/ Rehnquist).