Learning how to build a fence involves securing the posts, attaching the panels or pickets, and providing post caps. When installing a fence, carefully plan the type of fence you need that fits your home and neighborhood. Don’t worry if you don’t own all of the tools needed to complete this DIY project. Rent tools and trucks for any project at The Home Depot. Need it fast? Order before noon for convenient scheduled same-day delivery.
Tip: For help choosing between the types of fences, see our guide on the top things to consider when planning a fence.
1. Plan Your Fence
- Before you build a fence, determine whether a permit is necessary and if local building codes place restrictions on height and other factors. Backyard fences can be limited to 6 to 8 feet.
- Fences often can have longer lives based on their building materials. Treated cedar, one of the most durable, lasts up to 40 years when properly installed and maintained.
- Determine your property line (your utility company can help) and how you want your fence positioned in relation to it.
- As a courtesy, review any fence plans with neighbors who share your property line to head off any future disputes.
- Select your fence type first so you can determine the available widths of each fence panel.
- Determine where you want to locate your gates and spray paint parallel lines to indicate the gate placement. Measure and document all gate sizes.
- Subtract the gate footage from the fence footage to figure the linear footage of the fence, then divide the linear footage of fencing by the panel length of the style fence you selected. This will determine the total fence panels or pickets you need. The remaining footage will require a partial panel. To calculate width when using pickets, determine both your picket width and spacing between pickets.
- For every panel and partial panel, add two to derive the total fence posts needed, and, if you are adding post caps, the number of post caps needed and any trim required.
2. Measure and Lay Out the Fence Posts
- Outline your proposed fence line with spray paint, then measure the outline of your fence perimeter with a measuring wheel.
- Use chalk lines as a guide.
- Position the fence posts every 6 to 8 feet along the line where you want the fence to stand. Make sure the spaces between the posts are consistent.
3. Dig Holes
With a post hole digger, dig holes approximately 33 percent as deep as they are tall (an 8-foot post needs a hole at least 2 1/2 feet deep), plus a few inches for gravel. Avoid utility lines and pipes. In colder climates, dig below the frost line.
4. Add Concrete and Gravel and Position Posts
- Once the holes are dug, pour 3 to 4 inches of gravel down the base of the hole for proper drainage.
- Add 6 to 8 inches of the concrete mix once the gravel is set.
- Position the post in the middle of the concrete mix, making sure to slope the concrete mix away from the post.
- Plumb post with a level.
- Follow the manufacturer’s instructions to allow for proper drying and curing time, which may take up to three days.
5. Attach Rails or Panels to Posts
- Once the concrete has cured, attach the wood fence rails or wood fence panels to the posts.
- Secure each rail with No. 8 2 1/2-inch deck screws or galvanized 10d x 3-inch nails. Power drills or claw hammers are effective tools for this step.
- Panels are typically faster to construct. If you are using panels, proceed to Step 7 once the panels are secured to the posts.
- If you use vinyl, chain link, or aluminum for your fence, use deck screws instead of nails.
6. Attach Pickets to Rails
- Once the rails are in place, begin attaching the pickets to the rails.
- Secure each picket with No. 8 2 1/2-inch deck screws or galvanized 10d x 3-inch nails. Screwdriver sets can be helpful in this process.
Tip: Individual pickets are often more attractive on slopes, allowing you to create a straight line across the top.
7. Attach Post Caps
- To finish building a fence, attach the post caps to the posts.
- Tap each cap lightly with a rubber mallet until each one fits snugly onto the post.
8. Stain or Treat the Wood
- After building a fence, staining or treating the wood can be the first step in proper maintenance that can extend its life.
- When the fence is in place, apply paint, stain, or a weather-proofing finish according to manufacturer’s instructions.
- Apply wood preservative around the base posts to prevent the wood from rotting.
- If the fence is built of pressure-treated wood, wait until the wood has fully dried before applying stain or finish. Pressure-treated wood should not need additional preservation or water-proofing.
- Apply new coats every 2 to 3 years, and be sure to clean the fence with wood or fence cleaner the day before application.
Learning how to build a fence can require careful planning and construction, but a DIY fence can improve your home’s appearance and security. If you’d prefer to have a professional to build a fence on your property, learn more about Home Depot installations.