Mark the desired area for the deck cover with a marker in the four corners. If you wish to cover the entire deck, place a mark in each corner of the deck.
Place two U-form post bases centered on each corner marker. Arrange the post bases perpendicular to create a base with four sides and screw the bases into the deck floor.
Slide a 4-by-4-inch post into each of the U-form bases and secure with screws; U-form bases generally have two or three holes on each side through which you fit screws to anchor the posts to the deck. Check with a level to ensure the posts are plumb.
Nail a horizontal support beam into place to connect the two posts on each end of the deck. This is a temporary beam, such as a 2-by-4-inch board, to steady the posts until permanent beams are in place.
Drill a hole straight through the top of each post and through each end of four 2-by-4-inch horizontal support beams; the span of the horizontal support beams should be about 1-foot longer than the distance between two posts. After drilling the holes through the tops of the posts, you can remove the temporary support beam.
Hold the horizontal beams in place on the outside of the posts while a second person pounds carriage bolts through all three pieces. Secure the bolts on the outside of the back support beam with nuts and washers. When finished, you should have two parallel structures at opposite ends of the deck, each comprised of two posts and two horizontal beams.
Chamfer each end of the 2-by-4 cross beams with a miter saw before setting in place on top of the structure. Pergolas are often capped with beams that have right-angle cuts on both ends, but this is an optional aesthetic feature.
Place the cross beams on top of the support structures so that they stretch across the deck, running perpendicular with the horizontal support beams. Measure carefully to ensure that all cross beams are spaced evenly apart.
Anchor the cross beams with hurricane brackets, a type of metal bracket that screws into the cross beam and the support beam below.
Weave strips of outdoor fabric over and under the cross beams, if desired, to provide additional shade to the deck. Use this as a temporary solution for a single afternoon or staple the fabric to the beams to create permanent shade.