How to Install Deck Railing

Overview

Deck railing serves both safety and aesthetic purposes. Building codes require railing on any deck more than 30 inches above grade. The railing must be at least 36 inches tall (42 in some jurisdictions), must withstand 200 pounds of lateral force at the top, and balusters must be spaced so a 4-inch sphere cannot pass through. Installing railing typically takes a full day for a 12x16 deck.

Tools & Materials

Step-by-Step

  1. Check the local code height requirement. Most areas require a minimum 36-inch railing height measured from the deck surface to the top of the handrail. Some jurisdictions require 42 inches. Confirm before cutting posts—adjusting height after installation means replacing posts.
  2. Cut posts to length. Posts attach inside the rim joist and extend above the deck surface by the railing height. Cut post bottoms square. Pre-drill two 1/2-inch holes through each post where it will be bolted to the rim joist.
  3. Mount corner posts first. Clamp the post to the inside face of the rim joist at each corner. Use a post level to ensure it is plumb in both directions. Drill through the rim joist using the pre-drilled post holes as a guide. Insert 1/2-inch galvanized through-bolts with washers on both sides and tighten fully.
  4. Install intermediate posts. Space remaining posts evenly along the railing run, with a maximum spacing of 6 feet on center. Clamp, plumb, and bolt each post. The posts are the structural core of the railing—every one must be rock-solid before rails go on.
  5. Attach the top rail. Measure and cut 2x4 or 2x6 top rails to fit between posts. Use angled cuts where rail ends at a post at a corner. Fasten with angled structural screws through the rail into the post—two screws per joint in a toe-screw pattern. The top rail should overhang the post by about 1 inch for a visual reveal.
  6. Attach the bottom rail. Position the bottom rail 2—3 inches above the deck surface. Level it and screw into posts the same way. The bottom rail supports the balusters and prevents lateral movement.
  7. Install balusters. Cut a spacer block to the maximum baluster spacing (typically 4 inches). Place balusters between the top and bottom rail. Working left to right, set a baluster, place the spacer, set the next baluster. Fasten each baluster with two screws angled through the top and two through the bottom into the rails. The spacer ensures consistent, code-compliant spacing.
  8. Install post caps and cap rail. Trim the tops of posts flush with the top rail if they protrude. Install a post cap on each post—these shed water and protect the end grain. If desired, install a continuous cap rail centered over the top rail for additional visual weight.
  9. Test for structural stability. Push hard on the top rail between posts. It should not deflect. If it feels springy, add blocking or knee bracing. Code requires the railing to resist 200 pounds of force—a solid post should feel like a post set in concrete.

Tips

Tip 1: Never notch 4x4 railing posts. Notched posts concentrate stress and split, especially in pressure-treated lumber that is already cracking.
Tip 2: Pre-painted aluminum or composite balusters ($4—$8 each) are maintenance-free and come in pre-assembled sections that snap between rails—a huge time saver.
Tip 3: A baluster spacing jig (a 4-inch block with a lip) is faster and more precise than measuring each baluster individually. Make one from scrap wood.
Tip 4: For deck corners that meet at 45 degrees, angle-cut the top and bottom rails so they join cleanly at the corner post. This requires accurate miter saw angles—cut test pieces first.
Tip 5: Cap the top rail with a drip-edge metal flashing or a wide cap board that extends 1 inch past the rail on both sides—this directs water away from the balusters and prevents rot at the connection points.