You asked

What aperture should I set for a group portrait with people at different distances?

For a group with people at different distances, the guide suggests stopping down to about f/2.8. At f/1.4 and wider, the depth of field can be thinner than a face, so if one person is sharp, someone a little nearer or further will be soft. The Portraits page also notes that moving the group away from a wall often does more for background blur than a faster lens.

Aperture is only half of it. The guide's lens pick for groups is a 35mm f/1.8 or f/1.4, since it shows where people are and fits more of them in frame without you stepping back too far. An 85mm is better for single faces, but you'd need to stand well back to fit a group in it, and at that distance the people at the edges can end up sharper or softer than you'd like. A standard 50mm on full frame is a reasonable middle ground if you already own one. Check the lens picks for the details.

Start at f/2.8, take a test frame, and check the sharpness of the nearest and furthest faces on your screen before you shoot the rest.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.