How to Install a Fence: Complete DIY Guide

Plan your fence project from posts to pickets. Calculate every material, choose the right wood, and budget your installation.

Installing your own fence is one of the most satisfying — and money-saving — DIY projects you can take on. Pros typically charge between $25 and $60 per linear foot for a basic wood privacy fence, and roughly half of that bill is labor. A motivated homeowner can usually install 100 to 150 feet of fence per weekend with a helper, saving thousands of dollars in the process. This guide walks you through every step from picking the style and material to mixing your last bag of post-set concrete. Along the way you'll find calculators that take the guesswork out of how much wood, how many posts, and how many bags of concrete you actually need.

The two most common reasons fence projects go off the rails are buying the wrong amount of material (forcing extra trips and visible color mismatches) and setting posts wrong (which leads to leaning, sagging fences within 2 to 3 years). Get those two things right and the rest of the project is mostly pleasant outdoor work.

What You'll Need

Step 1: Choose Your Fence Style

Before you order materials, lock in the style. The four most common residential fences are privacy (6 to 8 feet tall, fully closed pickets), shadowbox (alternating pickets on each side, looks identical from both sides), picket (3 to 4 feet tall, decorative spaced boards), and ranch rail (split-rail or 3-rail post-and-rail with no pickets). Each style drives a different post spacing, picket count, and rail count.

Privacy Fences

The most common backyard fence. Standard build is 6 feet tall with 8-foot post spacing, two horizontal rails (top and bottom), and 5/8-inch thick dog-eared pickets butted edge to edge. Adds the most privacy and the most material cost — figure roughly 17 pickets per 8-foot section for a fully boarded look.

Picket Fences

Classic decorative front-yard fence. Typically 3 to 4 feet tall with 6 to 8-foot post spacing and pickets spaced 2 to 3 inches apart. Uses about 40% less wood than a privacy fence of the same length.

Ranch Rail

Best for large lots and rural property lines. Three horizontal rails between posts, no pickets. Cheapest material cost but offers no privacy and minimal pet containment.

HOA, Setback, and Property Line Rules

Before you dig, check three things: your HOA covenants, your municipal setback rules, and your property line. Most jurisdictions require fences to sit 6 to 12 inches inside the property line, and many limit front-yard fences to 4 feet maximum. A $200 land survey is cheap insurance against a neighbor dispute or forced removal.

Step 2: Pick the Right Wood Type

Material choice drives both upfront cost and the maintenance you'll be doing for the next 20 years. The three big options for wood fences are pressure-treated pine, cedar, and redwood. Vinyl is a popular non-wood alternative.

Pressure-Treated Pine

Cheapest at $2 to $4 per linear foot of pickets. Lasts 15 to 20 years if maintained. Tends to twist and check (split) more than cedar, especially if you don't stain it within the first year.

Cedar

The premium wood choice at $4 to $8 per linear foot. Naturally rot- and insect-resistant, dimensionally stable, and beautiful. Lasts 20 to 25 years. Our cedar vs. pressure-treated comparison walks through the lifetime cost difference, which is closer than most people assume once you factor in re-staining labor.

Vinyl

Higher upfront cost ($25 to $40 per linear foot installed), but zero ongoing maintenance and a 30+ year service life. Read our vinyl vs. wood fencing comparison for a side-by-side breakdown of installed cost, durability, and resale impact.

Step 3: Calculate Fence Materials

With your style and material chosen, it's time to figure out exactly how much you need. Run a string line along the fence path and measure total linear footage. Then plug it into our fence calculator along with your post spacing (typically 8 feet) and picket width (typically 5.5 inches actual for a 6-inch nominal picket).

The calculator returns your post count, rail count (top and bottom, plus middle for fences over 6 feet), and picket count. Add 5% to 10% for cuts, splits, and rejected boards.

Post Spacing

Standard residential post spacing is 8 feet on center. Going to 6 feet adds material cost but produces a noticeably stiffer fence — worth it on windy lots or anywhere you'll be hanging heavy gates.

Gates

Plan gate locations early. Each gate needs two heavier posts (often 6x6 instead of 4x4) set deeper than line posts, plus a gate frame, hinges, and a latch. Most DIYers underestimate how much sag a single gate can develop in the first year — splurge on heavy-duty hinges.

Step 4: Estimate Concrete for Posts

Posts must be set in concrete to hold up against wind and frost heave. Standard practice is to dig 1/3 the post height plus 6 inches, so a 6-foot fence with 8-foot posts gets a 2.5 to 3-foot deep hole. Hole diameter should be 3x the post width — a 4x4 post wants a 12-inch hole.

Each 12-inch diameter, 30-inch deep hole takes about 0.07 cubic yards of concrete, or roughly 1.5 to 2 bags of 60-lb post-set or fast-set concrete. Plug your hole diameter, depth, and post count into our concrete calculator to get an exact bag count.

Setting Posts the Right Way

Drop 4 to 6 inches of pea gravel in the bottom of each hole for drainage. Set the post, brace it plumb in two directions with scrap 2x4s, then either dry-pack the hole with fast-set mix and water (the easiest method) or pour pre-mixed concrete and tamp to remove air pockets. Crown the concrete above grade and slope it away from the post so water sheds outward. Let posts cure at least 24 hours before hanging rails.

Step 5: Apply Stain or Sealer

Wait 30 days after installing pressure-treated wood before staining — wet PT will reject finish and peel. Cedar can be stained as soon as it's dry to the touch, ideally within 6 months to lock in color before UV graying sets in.

Use our stain calculator to determine gallons. A 100-foot, 6-foot-tall privacy fence (1,200 sq ft of surface, both sides) needs roughly 4 to 6 gallons at 200 sq ft per gallon coverage. Apply with a 4-inch stain brush or a pump sprayer plus back-brushing for the smoothest finish.

Maintenance

Re-stain every 3 to 5 years. Annual upkeep is a soft-wash with deck/fence cleaner and a quick walk-around to tighten any loose pickets or replace cracked rails.

Step 6: Total Fence Cost

DIY fence cost depends primarily on linear footage, fence height, and material. Typical all-in DIY material costs:

Fence Length PT Privacy (6') Cedar Privacy (6') Vinyl Privacy (6')
100 linear feet $1,200 – $2,000 $2,500 – $4,000 $2,800 – $4,500
150 linear feet $1,800 – $3,000 $3,800 – $6,000 $4,200 – $6,800
200 linear feet $2,400 – $4,000 $5,000 – $8,000 $5,600 – $9,000

For pricing of contractor installation, gate add-ons, and regional cost variation, see our full fence cost guide.

Pro Tips for Installing a Fence

Common Mistakes to Avoid

Related Calculators & Guides