How close to a house can a fence be?

You can usually place a fence as close as 6 inches to 3 feet from a house, depending on local rules and the type of fence you’re installing. In the Bay Area, homeowners in neighborhoods like Palo Alto, Oakland, or Walnut Creek often leave a small gap for maintenance, drainage, and air circulation.


Why Distance Matters


Putting a fence too close to your house can cause problems over time:

  • Moisture buildup: Water can get trapped between the fence and house, leading to wood rot or mildew.
  • Maintenance access: Leaving at least a small gap makes it easier to paint, clean, or repair siding.
  • Code and utility checks: Many cities require space to access electrical meters, gas lines, or vents.

Local Bay Area Guidelines


While rules vary, a few common practices in California include:

  • Setbacks: Many cities like San Jose or Berkeley ask for at least 6 inches to 1 foot between the fence and house walls.
  • Height limits: If your fence is tall and close to the house, you may need a permit from local building authorities.
  • Material choice: Metal or vinyl fences can go closer because they don’t rot, while wood usually needs a gap to avoid moisture damage.



Tips for Installing Fences Close to a House


  1. Measure carefully: Mark the gap with spray paint or stakes before digging post holes.
  2. Check local codes: Each city in the Bay Area may have slightly different rules. Oakland, Berkeley, and San Mateo have their own zoning requirements.
  3. Plan for maintenance: Even a 6-inch gap lets you reach the siding or trim for cleaning.
  4. Protect the base: Gravel or concrete along the house side can prevent soil moisture from damaging a wooden fence.