Install 4-by-4-inch or 6-by-6-inch posts to support a roof, depending on the size and type of patio and whether the roof will be full or partial. Put a pole at each corner of the roof area and between corners at 8-foot intervals for a larger roof. Dig holes with a posthole digger just outside the edge of the patio or fasten them to a concrete patio with metal brackets with post supports anchored with concrete screws.
Set outside poles in concrete. Secure poles to metal brackets with galvanized screws and a screw gun. Use a level to make sure all poles are plumb. Make poles on one side of the roof higher; allow a slope of at least 2 inches per foot, away from the house so water will not drain toward the house. Install 45-degree angle braces at the top of each pole, the same dimension as the pole. Cut these with a circular saw and fasten them with screws.
Build a frame of 2-by-4 or 2-by-6-inch boards around the outside of the poles. Put framing the full width of the roof plus 3 inches on the two ends of the slope. Use a circular saw to cut angles on the ends of the side bands so they are flush against the outer bands. Fasten this frame to the posts with 3-inch galvanized screws. Put two screws into the corner through each outer band into the side bands -- the outer bands should overlap the posts by 1 1/2 inches on each side.
Fasten metal rafter hangers to the end bands with galvanized screws -- these have backs secured to the bands with u-shaped brackets to hold rafters. Cut rafters to fit and install them across the roof, in the direction of the roof slope, spaced with centers 24 inches apart. Use 1 1/2 inch galvanized screws to secure the hangers and rafters. Fasten rafters with 3-inch screws through the outer bands as an alternative to eliminate the metal hangers and provide an all-wood look.
Cover the roof with corrugated metal or vinyl, panels that come in 26-inch widths designed to cover 24 inches and be fastened to rafters at that spacing. Use screws with plastic washers on the heads to seal the screw joints. Drive screws through the roofing into the joists about every 18 inches, putting the screw heads tight against the roofing but not so tight as to dent or compress the material.
Use oriented strand board decking and conventional three-tab shingles as an alternative. Lay OSB panels perpendicular to the joists and fasten them with 1 1/2-inch galvanized screws. Staple roofing paper over the OSB and nail on shingles. Install a metal drip edge to seal the edges of OSB decking.