How to Install a Wood Fence?
This step-by-step guide shows you exactly how to install a wood privacy fence from scratch — from planning, layout, and post holes through to setting posts in concrete, installing rails and pickets, building a gate, and finishing with stain or sealant. Professional fence installation runs $20–$45 per linear foot — a 150 ft fence costs $3,000–$6,750 installed. DIY materials for the same fence run $800–$2,000, saving you the full labor cost.
- Before You Start
- Materials & Tools Needed
- Step 1 — Plan & Mark the Layout
- Step 2 — Dig the Post Holes
- Step 3 — Set the Corner & Gate Posts
- Step 4 — Set the Line Posts
- Step 5 — Install the Rails
- Step 6 — Attach the Fence Boards
- Step 7 — Build & Hang the Gate
- Step 8 — Finish & Seal the Wood
- Pro Tips & Common Mistakes
- FAQs
Before You Start
A wood privacy fence is one of the most impactful backyard upgrades you can make — adding security, privacy, curb appeal, and real property value. Professional installation runs $20–$45 per linear foot. A 150-foot fence costs $3,000–$6,750 installed. DIY materials for the same fence run $800–$2,000, saving you the full labor cost. Before you buy a single post, there are a few critical steps that every DIYer must take.
Check Your Local Codes & HOA Rules
Most municipalities have rules about fence height (typically 6 ft max in backyards, 4 ft in front yards), materials, and setbacks from property lines. Many HOAs also have specific rules about fence style and color. Check both before buying materials — installing a non-compliant fence means tearing it down and rebuilding at your expense. A permit is often required for fences over 6 feet — check with your local building department. Budget your full project cost first using our fence cost calculator.
Know Your Property Lines
Building a fence even a few inches over your property line is a legal dispute waiting to happen. Review your property survey or hire a surveyor if you're unsure. Most fence installers recommend building 2–4 inches inside your property line as a buffer. A fence built on a neighbor's property may be ordered removed entirely at your cost.
Call 811 Before You Dig
Call 811 at least 3 business days before digging any post holes. Underground utility lines for gas, water, electric, and cable are buried in most yards. This free service marks their locations — hitting a gas line while digging a post hole can be fatal. Always call, even for shallow holes.
Use our Fence Cost Calculator to estimate materials and total project cost before buying anything. If you're also painting or staining after installation, our Fence Paint Calculator tells you exactly how many gallons you'll need.
Materials & Tools Needed
The list below covers a standard 6 ft wooden privacy fence with pressure treated posts, 2×4 rails, and dog-eared cedar or PT pickets. Use our lumber cost calculator to price your specific board quantities before heading to the yard.
Materials
| Material | Purpose | Quantity Guide |
|---|---|---|
| 4×4 PT posts (8 ft length for 6 ft fence) | Structural support | 1 per 8 ft of fence + corners + gates |
| 2×4 PT rails (8 ft) | Horizontal support for pickets | 2–3 per bay (every 8 ft span) |
| Dog-eared cedar or PT pickets (6 ft) | Privacy panels | ~1 picket per 3.5 inches of fence length |
| Concrete (80 lb bags) | Set posts | 2 bags per post hole |
| Post caps | Protect post tops from water | 1 per post |
| Gate hardware (hinges + latch) | Gate operation | 1 set per gate |
| Galvanized or stainless screws / nails | Fasten pickets and rails | ~2 lbs per 100 linear ft |
| Wood stain, sealant, or paint | Weather protection | Use fence paint calculator |
Tools
- Post hole digger or power auger — auger rental $80–$150/day, essential for more than 6 holes
- Level (4 ft) — for plumbing posts
- String line & stakes — for straight layout
- Tape measure & chalk line
- Circular saw or miter saw — for cutting rails and pickets
- Drill / impact driver — for screws
- Speed square — for checking angles
- Rubber mallet — for adjusting posts
- Safety glasses & work gloves
- Wheelbarrow & mixing hoe — for concrete
A precise layout prevents posts from wandering off line, gates from binding, and pickets from ending awkwardly at corners. Spend 30–45 minutes on layout and the rest of the build goes smoothly. Measure your total fence run first — our square footage calculator can help you confirm your yard dimensions before ordering materials.
- Mark all corners first — drive a stake at every corner of the fence line. Run a string line between corner stakes — this is your fence line reference for the entire build.
- Mark gate location(s) — decide where your gate goes now, before laying out any posts. Gate width affects post spacing — a standard walk-through gate needs a clear 36–42 inch opening, which means gate posts are set closer together than normal line posts.
- Mark post locations — standard post spacing is 8 feet on center (from center of one post to center of the next). Mark each post center with a stake along the string line. Adjust spacing at the end of each run so you don't end with a very short or very long bay — it's fine to vary spacing slightly (7–8 ft) to keep bays even.
- Mark all post holes — spray paint a circle around each stake to mark where you'll dig. Step back and eyeball the whole layout before digging — it's easy to move a spray mark, impossible to move a set post.
- Account for the fence face vs post center — remember your string line represents the fence face (the side the pickets face), not the post centers. Posts are typically centered 2 inches inside the string line so pickets align flush with it.
For a fence that follows a slope, decide upfront whether you want a stepped fence (each bay drops in a stair-step fashion, keeping pickets vertical) or a racked fence (rails follow the slope, pickets stay parallel to the slope). Stepped fences look cleaner but require more cuts. Racked fences are faster but only work with certain fence styles.
Post hole depth determines whether your fence stands for 20 years or leans after the first winter. The rule is simple: one-third of the total post length must be below ground. For a 6 ft fence using 8 ft posts, dig holes at least 24–30 inches deep — deeper in northern climates where frost heave is a concern.
- Check local frost depth — post holes should extend 6 inches below the local frost line to prevent heaving. In mild climates (Zone 7+), 24 inches is sufficient. In northern states, 36–48 inches may be required. Your local building code specifies this.
- Dig to the correct diameter — holes should be 3× the post width. For 4×4 posts, dig a 10–12 inch diameter hole. Wider holes use more concrete but provide better stability in soft or sandy soil.
- Add 6 inches of gravel at the bottom — compact the gravel with a post or rod. This layer provides drainage under the post base and reduces moisture contact, which is the primary cause of post rot even in treated lumber.
- Rent a power auger for more than 6 holes — a one-man auger cuts a 10-inch hole in under 2 minutes in most soils. Hand-digging 20+ post holes is exhausting and slows the entire project significantly.
- Keep all holes along the string line — check after each hole that it's positioned correctly relative to the string. A hole dug even 3 inches off-line creates a post that's out of line and very difficult to correct once set in concrete.
If you hit rock or major roots, you have two options: shift the post location slightly (adjust spacing) or use a steel digging bar to break through. Never set a post in a hole that's too shallow just because digging was difficult — a post that doesn't reach proper depth will lean within 1–2 seasons.
Always set corner posts and gate posts first — they're the anchors that all other posts align to. These posts carry the most load and need to be perfectly plumb and firmly set before anything else proceeds. Use our concrete calculator to confirm your bag count — running short mid-pour is a common problem.
- Set the post in the hole — place the post in the center of the hole, resting on the gravel base. Hold it against the string line for position.
- Plumb the post — check plumb on two adjacent faces with your level. Have a helper hold the post while you check, or use temporary 2×4 braces screwed to stakes to hold it plumb hands-free.
- Mix and pour concrete — mix two 80 lb bags per hole to the consistency of thick oatmeal. Pour around the post in layers, rodding with a stick to eliminate air pockets. Fill to 2 inches above grade, then slope the concrete away from the post to shed water.
- Re-check plumb immediately — wet concrete allows adjustment for about 10–15 minutes. Check plumb on both faces again after pouring and correct before it sets.
- Brace and leave — leave diagonal braces in place. Do not attach rails or pickets until posts have cured for at least 24–48 hours. Loading a post before concrete cures causes it to lean.
- Gate posts need extra reinforcement — gate posts carry significant dynamic load from the gate swinging. Use 6×6 posts for gate openings over 4 ft, dig holes 6 inches deeper than line posts, and use 3 bags of concrete per gate post hole instead of 2.
Products like Quikrete Fast-Setting Concrete allow you to pour dry mix directly into the hole around the post, then add water on top — no mixing required. It sets in 20–40 minutes, letting you set all posts in a single day without waiting for batch cure times. It's slightly more expensive than standard mix but worth it for fence projects where you're setting 15–25 posts in sequence.
With corner and gate posts set and cured, the line posts go in quickly — they align to the string line between the already-set corners, so there's no guesswork on position.
- Re-run the string line — stretch a string line between the set corner posts at a consistent height (typically 6 inches below the post top). This is your height reference for all line posts.
- Set each post to the string — place each line post so its face aligns with the string line, not touching it (touching causes the string to bow). Use a small spacer block to maintain a consistent offset from the string to the post face.
- Check height — all posts should be at the same height, set to the string line reference. Posts that are too tall can be cut down later; posts that are too short require resetting. It's easier to cut than reset — set posts slightly tall and trim to final height after concrete cures.
- Work in sections — don't try to set all posts in one day if you have more than 10–15 posts. Concrete that sets while you're still working on other posts limits your ability to make adjustments.
- Cut posts to final height — after all concrete has cured (48 hours minimum), snap a chalk line at the desired post top height and cut all posts to the same height with a circular saw. This is much faster and more accurate than trying to set every post to exact height individually.
After cutting posts to final height, apply a liberal coat of end-cut wood preservative (such as Copper Green or similar) to every cut top. Saw cuts expose untreated wood inside even pressure treated lumber — untreated cut ends absorb water and rot significantly faster than factory surfaces. This one step can add years to your post life.
Rails are the horizontal 2×4s that span between posts and provide the nailing surface for your fence pickets. A 6 ft privacy fence typically uses three rails — top, middle, and bottom. Two rails are acceptable for shorter fences (under 5 ft) but three rails give significantly better rigidity and reduce picket warping over time.
- Mark rail heights — for a 6 ft fence with three rails: top rail 5–6 inches below post top, bottom rail 6–8 inches above grade (keeps wood off soil), middle rail centered between the two. Mark these heights on every post with a pencil line.
- Cut rails to length — measure each bay individually — post spacing varies slightly even in a well-laid-out fence. Cut each rail to fit snugly between posts.
- Choose your rail attachment method:
- Face-mount (simplest) — rails butt against the post face and are fastened with structural screws. Quick and strong but posts are visible on both sides.
- Notched posts — notches cut into the post cradle the rails for a cleaner look and stronger connection. Requires more skill but results in a better finished fence.
- Rail brackets / hanger hardware — metal brackets screwed to the post hold the rail end. Fast, strong, and allows some adjustment. Best for beginners.
- Fasten rails with structural screws or nails — use 3-inch galvanized or stainless screws, 2 per rail end per post. Never use regular zinc-plated screws outdoors — they corrode within 2–3 years and stain the wood.
- Check rails for level — use your level on each rail. A rail that's slightly out of level causes your pickets to lean, which becomes very visible once the fence is up.
The bottom rail should sit at least 6 inches above grade — 8 inches is better. Wood in direct ground contact rots rapidly, even if pressure treated. This gap also allows airflow under the fence which reduces moisture buildup on the lower pickets. If you need privacy at the ground level, use gravel or a concrete mow strip under the fence rather than dropping the rail to grade.
Attaching pickets is the most visible part of the build — consistent spacing, plumb boards, and straight lines across the top are what separate a professional-looking fence from a sloppy one. This step goes quickly once you have a system. Plan your board count carefully using our fence cost calculator to avoid running short or overbuying.
- Set up a spacer — cut a scrap piece of wood to your desired picket gap (typically ¼ inch for privacy, 0 for tight privacy, ½–1 inch for a more open look). Use this spacer between every picket for perfectly consistent spacing without measuring each one.
- Run a level line at the top — snap a chalk line at the desired picket top height across the entire fence run. This is your most important reference — picket tops that wander up and down look terrible from a distance.
- Start at a visible corner — begin at the most visible corner (typically the street-facing corner) and work in both directions. Any spacing adjustments at the end will end up at the least visible point.
- Check plumb on every third picket — use your level to check each picket for plumb before fastening. Pickets that lean, even slightly, look very obvious once the fence is finished. If a picket bows, cull it — warped pickets are not worth the trouble.
- Fasten with 2 nails or screws per rail — for 3-rail fences, use 2 fasteners per rail (6 total per picket). Drive fasteners through the picket and into the rail center. Pre-drill near the picket edges to prevent splitting.
- Keep picket bottoms consistent — all picket bottoms should be the same distance from grade. Cut a height block (a piece of scrap at the correct height) and rest each picket on it while fastening — this ensures perfect bottom consistency across the entire fence.
For a premium privacy fence, consider a board-on-board style — pickets alternate front and back of the rails with a 1-inch overlap. It uses about 30% more pickets but provides 100% privacy from any angle (no gaps when viewed obliquely), allows air circulation which reduces moisture buildup, and looks equally good from both sides. Use our fence cost calculator to estimate the extra material cost.
A gate that swings freely, latches cleanly, and doesn't sag after a season is the hallmark of a well-built fence. Gates are also where most DIY fences fail first — because gate posts are set identically to line posts and not reinforced for the added dynamic load.
- Measure the opening precisely — measure between gate posts at top, middle, and bottom. If measurements differ, your posts aren't parallel — correct this before building the gate. Build the gate ¾–1 inch narrower than the smallest measurement to allow for swing clearance and wood expansion.
- Build a Z-frame gate — assemble two vertical rails (same height as fence pickets) and two horizontal rails (top and bottom). Add a critical diagonal brace from the bottom hinge corner to the top latch corner — this is the structural element that prevents sag. Without this diagonal, every gate sags. The diagonal must run from bottom-hinge to top-latch (compression brace), not the other direction.
- Attach pickets to the gate frame — fasten pickets to the gate frame the same way you did the fence panels. Make sure the gate is lying flat on a level surface while you attach pickets — any twist in the frame becomes permanent once fastened.
- Install hinges on the gate post — use heavy-duty 3-point strap hinges or heavy-duty butt hinges rated for your gate weight. Position top hinge 8 inches from top, bottom hinge 8 inches from bottom. Use 3-inch screws into the post — not just into the rail.
- Hang the gate — with a helper, hold the gate in position in the opening at the correct height. Mark hinge positions, drill pilot holes, and fasten. Test swing before fully tightening all screws.
- Install the latch — position the latch so the gate sits flush with the fence face when closed. Adjust as needed for smooth operation.
The diagonal brace in a gate frame must run from the bottom hinge corner to the top latch corner — this puts the brace in compression, which is how wood handles load best. If you run the diagonal the other way (bottom-latch to top-hinge), the brace works in tension and the gate will sag within a season. This is the most common gate-building mistake.
A bare wood fence weathers quickly — greying within months and cracking within 1–2 years without a protective finish. Applying stain or sealant within 60 days of installation is the single most important maintenance step you can take to extend your fence's life. Use our fence paint calculator to estimate exactly how many gallons you'll need based on your fence length, height, and style.
- Wait for the wood to dry — new pressure treated lumber is wet from the treatment process. Wait 2–4 weeks before applying any finish. Test readiness by sprinkling water on the wood — if it beads up, the wood is still too wet to accept stain. If it absorbs immediately, it's ready.
- Clean the surface — brush off any dirt, sawdust, or mill glaze with a stiff brush or light pressure wash. Let dry completely before applying finish.
- Choose your finish:
- Semi-transparent stain — most popular, lets wood grain show, penetrates deeply, easy to recoat. Best for cedar and redwood.
- Solid stain — hides wood grain, wider color selection, longer lasting than semi-transparent. Best for PT pine.
- Paint — longest-lasting (5–10 years), full color control, but hardest to maintain once it starts peeling. Best for a fence that matches your house trim.
- Clear sealer — minimal color change, 1–2 year lifespan, best for maintaining natural wood look short-term.
- Apply with a sprayer for speed — an airless sprayer coats a 150 ft fence in 1–2 hours versus a full day with brush/roller. Always back-brush immediately after spraying to work finish into joints and edges. Cover all plants, lawn, and hardscape before spraying — stain overspray is nearly impossible to remove.
- Install post caps — fit a decorative post cap on every post top. Post caps prevent water from pooling on the end grain — the most vulnerable part of a wooden post. They cost $1–$5 each and can add years to post life.
Your wood fence is complete. Inspect after the first heavy rain — check that all posts are plumb, no pickets have shifted, and the gate swings and latches correctly. Plan to reapply stain or sealant every 2–4 years depending on your climate and finish type. Annual inspection of post bases and bottom pickets catches rot early when it's still easy to repair.
Pro Tips & Common Mistakes
Common Mistakes to Avoid
- Posts too shallow — the most common cause of fence failure. One-third of post length must be below ground. For a 6 ft fence, posts should be 2–2.5 ft in the ground minimum, deeper in frost-prone climates.
- Only two rails on a 6 ft fence — two rails cause pickets to bow outward or inward over time, especially with wide cedar boards. Use three rails for any fence 5 ft or taller.
- Using zinc-plated hardware — regular zinc-plated screws and nails corrode rapidly when in contact with PT lumber's preservative chemicals. Always use hot-dipped galvanized or stainless steel fasteners for any outdoor wood project.
- Setting all posts at once and letting concrete cure before checking alignment — always check plumb and alignment on each post before moving to the next. Concrete that has started to set cannot be adjusted.
- Gate diagonal brace in wrong direction — see Step 7. This is the single most common gate mistake and causes immediate sagging.
- No finish on new fence — bare PT pine turns grey and checks (surface cracks) within months in UV exposure. Apply a finish within 60 days of installation.
- Bottom rail at grade level — wood touching soil rots rapidly. Keep the bottom rail at least 6 inches above grade.
Pro Tips
- Buy 5–10% more pickets than calculated — wood boards vary in width and you'll cull warped or knotted ones. Running short mid-fence means a second lumber run and potential dye lot mismatch.
- Use a story pole — a long straight board marked with your rail heights, picket bottom height, and post top height. Holding it against each post speeds up marking dramatically on long fence runs.
- For a fence over 100 linear feet, rent a pneumatic nailer with a compressor — it dramatically speeds up picket attachment and reduces hand fatigue.
- If building on a slope, set all posts plumb (vertical) regardless of slope — never tilt posts to follow the grade. Only the rails and pickets adapt to the slope, never the posts.
- After staining or painting, apply a bead of exterior caulk where posts meet concrete at grade level — this seals the most vulnerable joint against water infiltration.
Frequently Asked Questions
Plan your full fencing and outdoor project with these free tools and guides.
