How to constrain rigid bodies to an axis?
In blender 2.80 (and likely earlier versions), you can selectively lock translation and rotation axes, limiting physics simulations to your choosing.

Do this in the Transform sidebar (hit N to toggle).



As seen above, both X and Y axis has been locked, forcing simulation to only translate along Z-axis, but otherwise rotate freely.

This can be handy for quickly placing objects using physics. For example: