Measure the height of the deck from the ground with a tape measure and add nine feet to this measurement. Cut four pieces of 2-by-4's to this length using a circular saw. Measure the length and width of the deck. Cut two pieces of 2-by-4's to the deck width and two pieces of 2-by-4 to the deck length.
Measure and draw a 1-by-1 inch square on the ends of each 2-inch wide face of the deck length and deck width 2-by-4 pieces using a pencil and ruler. Cut these squares out of the 2-by-4 pieces to leave a 1-by-1-by-4 inch notch in both ends of each piece. Connect the length and width pieces together by the notches to form a rectangle.
Countersink two 3-inch long screws through each corner of the rectangle using a hammer drill and screwdriver drill bit. Cut three sheets of 1/2-inch thick plywood to a length equal to one-third of the length of the deck and a width equal to the width of the deck. Screw the three sheets to the top of the rectangle using countersunk 3/4-inch long screws to form the deck roof.
Varnish the deck roof and the four remaining 2-by-4 pieces using exterior grade varnish. Allow the varnish time to dry while you dig a 1-foot deep hole at each corner of the deck. Mix a batch of concrete from one part cement, three parts sand and one part water. Plant a 2-by-4 piece in each hole. Fill the holes to ground level with concrete.
Wait 48 hours for the concrete to set. Set up two step ladders on the deck, one by a post at the front of the deck and one by a post at the rear of the deck. Lift the deck roof onto the top of the four 2-by-4 posts with the help of an assistant. Screw the deck roof onto to the four posts using 6-inch wide L-brackets.