How to Build a Fence: A Fence Contractor's Step-by-Step Guide
How to build a fence: lay out a straight line, call 811 before you dig, set your posts deep in concrete (about a third of the post buried, minimum 24 inches, below the frost line), then add rails, pickets, and a gate. The fence you see is easy. The fence you bury is what keeps it standing.
I've built wood fences for fifteen years, and I can tell you the difference between a fence that's still tight at year twenty and one that's leaning at year three comes down to two things: post depth and concrete. Everything else is carpentry you can learn. So here's how I build a wood privacy fence, start to finish, with the mistakes that cause sag and rot called out so you can dodge them.
This is written for a standard 6-foot wood privacy fence on reasonably flat ground. If you're still weighing materials, read wood vs vinyl vs aluminum first. If you want to know what hiring this out costs instead, see my fence installation cost guide.
Before You Touch A Shovel
Call 811. Every Time. No Exceptions.
Before any digging, call 811 or file online. It's free, it's the law in most places, and they come mark your buried gas, electric, water, and cable lines. I have been doing this for fifteen years and I still call 811 on every single job. Hitting a gas line with an auger is how people die and how yards become craters. Wait the required couple of days for the locate, respect the paint marks, and hand-dig within a couple feet of any marked line. This is not optional and it is not the place to save time.
Property Lines And Permits
Know exactly where your property line is. Don't guess off the neighbor's old fence, because old fences are wrong all the time. If you're unsure, get a survey. Building over the line is how you end up tearing a finished fence back down. Then check whether your town requires a permit, and whether you have an HOA with rules on height, style, and which side faces out. Sort all of this before the lumber arrives, not after.
Step 1: Layout And Marking
Drive a stake at each end of your fence run and at every corner. Run a mason's string line tight between the end stakes. That string is your truth for the whole job. Measure along it and mark each post location with a stake or spray paint.
Post spacing matters. I set posts on 6 to 8 foot centers, and 8 is the practical max for a 6-foot fence. Go wider and the rails sag in the middle over time. Space them evenly so your panels come out uniform and your pickets land right.
Step 2: Dig The Holes Right
Here's the rule that saves your fence: bury about one-third of the total post length, with a minimum of 24 inches, and always below your local frost line. For a 6-foot fence I use a 9-foot post (so it's actually 8-foot nominal cut for some setups, but for a true 6-foot fence with a 9-foot post you bury 3 feet). Dig the holes about three times the width of the post, so roughly 10 to 12 inches across for a 4x4.
Why depth matters: a shallow post is a lever, and wind and frost will work it loose until the fence leans. In cold climates, frost heave shoves shallow posts up out of the ground over a few winters. Setting below the frost line is what stops that.
For digging, a post hole digger works for a handful of holes. For a long run, rent or buy a powered earth auger. It'll save your back and your weekend. In rocky soil you'll still need a digging bar to bust through.
Step 3: Set The Posts
This is the heart of the whole job. Do it right and the rest is easy.
- Add gravel. Put 4 to 6 inches of drainage gravel in the bottom of each hole. Setting a wood post directly on dirt in standing water is how the bottom rots out. Gravel lets water drain away from the post base.
- Set and plumb the post. Stand the post in the hole, on the gravel, and get it plumb in both directions. A post level that straps or magnets to the post is worth its tiny price because it reads two planes at once and frees both your hands. Brace it with stakes so it can't move.
- Pour the concrete. I use fast-setting concrete mix, one to two bags per hole depending on size. You can pour it dry and add water per the bag instructions, or mix it first. Mound the top of the concrete slightly above grade and slope it away from the post so water sheds off instead of pooling against the wood.
- Recheck plumb before the concrete sets, and let it cure before you hang any weight. I give it at least a few hours, and overnight if I can.
Gravel versus straight concrete is a real debate. Gravel-only setting drains beautifully and is fine for some lighter fences, but for a 6-foot privacy fence catching wind, I want concrete. The combination, gravel in the bottom for drainage and concrete around the post, is my standard. It anchors against wind and frost while still letting the base drain.
Step 4: Rails
Once the posts are cured, run your horizontal rails. A 6-foot fence gets three rails: top, middle, and bottom. Two rails on a 6-foot fence is a sag waiting to happen. Attach rails with exterior-rated structural screws or fence brackets, not interior screws and definitely not cheap nails that'll pull and rust. Keep the bottom rail a few inches off the ground so it's not sitting in dirt and moisture.
Step 5: Pickets
Now the part that makes it a fence. Start at one end and work down, checking plumb on your pickets regularly against your string line. Leave a small consistent gap or butt them tight depending on your style, and keep the bottoms a couple inches off the ground so they don't wick moisture and rot. A framing or finish nailer turns picket day from an all-weekend hand-nailing marathon into a few hours, and your shoulders will thank you. If you're nailing by hand, use exterior-rated ring-shank nails so they don't back out.
Check your line every several pickets. Small errors compound, and a fence that drifts off-line looks wrong forever even if nobody can say why.
Step 6: The Gate
Gates are where good fences fail, because a gate is a moving, racking, sagging part bolted to your fence line. Build the gate frame square, add a diagonal brace running from the bottom hinge corner up to the top latch corner (that brace is what fights sag), and hang it on heavy-duty gate hinges and latch hardware. The gate posts should be your beefiest, set deepest, because they carry the swinging load. A gate that sags within a month almost always traces back to a weak diagonal brace, undersized hardware, or a gate post that wasn't set deep enough.
Mistakes That Cause Sag And Rot
- Shallow posts. The number one cause of leaning fences. Bury a third, minimum 24 inches, below frost.
- No gravel under the post. Wood sitting in trapped water rots from the bottom.
- Concrete that pools water against the post. Slope the top away. Don't create a little bowl that holds water.
- Posts spaced too far apart. Rails sag between widely spaced posts.
- Only two rails on a 6-foot fence. The middle bows. Use three.
- Pickets touching the ground. They wick moisture and rot first.
- Cheap nails instead of exterior screws. They rust, loosen, and bleed stains down your pickets.
When To Hire This Out
I'm not here to talk you out of a satisfying weekend project. A short, straight run on flat ground is a great DIY fence and you'll save real labor money. But be honest about your situation. If your line runs down a slope, crosses rocky or root-choked soil, marks a property line you'll fight a neighbor over, needs a permit and inspection, or includes a heavy drive gate, those are the jobs where a pro's experience pays for itself. A racked panel that's off by an inch, or a post set too shallow, is a mistake you live with for years. For what hiring costs and how to vet a contractor, read how to hire a fence contractor, or just browse vetted fence pros in your area.
Build it on deep, concrete-set posts with three rails and a braced gate, and you'll have a fence that's still tight long after the bargain fence down the street is firewood.