The old fashioned way to install handrail to a staircase or decking is to cut tenons on each end of it and corresponding mortices in the newel posts, then use dowels to draw the joint in tight. When working with hardwood like Oak or Walnut I still do that, but there are special handrail bolts available with a bolt and nut you can use instead, that are just as effective. However, because of advances in glue strengths, fixings and time constraints when working on site it is possible to just cut softwood handrails to length and glue/screw them to the newel posts. As long as you put some thought into where the screws go and use Screwdiggers and matching pellet cutters to fill the screw holes with then the fixings won't look out of place - even if the stairs or decking are being stained/varnished. I never screw straight through the top of a handrail or anywhere it will be clearly visible even if the stairs are being painted!
Unless the stairs are cut string and the spindles sit on the treads, you will need to fix a base rail on the string or landing for the spindles to fit into. In the majority of cases the base rail and handrail will be identical, so getting the base rail right is good practice before starting to cut the handrail, and you can then even use the base rail as a pattern to mark the handrail length.
To cut this to length, put a bevel where the string meets the post to find the plumb cut angle. Cut this angle onto the bottom of a length of base rail. Put the bottom on the string where it needs to be, hold the top in line and mark the end where it meets the post to cut off. I usually cut the top of the base rail to length but leave the pencil line in a little, as you can always trim a little more off if it's too long. Once fitted, centre it with the newel post then glue and screw to the stair string with 40-50mm screws (1 5/8- 2") and PVA glue
Take a spirit level and check that the newel posts are level. If they are leaning away from each other slightly (they're not always perfectly upright) then the handrail will need to be slightly longer than the base rail.
Once marked, cut the handrail to length (leave it a few millimetres too long).
I always cut two spindles to length to rest the handrail on so it is exactly the same height at both ends. First, I mark a line on the bottom post 900mm up from the pitch line. I use an off cut from the handrail that's just been cut to length like in the picture below. Hold the off cut up to the 900mm line and mark the underside of the groove, where the top of the spindle will touch.
This will give the length of each spindle from the base rail below. Cut the plumb cut angle onto a spindle, place it firmly into the base rail tight up against the post and transfer the length mark onto it. Cut this, and one other spindle exactly the same.
Place one spindle up against the post at the top pushed down tight into the base rail groove and clamp it to the post. Do the same at the bottom, keeping the clamps out of the way of the handrail.
Now you can use these to rest the handrail on while you check the angles and length are cut perfectly. This is another reason I leave the line in (transferred from the base rail) when cutting to length before, It gives me a chance to fine tune at this stage. Often when I install handrail in old houses I've worked in, the newel post can be slightly twisted meaning you need to cut it slightly out of square. Other times if the post isn't perfectly level, or is slightly twisted you need to adjust the angle slightly one way or another. More often than not when I install handrail it's in a hardwood like Oak or Mahogany and isn't cheap to replace if I cut it too short.
Below is a handrail that doesn't quite fit perfectly. All I do in this instance is run a pencil along the post to mark a parallel line on the hand rail and cut to this line for it to fit (you can see the pencil line I've marked).
When I install hand rail I fix the top differently to the bottom. When it fits perfectly, glue both ends of the hand rail with wood glue. Replace onto the spindles and I pin the bottom to the post with a Dewalt finish nail gun to hold it in place. Remove the spindle at the bottom and then screw the handrail to the post through the groove that will later be covered, like in the left hand picture.
To fix the top of the hand rail I use Screwdiggers and matching pellet cutters. I drill a hole with the Screwdigger and fix with a 100-120mm wood screw. You can pin the top in place before you screw it with a nail gun to hold it in place too. As always, pin in the least conspicuous place possible.
Have a question or comment about how to install handrail?