How do I install a handrail for stairs?
The height is generally from the front of the tread straight up to the top of the handrail.  

To get the brackets at the right height, you'll need to do some measuring and marking.

Measure the bracket top to bottom (if its height isn't already stated in the literature).  You can allow for the thickness of the handrail by resting it on the stairs and measuring how high its top is above the front of the tread.  Subtract those two numbers from the height you want the railing to be at to get the height for the bottom of the bracket if it were installed directly above the front of the tread.

Mark that height at the top and bottom steps and draw a line through them (if you can get a helper or two, you should have a nice straight piece of wood of just about the right length to hand; otherwise a straight-edge, the longer the better so that the line is in as few segments as possible).  Your stair may not be perfectly even and regular, so you may want to measure the height above each tread and adjust the line accordingly if some of the measurements are out of the allowed range.

Finally, take your stud finder, locate the studs and install as many brackets as you need.  The bottom of the bracket should be touching the line you've just drawn.