Whether you need privacy from neighbors, a safe boundary for children and pets, or simply a decorative property line marker, building your own fence is one of the most satisfying outdoor DIY projects a homeowner can tackle. A well-built wood fence adds value to your property, defines your outdoor space, and can last 15 to 20 years with proper materials and maintenance.
This guide covers everything from planning and material selection through the last coat of sealer. We focus on a standard wood privacy fence (6 feet tall, board-on-board or spaced picket style) because it is the most common type for DIY builders, but the techniques apply to virtually any wood fence design.
Step 1: Planning and Permits
Before you dig a single hole, research the following requirements thoroughly.
Property Lines
Your fence must be on your property — not on the neighbor’s side, and not on an easement. If you are unsure where your property lines are, get a land survey. A fence built even 6 inches over the line can lead to legal disputes and an order to move it at your expense.
Local Building Codes and HOA Rules
Most municipalities regulate fences. Common restrictions include maximum height in front yards (typically 3 to 4 feet) versus side and back yards (6 to 8 feet), setback from property lines (0 to 12 inches), and material restrictions enforced by homeowners associations. Pool barrier requirements carry separate, more stringent code provisions such as a 4-foot minimum height and self-closing gates.
Call 811 before you dig — anywhere in the United States, this is required by law. Utility lines for gas, electric, and fiber optic can be buried as shallow as 12 inches, and striking them is dangerous and costly. Always discuss your fence plans with adjacent neighbors before building. Even if the fence sits entirely on your property, a friendly conversation prevents hard feelings.
Step 2: Choose Your Materials
Selecting the right materials determines how long your fence will last and how much maintenance it will require. Pressure-treated pine is the standard choice for posts and rails, offering excellent rot resistance at a moderate cost with a typical lifespan of 15 to 20 years. Cedar provides natural rot resistance, a beautiful grain, and lighter weight, but costs significantly more. Redwood is the premium option with a 20-to-30-year lifespan but carries a very high price tag and limited regional availability. Non-treated spruce or fir should never be used for ground contact applications — these species rot within 3 to 7 years. Composite materials such as PVC and wood-blend boards offer 25-to-50-year lifespans with zero painting or staining, but the upfront cost is the highest of any option.
Use only galvanized, stainless steel, or coated deck screws — never bright nails or uncoated fasteners. For post-to-rail connections, structural connectors from manufacturers like Simpson Strong-Tie provide superior strength. For gates, use heavy-duty strap hinges and a latch with a lockable feature.
Step 3: Calculate Materials
For a standard 6-foot privacy fence on a level lot, a 100-foot run requires approximately 14 posts (4×4, 8 feet long, spaced 8 feet on center), 39 rails (2×4, using 3 rails per section), 200 to 400 pickets or boards depending on spacing, 14 bags of 80-pound concrete mix, roughly 350 deck screws, and 14 post caps. Adjust quantities for your specific fence length and design.
Step 4: Set the Posts
Post setting is the most critical part of fence building — if your posts are not straight, level, and properly set, nothing else will be right. Start by setting batter boards beyond the fence line at both ends and running string lines to mark the face of the fence. Mark post locations at 6-foot or 8-foot intervals. The post hole should be three times the post diameter (12 inches for 4×4 posts) and at least one-third the post height above ground. For a 6-foot fence using 8-foot posts, dig holes 24 to 30 inches deep — always below the frost line in cold climates.
Place 4 to 6 inches of gravel in the bottom of each hole for drainage. Position the post and check plumb with a 4-foot level on two adjacent faces. Brace the post with 2×4 stakes to hold it plumb while the concrete sets. Mix concrete to a stiff consistency (not soupy), fill the hole, and mound the concrete slightly above grade, sloping away from the post to shed water. Wait at least 24 hours — preferably 48 — before attaching rails.
For a faster alternative, expanded-stone post-setting aggregate locks posts in place without mixing, drains better, and allows post replacement without digging. However, this method may not meet all local codes — check with your building department before proceeding.
Step 5: Install the Rails
Once the concrete has cured, attach the horizontal rails between posts. For a 6-foot fence, use three rails positioned at the top, middle, and bottom of each section. Mark rail positions on both end posts using a level or string line, then snap a chalk line across intermediate posts. Attach rails using one of three methods: toe-nailing (driving screws at an angle through the rail into the post, suitable for light fences), metal fence-rail brackets (stronger and easier to align), or notching (cutting a 1.5-inch recess into the post and setting the rail inside — the strongest but most labor-intensive option). Butt joints between rails should fall on a post, and stagger joints between rail rows so they do not align on the same post.
Step 6: Attach the Pickets or Boards
This is where the fence takes shape. For a board-on-board privacy fence, start at one end and install the first picket plumb, checking with a level. Use a spacer to maintain consistent gaps — typically 1/4 inch for drainage and wood expansion. Work in sections of 4 to 6 boards, then check alignment with a string line. Maintain consistent height using a string line or a story pole. For the board-on-board style, install one face first with 1×6 gaps, then center the second face over the gaps on the opposite side. For a standard gapped picket fence, use the same starting procedure but maintain a consistent gap of 2 to 3 inches. Make a spacer jig from scrap wood to speed the process.
Step 7: Build and Hang the Gate
Gates are the most complex part of any fence, and a sagging gate ruins an otherwise beautiful installation. The diagonal brace must run from the bottom hinge side to the top latch side, carrying the gate’s weight in compression. Add a 1/4-inch gap between the gate and the latch post on all sides for swing clearance. Use 3-inch or longer screws for hinge attachment into the gate post, and install a wood or metal gate stop on the latch post to prevent the gate from swinging through. Choose a self-latching gate for safety — this is required for pool fences by the International Residential Code. For more on types of gates and their hardware, see our guide on gate styles and construction methods. For additional fence building tips and techniques, explore our complete fence construction resource.
Step 8: Finishing and Protection
Wood fences need protection from the elements. Even pressure-treated wood will gray, crack, and eventually rot without a finish. Semi-transparent stain lasts 2 to 4 years and shows the wood grain while hiding some imperfections. Solid-body stain lasts 3 to 5 years and provides opaque color coverage. Clear sealer lasts only 1 to 2 years and offers the least protection. Paint provides the best protection with a 5-to-7-year lifespan but is the most labor-intensive to apply. Pressure-treated wood must dry for 4 to 8 weeks before applying stain or paint — test moisture content with a meter and verify it is below 15 percent. Cedar can be finished immediately if dry. Never apply finish if rain is expected within 24 hours or if nighttime temperatures will drop below 50 degrees Fahrenheit.
Common Fence Problems and Solutions
The most common fence problems include posts leaning due to insufficient concrete or frost heave, gate sagging caused by missing diagonal braces, boards warping from green lumber or moisture imbalance, rails pulling away from insufficient fasteners, and rot at the post base from trapped moisture. Each of these issues can be prevented with proper planning and materials. For guidance on attaching a deck ledger to a foundation, see our detailed guide on structural connections. If you are considering composite decking for adjacent outdoor spaces, review our comparison of decking materials.
Fence Styles at a Glance
The board-on-board privacy fence offers complete privacy with moderate difficulty and a higher material cost, making it ideal for backyards where noise reduction matters. Standard picket fences are easy to build and inexpensive, providing partial privacy suitable for front yards. Shadowbox fences use alternating pickets to provide privacy with airflow while presenting a finished appearance on both sides. Horizontal slat fences require advanced skills and complete privacy for modern designs on level lots. Split-rail fences are the easiest to construct but offer no privacy, making them best for large properties with a rustic aesthetic.
Conclusion
Building a fence is a multi-stage project that rewards careful planning and patient execution. The key phases — setting straight posts, attaching level rails, and spacing pickets uniformly — each build on the one before. Rushing any step creates problems that compound down the line. Choose your materials wisely, invest in proper tools such as a good level, a string line, and a high-quality drill or driver, and do not cut corners on concrete or gate hardware. A fence built with care will define your property beautifully for decades. And the best part is that every time you look at it, you will know you built it yourself.
