Project Shopping List
Deck railing is both a safety requirement and a major visual element of any deck. Building code mandates railing on decks 30 inches or more above grade, with specific requirements for post spacing, baluster spacing, and rail height. Getting these right prevents a failed inspection and ensures the railing is actually safe to lean against.
What You Need
- 4×4 pressure-treated posts (railing posts)
- 2×4 pressure-treated lumber (top and bottom rails)
- Balusters (wood, composite, or aluminum)
- Post base hardware or through-bolts
- Drill and impact driver
- Circular saw and miter saw
- Level and spacer jig for balusters
Code Requirements (Check Local Codes)
Standard residential requirements: minimum rail height 36 inches (42 inches for decks over 30 inches above grade in many jurisdictions); maximum baluster spacing 4 inches (a 4-inch sphere must not pass through); minimum post spacing 6 feet on center maximum; posts must withstand 200 lbs of lateral force. These are minimums — your local jurisdiction may be more stringent.
Step-by-Step Instructions
Step 1: Mark and Install Post Locations
Posts go at corners, at gate openings, and at maximum 6-foot intervals between. Mark post locations on the rim joist or deck framing. The strongest post installation bolts through the outside face of the rim joist and the inside face of the post with two 1/2-inch galvanized carriage bolts — this is a through-bolt connection. Surface-mount post bases are an alternative but are weaker and must be rated for the required lateral load.
Step 2: Set Posts and Check Plumb
Cut posts to finished height above the deck surface (typically 36 or 42 inches plus the depth of the top rail). Secure each post plumb in both directions. Check that all posts are the same height using a level and string line — any variation will be visible in the finished rail. Add blocking between posts and rim joist at each post location to reinforce the connection if through-bolting into rim joist alone.
Step 3: Install Top and Bottom Rails
Cut top rails to fit between posts (or over the top of posts for a different profile). Install top rail with two screws or nails into each post. Install bottom rail 3-4 inches above the deck surface — this clearance prevents water accumulation and rot at the rail base. The bottom rail must be close enough to the deck surface that the 4-inch baluster spacing requirement extends down to the deck surface or the rail provides a continuous barrier at that level.
Step 4: Calculate and Install Balusters
Calculate baluster spacing to ensure no gap exceeds 4 inches. Divide the available space between posts by (baluster width + gap width) to find the number of balusters. Space them equally. A spacing jig cut from scrap at your calculated spacing makes installing 20+ balusters much faster and more accurate than measuring each one. Drive two screws per baluster into top and bottom rails — pre-drill near ends to prevent splitting wood balusters.
Step 5: Install Cap Rail
The cap rail runs along the top of the posts and top rail assembly and provides the finished grip surface. Cap rails are typically 2×6 or 2×4 lumber, composite cap rail, or a purpose-made aluminum rail profile. Miter corners at 45 degrees and fasten with exterior screws from below where possible to avoid visible fasteners on the top surface. A well-fitted cap rail makes the entire railing look finished and professional.
Pro Tips
- Aluminum balusters are significantly more durable than wood — they do not rot, split, or require painting, and cost only slightly more.
- Through-bolt posts with two 1/2-inch bolts staggered vertically rather than side by side — staggered bolts resist rotation better and are less likely to split the post.
- Test each post after installation by pushing laterally with 200 lbs of force (lean your full weight sideways against it). A post that flexes noticeably needs better anchoring before balusters are installed.
Frequently Asked Questions
Can I attach railing posts to deck boards instead of the frame?
No. Railing posts must be attached to the structural framing of the deck — the rim joists or beams — not to the decking surface. Posts attached only to decking boards will pull out under lateral load and fail catastrophically. This is a common DIY mistake that fails inspection and creates a serious safety hazard.
What rail height is required?
The IRC requires 36 inches for decks up to 30 inches above grade, and many jurisdictions require 42 inches for decks higher than 30 inches. Some states and local codes have higher requirements. Always check your local building code for the specific requirement — the inspector measures this.