DIY Fence and Gate Installation

DIY Home Security: Installing a Fence

A step-by-step outline of a basic DIY fence build, from permits and utility marking through layout, posts, rails and panels, with checks along the way.

On this page
  1. What a basic fence build involves
  2. Step 1: Check the rules first
  3. Step 2: Get underground utilities marked
  4. Step 3: Lay out the line
  5. Step 4: Dig and set the posts
  6. Step 5: Attach rails
  7. Step 6: Fit panels or boards
  8. Step 7: Finish and check
  9. When to stop and call a professional

What a basic fence build involves

A basic wood or panel fence is made of the same few parts, whatever the style: posts set in the ground, rails (or panel frames) that connect them, and a face of boards or ready-made panels. Building one yourself is realistic for many homeowners with a flat, simple run of fence. It is mostly measuring, digging and patience rather than advanced skill.

A fence also supports home security only as far as it is well built. A leaning, gappy or poorly anchored fence gives a false sense of protection. No fence guarantees that people stay out, but a sturdy, properly placed one adds a visible boundary and a bit of delay. This outline covers a common first-time approach; details vary by material and region.

Step 1: Check the rules first

Before buying anything, find out what applies to your lot. Many places require a permit, and many limit height or how close to the property line you can build. Our notes on fence permits and on local fence regulations explain what to ask. If you belong to a homeowners association, its approval can be required as well.

Also confirm where your boundary really is. A recorded property survey is a better guide than a guess based on an old fence or a neighbor’s memory. If the fence will sit on a shared line, talk to the neighbor early.

Step 2: Get underground utilities marked

Digging post holes can hit gas, electric, water, sewer or communication lines. In many places you can request free or low-cost marking from a one-call service before you dig, and you generally need to wait for the marks to appear. Details of utility locating differ by region, so look up the process where you live. Private lines, such as sprinkler lines or a yard light cable, are often not marked by that service, so think about where they might run.

Do not start digging until the marking is done. This is the step people most often skip and most often regret.

Step 3: Lay out the line

Mark the corners and ends first, then pull a string between them, pulled tight and slightly above the ground. The string is your reference for everything that follows. Check that corners are square: a common method is to measure 3 feet along one side, 4 feet along the other, and adjust until the diagonal between those points is exactly 5 feet. That 3-4-5 triangle gives a right angle.

Then mark post positions along the string. For panel fences, spacing is set by the panel width plus the post thickness, so measure a real panel before you mark. For board fences, 6 to 8 feet between posts is a typical range, depending on the rails and the material. Mark the gate opening now too, since gate posts are usually heavier and the opening must match the gate you plan to hang. If you need more help measuring, see how to measure your property for the perfect fence.

Step 4: Dig and set the posts

Post depth matters more than almost anything else. A common rule of thumb is to bury roughly a third of the post’s length, and in cold climates holes often need to reach below the local frost line so the ground cannot lift the post. Local guidance on post depth is worth checking, because this varies widely.

Holes are usually dug with a hand auger, a post-hole digger or a rented powered auger. Add a few inches of gravel at the bottom for drainage. Set the post, check it plumb on two adjacent faces with a level, and brace it. Posts can be held with tamped soil and gravel or with concrete; see our comparison of post footings for the tradeoffs. Corner and end posts take the most strain, so many builders make those holes deeper or wider.

Let concrete cure for the time the manufacturer lists before you load the posts with rails or panels.

Step 5: Attach rails

Rails run horizontally between posts. Two rails are common on shorter fences and three on taller ones. Fasten them to the posts with exterior-rated hardware: the right fence fasteners prevent rust streaks and loosening over time. Keep the rails level or parallel to the string line, and keep the tops consistent so the finished fence looks even.

Step 6: Fit panels or boards

Prebuilt panels are usually the faster option for a beginner: you set each panel between posts, check level, and fasten it. Boards built up on rails take longer but allow more control over spacing and style. For boards, use a spacer block so the gaps stay the same; consistent picket spacing makes a surprising difference to appearance.

Keep panels slightly above the ground, not touching it, so wet soil does not rot the bottoms. Where the ground slopes, you will need either stepped fence panels or a racked approach.

Step 7: Finish and check

Cap the post tops so water does not soak the end grain, and add a coat of stain or sealer if the wood calls for one. Walk the line and check for leaning posts, loose fasteners and sharp edges. Then plan a small yearly inspection, because wood moves and soil settles.

When to stop and call a professional

Steep slopes, retaining walls, large or heavy gates, very long runs, or trouble with the property line are all good reasons to bring in help. Choosing between doing it yourself and hiring is a real decision, not a failure, and it is covered in DIY or professional comparisons. Any job involving an electric or automatic gate calls for a professional installer, since those carry safety risks.

Keep exploring

Guides from other topics

All topics →