Check the local building codes for height requirements of a handrail. Measure and mark the wall at the bottom and top of the stairs. Connect the marks with a chalk line (Image 1). Locate wall studs with a stud finder and mark them along the chalk line. Use a level to mark the bracket locations to make sure that they are plumb (Image 2).
Have a friend help hold the railing in position at the correct height along the chalk line, then position the bracket on the wall. Use an awl to punch holes through the mounting holes of the brackets. Drill pilot holes and mount brackets on wall. Clamp the long rail to the brackets and use a level to position the shorter piece.
Use a combination square to mark the angles for the cuts on both rails (Image 1). Make a paper template of the angles needed to join two lengths of railing together and mark the ends of the rails. Cut both pieces at the same time with a handsaw to assure a match (Image 2). Cut the upper and lower ends of the rail using a miter box to get a 45-degree angle. Measure and cut the return pieces, or pieces of railing that return to the wall so items will not catch on the ends of the rail.
Spread glue on the ends of the rail and the returns. Attach returns and secure with L-brackets and screws (Image 1). Attach rail to brackets and secure with screws. Spread glue on the top end of the rail and the short rail and attach short rail to wall brackets. Use tape to secure the joint while the glue dries (Image 2). Reinforce the joint with a metal plate underneath the railing.