How to Build a Pergola: DIY Backyard Shade Structure
A pergola adds architectural interest to your yard and provides filtered shade over a patio, deck, or garden path. Unlike a solid roof structure, a pergola uses open rafters and an optional lattice top — giving you shade without blocking airflow or light entirely. Building one is a satisfying weekend project that dramatically changes how your outdoor space looks and feels.
How to Build a Pergola
Design and Sizing
A freestanding pergola typically has four posts, two beams, and a series of rafters running across the top. The most common residential size is 10 by 12 feet — large enough to cover a dining table and chairs.
Height matters. The bottom of the beams should be at least 8 feet above the ground, and 9 feet is more comfortable. Remember that the rafters add another 6 to 8 inches above the beams.
Check local building codes. Many areas allow pergolas under a certain size without a permit, but setback requirements from property lines still apply.
Materials
For a 10x12-foot freestanding pergola:
- Posts: 4 pieces of 6x6, 10 feet long (buried or post-mounted)
- Beams: 2 pieces of 2x10, 14 feet long (with 12-inch overhang each side)
- Rafters: 8 pieces of 2x8, 12 feet long (with overhang)
- Top slats (optional): 2x2 lumber spaced across the rafters for extra shade
- Post bases: Concrete footings or adjustable post bases on existing concrete
- Hardware: 1/2-inch carriage bolts, structural screws, hurricane ties
Use pressure-treated lumber for posts and any wood in ground contact. Cedar or Douglas fir works well for beams and rafters if you plan to stain or seal them.
Setting the Posts
The posts carry the entire structure, so the footings must be solid.
Option 1: Buried posts. Dig holes 12 inches in diameter and below your local frost line (typically 24 to 48 inches deep). Set the posts in the holes, brace them plumb with temporary 2x4 supports, and fill with concrete. Let the concrete cure 48 hours before loading the posts. Use a level on two adjacent faces of each post.
Option 2: Surface-mount post bases. If building on an existing concrete patio or footing, use adjustable post base hardware anchored with concrete wedge bolts. This keeps the wood off the concrete and allows water to drain.
Space the posts accurately. Measure diagonals to confirm the layout is square before setting anything permanent.
Installing the Beams
Beams run along the long sides of the pergola, connecting each pair of posts. For this 10x12 design, the beams span the 10-foot sides.
You can notch the post tops to cradle the beams (stronger and cleaner looking) or bolt the beams to the sides of the posts (easier).
Notch method: Cut a notch in the top of each post that is the width and depth of the beam (1.5 by 9.25 inches for a 2x10). A circular saw set to the correct depth makes the shoulder cuts, and a chisel cleans up the waste. Set the beam in the notch and drill through for a 1/2-inch carriage bolt.
Side-mount method: Hold the beam against the side of the post at the desired height. Drill through both pieces and bolt with two 1/2-inch carriage bolts per connection.
Either way, the beams should be perfectly level. Check with a long level or a line level on a string.
Attaching the Rafters
Rafters run across the short dimension (12 feet in this design), resting on top of the beams. Space them evenly — 16 to 24 inches on center looks balanced.
Mark the rafter positions on both beams. Set each rafter in place with equal overhang on both sides. Toe-screw through the rafter into the beam with structural screws, or use hurricane ties for a stronger, hidden connection.
Decorative rafter tails add character. You can cut the ends in a curve, an angle, or a notch. Make a template from cardboard, trace it on each rafter, and cut with a jigsaw before installation.
Adding Top Slats
For more shade, add 2x2 slats across the top of the rafters, perpendicular to them. Space the slats 3 to 6 inches apart — closer spacing provides more shade.
Screw the slats to each rafter with a single screw per crossing. Pre-drill to prevent splitting the narrow stock.
Finishing
Sand any rough spots and apply two coats of exterior stain or sealant. A penetrating oil finish is easier to maintain than a film-forming finish because it does not peel — it simply fades and gets recoated.
Pay extra attention to end grain, which absorbs more water. Apply extra finish to all cut ends and the tops of posts.
Optional Additions
- Climbing plants: Train wisteria, grape vines, or climbing roses along the posts and across the rafters for natural shade.
- Shade fabric: Retractable shade cloth or curtains slide along the rafters for adjustable coverage.
- String lights: Drape them along the rafters for evening ambiance.
- Fan: A damp-rated ceiling fan mounted between rafters keeps air moving on still days.
A pergola makes your yard feel like a room. It defines the space, provides relief from direct sun, and gives you a structure to hang lights, fans, and plants from. It is one of the highest-impact outdoor projects you can build.