Hi Harris,
the ‘old way’, would be to use a Curve Deform Modifier:

But as you can see, that also deforms the Cubes (which might be a problem in some/many cases). There are ways to get around that, but they are pretty involved and nowadays, it is much easier to do with Geometry Nodes:

With a few more Nodes, you can also make the Cubes’ Orientation follow the Curve (without having them deformed).