We determine product presentations for the nilpotent Lie rings with order p7 where p⩾7 is prime, and then use the Baker–Campbell–Hausdorff formula to construct power-commutator presentations for the corresponding groups. The number of such groups is a polynomial depending on p whose leading term is 3p5. We complete the determination of groups with order p7 for p=3,5 using the p-group generation algorithm. We provide access to the resulting presentations for the groups via a database distributed with computer algebra systems.