Set a level base and plumb closet uprights

Establish one installation datum so shelves and doors remain aligned across the entire run.

Map support points

Mark floor readings under each proposed upright rather than just at the ends. Set a common level bearing plane based on the high point and the planned support system. Use a base or properly supported shims compatible with the loads and your design.

Align in two directions

With the parts safely supported, check every upright for plumb left to right and front to back. Use a straightedge or string line across the faces. A partition can stand vertical while sitting forward of its neighbors, which moves both shelf pin rows and door hardware.

Check again after fastening

Record clear bay widths at front and back before and after attachment. Fastening over an unsupported wall gap can pull a panel out of line. Resolve the bearing or packing detail and recheck the diagonals before sizing trapped parts.