How to Build a Pergola on a Deck for a Shady Oasis

Shade your deck in style with a DIY pergola

A beautiful farmhouse with an attached to the deck pergola
Photo: Iriana Shiyan / Adobe Stock
A beautiful farmhouse with an attached to the deck pergola
Photo: Iriana Shiyan / Adobe Stock
Get quotes from up to 3 pros!
Enter a zip below and get matched to top-rated pros near you.
Geo Icon

A pergola is the cherry on top of a stylish, breezy deck that’s sure to become the focal point of your outdoor space. These shade-giving structures open up a world of options for customization, plus if you’re an experienced builder, you can DIY a pergola on deck upgrade and save yourself the extra labor costs. Here’s your step-by-step guide on how to build a pergola on a deck.  

What Are the Benefits of Adding a Pergola on a Deck?

So, what does a pergola do, and why should you build one on a deck? Building a pergola on an existing deck adds fresh, modern style to your outdoor space. The rafters provide shade from the sun’s harsh rays, while the open design allows for optimal airflow, helping to keep your deck cooler.

If you want extra shade or protection from the elements, pergolas are also easy to customize. You can add additional wooden lattices to cast extra criss-cross shade, a variety of stylish covers for full-shaded protection, or a clear polycarbonate covering to shield your outdoor space from the rain and snow while still letting in the sunshine.

Prepping to Build a Pergola on a Deck

Selecting quality materials is critical when it comes to building a safe, long-lasting pergola. While there are many options for the structure, pressure-treated pine, cedar, or vinyl are the best options. 

As for the hardware, it needs to be tough to support the posts and roof. Post bases and timber bolts made of galvanized steel with a powder-coated finish are the best choices. If you don’t have those available, make sure all of your hardware is exterior-grade to resist corrosion from the elements.

How to Build a Pergola on a Deck

Once you have your plans and supplies, you’re ready to start the project. Here’s how to build a pergola on a deck.

1. Attach the Post Bases to the Deck Joists

Your pergola will need at least four support posts that are securely connected to the deck’s supportive joists. Locate your deck’s supportive joists and install the pergola post base brackets with a lag bolt (the brackets will have a hole in the middle for attaching them).

2. Pre-Drill a Hole in the Bottom of Each Post

Before lifting the supportive posts in place, pre-drill a hole in the bottom. The lag bolt on the brackets should fit in this hole, allowing the posts to sit flush with the ground.

3. Lift and Brace the Support Posts

Now, lift each support post into the brackets and use a level to ensure it’s plumb. Brace each post by nailing a small 2-by-4 board to each side of the post and an additional 2-by-4 board that pivots and reaches the deck. 

4. Install the Beams

At this point, you’re ready to install the beams, which hold up the rafters and link the posts to the house. Start by drilling at least two pilot holes all the way through the beam and post before clamping the beam to the post to complete the connection. Use galvanized carriage bolts to secure them together, then repeat on the opposite side.

5. Attach the Rafters

If desired, cut decorative edges on your rafters using a jigsaw or a sawhorse before attaching them. Now you can attach your rafters per your design (keeping them around two inches apart is usually a good rule). Screw each rafter into the beams at an angle.

6. Customize Your Pergola

Now that all the building is out of the way, it’s time for the fun part: customizing your pergola. You can paint or stain it and add roofing materials for extra protection. You can also hang cafe-style lights, attach breezy curtains around the perimeter, and bring in furniture to create your dream entertaining space. For extra fragrance and greenery, you can hang plants from the pergola’s rafters and add climbing plants for pergolas, such as wisteria, climbing hydrangea, and honeysuckle.

Safety Tips for Building a Pergola on a Deck

A luxurious deck with a gray sofa and a pergola providing shade
Photo: Photographee.eu / Adobe Stock
  • Be sure to don the proper protective gear, including work gloves and eye protection.

  • Make sure the pergola is securely mounted before taking any breaks or calling it quits for the day—even if it appears to stand on its own, it can still fall and cause major damage.

  • Do not secure the pergola to the deck boards; instead, attach the pergola’s posts to the deck’s supportive joists.

  • If in doubt about your pergola’s safety, consider bringing in a pro.

DIY vs. Hiring a Pro

Building a pergola on a deck is an advanced-level DIY that can be tricky to master without solid know-how for designing and building structures. While cost savings from DIY builds can be tempting, it’s often best to hire a local pergola contractor if you’re not totally confident. Experienced pros will know how to safely build a pergola on your current deck setup. They'll also work with you to create a pergola that looks fabulous and will last for years to come.

Frequently Asked Questions

It’s best to opt for a lightweight roof, as a heavy roof adds a lot of weight and pressure to the support posts and hardware and destabilizes the structure. Vinyl is a good, lightweight option, as is a nice open trellis, louvered aluminum or vinyl slats, or fabric panels. Clear polycarbonate is another great option that offers seamless shelter and additional UV protection without completely obscuring the sunshine. You can also choose retractable coverings or an awning that you only use in wet weather or when you need additional shade.

Pergolas and similar overhead outdoor structures will typically be subject to building code regulations. Every municipality is different, and some may have specs or permit requirements, so it’s important to double-check. Some HOAs may also have restrictions on what you can build, so be sure to check with your HOA as well (if applicable).

A concrete base—or concrete footings, more specifically—is necessary for a freestanding pergola build. A pergola is top-heavy and can’t stand on its own, so it will always need some type of base or support. If you’re attaching a pergola to a deck, the deck’s supportive joists will act as the support, so there will be no concrete base or footings necessary.

Yes, it’s definitely possible to build a pergola on an existing deck. All you need to do is attach the pergola support beams to the deck’s joists and build up from there. Beware that mistakes can damage your deck, so if you’re at all unsure of the process, play it safe and hire a pro for your custom build.

Need professional help with your project?
Get quotes from top-rated pros.
The homeowners guide to deck & porch contractors
From average costs to expert advice, get all the answers you need to get your job done.
Outdoor table and umbrella on a flagstone patio
Sep 18, 2023
Sep 18, 2023
Looking to bring some elegance into your yard with a new patio? This flagstone patio cost guide will help you start your project with confidence and a budget.
Home deck and patio with outdoor furniture and BBQ
Aug 16, 2024
Aug 16, 2024
Trex decking can offer your home a beautiful, durable outdoor oasis. Learn all about the costs of Trex decking based on space, size, and style.
modern wooden deck attached to house
Nov 30, 2023
Nov 30, 2023
The average cost of pressure-treated decking is between $4,800 and $8,000, depending on the type, size, and labor. Here’s how much PT decking could cost you.
Large home with cement deck in the yard
Oct 29, 2024
Oct 29, 2024
You may wonder, “Who can I call to remove a cement deck?” When you’re ready to refresh your outdoor space, review this guide to learn who to hire for the job.
Portico entrance on a suburban home
Dec 20, 2023
Dec 20, 2023
A portico is a small, porch-like structure that adorns and protects a home’s front entrance. Learn what makes a portico and the benefits of building one.
Woman relaxing in a chair on porch.
Sep 22, 2023
Sep 22, 2023
Old and run-down porch railings can be an eyesore and pose a risk of falling. Find out how much it costs to replace your worn out porch railings with new materials.
Share project details to get started.