Ask us about our referral incentive — refer a friend and save!
how to

How to Build a Retaining Wall for a Fence?

CURTIS K COLLINS11 min read read
How to Build a Retaining Wall for a Fence?

Quick Summary

To build a retaining wall for a fence, mark the fence line, check local permits and fence-on-wall code requirements, and call 811 before digging. Excavate a trench, add compacted gravel, then stack interlocking concrete blocks with drainage gravel behind them.

  • Call 811 before any digging so buried utility lines can be marked.
  • Confirm with the building department whether fence height is measured from the top of the wall.
  • Dig the trench 6 to 8 inches deeper than the first block and add 4 to 6 inches of compacted gravel.
  • Set a perforated drainage pipe at the base of the backfill, sloped toward an outlet, to carry water away.
  • Build and cure the wall before installing fence posts and panels.

Table of Contents

How to Build a Retaining Wall for a Fence?

Last Updated: November 9, 2026

Planning the Retaining Wall and Fence Location

Building a retaining wall for a fence is one of the most practical ways to add privacy and hold back a sloped yard, and The core idea is simple: the wall carries soil, and the fence sits on top of it. Getting the layout right first makes everything else easier.

Homeowner wearing work gloves leveling a concrete retaining wall block on a prepared gravel base trench
Homeowner wearing work gloves leveling a concrete retaining wall block on a prepared gravel base trench

Start by walking the property and marking where the fence line should run. Note where the ground drops, where the water flows during heavy rain, and where utility lines are buried. Call 811 before any digging so buried lines can be marked (811 Before You Dig).

Here is what to check before you pick a spot:

  • Slope direction: Walls work best where soil pushes against one side.
  • Drainage paths: Water should not pool behind the wall.
  • Property lines: Measure from known survey markers, not the existing fence.
  • Sun and access: Plan space for a wheelbarrow and a helper.

A common mistake is building the wall too close to the lot line. Leave room for the crew and for future maintenance on both sides.

Checking Local Permits and Fence-on-Wall Code Requirements

Permit rules for a fence on a retaining wall are set locally, and they vary enough that a design approved in one jurisdiction can be rejected in the next town over. The practical move is to verify the rules for your specific address before you buy a single block, because the wall height, the fence height, and the way the two are measured can each change what you are allowed to build.

Building departments generally regulate retaining walls by height, and fence height is usually regulated separately by zoning rules. Confirm the exact thresholds for your address with your local building department. The trap is that many codes measure the fence height from the grade at the base of the fence, which, on top of a retaining wall, means the wall height effectively adds to the total. Ask the counter staff explicitly: "Is the fence height measured from the top of the wall or from the original grade?" Get the answer in writing or by email.

Use this checklist when you call or visit the building department:

  • Wall permit threshold: At what height does the retaining wall itself require a permit, and does that height include the buried portion?
  • Combined height limit: Is there a maximum total height of wall plus fence, and how is it measured?
  • Fence height limit: What is the maximum fence height in your zoning district, and does the wall count toward it?
  • Setbacks: How far must the wall and fence sit from the property line, and does the setback differ for a wall that retains soil versus a freestanding fence?
  • Guardrails: Does the code require a guardrail on top of a retaining wall above a certain height, and does a fence satisfy that requirement?
  • Engineering trigger: At what wall height or soil condition does the jurisdiction require a licensed engineer's design or a soils report?
  • HOA and deed restrictions: Even where the city allows the design, a homeowners association or recorded covenant may impose stricter limits.

Watch out: a fence built on top of a wall is sometimes classified as a "structure" rather than a "fence," which can pull it into a different section of the code with different setback and height rules. Ask which classification applies before you finalize the layout.

Two more checks save rework. First, confirm whether the wall needs a grading permit or erosion-control plan, especially if you are changing drainage on a slope. Second, if the wall will be taller than about 4 feet and retains soil that supports a fence, a common pattern is for the building department to require a design by a licensed engineer; the fence adds wind load and the posts add point loads, and the reviewer will want to see that the wall was designed for them. Budget time for that review, plan reviews commonly take one to four weeks depending on the jurisdiction and the completeness of the submittal.

Keep a simple file with the ordinance excerpt, the permit application, the approved plan, and any inspection sign-offs. If you sell the home, that file answers the buyer's inspector's first question, and if a neighbor disputes the fence line, it is the document that settles it.

Choosing Materials and Measuring the Wall Layout

Concrete block is a common choice for walls that carry a fence. Other materials such as treated timber or stone have their own considerations.

Measure the wall length and height, then calculate materials with a small overage. Consider ordering a small amount of extra blocks for breakage or cuts. Mark the layout with stakes and a string line set at the wall's face, so you can see the straight line before excavation begins.

How to Build a Retaining Wall with Concrete Blocks

Concrete blocks with interlocking lips keep each course aligned and resist soil pressure well. Most small walls under three feet use a gravel base, a level first course, and stacked courses set back slightly toward the slope.

Excavating the Trench and Compacting the Base

Dig a trench about 6 to 8 inches deeper than the first block, and wider than the block by roughly 12 inches on each side. Remove the loose soil and check that the trench floor is level along the string line.

Add 4 to 6 inches of compacted gravel, then tamp it in layers with a hand compactor. A firm base is the single biggest factor in keeping the wall from settling and leaning.

Laying the First Course and Stacking Courses

Set the first course of blocks on the gravel base and check each one for level in both directions. Adjust with stone dust, not loose soil, so the block stays put.

Stack each new course slightly back toward the slope, following the manufacturer's setback guidance. Add a drainage gravel layer behind the blocks as you go. Check level and alignment after every two or three courses.

The article breaks the block-wall build into a few key stages, summarised below.

Step What to do Key detail
Excavate trench Dig 6 to 8 inches deeper than the first block Extend about 12 inches wider on each side
Add base Lay 4 to 6 inches of compacted gravel Tamp in layers with a hand compactor
First course Set blocks level in both directions Adjust with stone dust, not loose soil
Stack courses Set each new course slightly back toward the slope Check level every two or three courses

Building a Retaining Wall on a Slope and Installing Drainage

Sloped sites need extra attention to water. Water trapped behind a wall builds pressure that pushes it outward over time. A perforated drainage pipe set at the base of the backfill, sloped toward an outlet, carries water away.

Backfill the wall with clean gravel rather than native clay, and wrap the drain pipe in filter fabric so fine soil does not clog it. This drainage layer matters most at the point where the fence posts meet the wall.

Attaching Fence Posts to the Wall and Managing Loads

How the fence attaches to the wall determines whether the wall keeps doing its job.

Posts embedded behind the wall. The post is set in the soil or gravel backfill behind the wall, and the fence panel spans over the top of the wall. This is the most forgiving method structurally because the post load goes into the ground, not the wall.

Posts set into the wall. The post sits in a core or cell of the block system, and the cell is filled with concrete or compacted gravel. This gives a clean look with the fence directly on the wall line.

Surface-mounted or core-drilled posts. A base plate is anchored to the top of the wall with wedge anchors or adhesive anchors, or a post is core-drilled into the wall and set with epoxy. This is fast and keeps the fence line tight to the wall.

Whichever method you choose, size the posts and spacing to the fence height and the wind exposure. A 6-foot privacy fence in an open, windy site sees substantially more load than a 4-foot picket fence in a sheltered yard, and post spacing of 6 to 8 feet is common for privacy panels while 8 to 10 feet is common for lighter fences.

Water management at the fence-wall junction is where many otherwise sound projects fail. Every post penetration is a path for water into the wall. Seal post penetrations and keep the top of the wall sloped or capped so water runs off rather than pooling at the base of the posts.

Watch out: a common failure pattern is a surface-mounted post that pulls its anchors out after a few seasons of wind, taking a chunk of the cap block with it. If you see rust streaks, loose anchors, or a post that rocks when pushed, address it before the next storm season rather than tightening the anchors and hoping.

Finally, sequence the work so the wall is built and cured before the fence goes on. Concrete and mortar need time to reach strength, and drilling or anchoring into green concrete or fresh mortar weakens the connection. Build the wall, let it cure per the manufacturer's schedule, then set posts and panels.

Scheduling Your Wall and Fence Project with Fencementals

Coordinating the wall and the fence in one sequence saves time and avoids rework. Build and cure the wall first, then install the posts and panels. Plan access for the delivery truck and keep the work area clear of tools when the crew is not present.

Fencementals serves homeowners in the Midlands of South Carolina. Call (803) 513-8051 to request a quote, and browse the Best Residential Fence Contractors: 2026 Guide for background on choosing a contractor. If you need HOA sign-off first, read Handling HOA Fence Permit Requirements: A 2026 Guide. For a broader look at what a privacy fence involves, see Cost of Privacy Fence Installation: 2026 Pricing Guide.

For current pricing, visit the Fencementals pricing page or request a quote. To arrange a professional consultation before you start, read the fence consultation homeowner guide.

Frequently Asked Questions

What is the 1/3 rule for retaining walls?

The 1/3 rule is a common rule of thumb for retaining walls: the portion of the wall buried below grade should be roughly one-third of the total exposed height, so a 4-foot wall would be buried about 16 inches. It helps keep the wall stable against soil pressure. Because it is a rule of thumb rather than a code requirement, check your local building department and the block manufacturer's installation guide, since soil type, slope and wall height can change the embedment you need.

Can you put a fence on top of a retaining wall?

Yes, a fence can often go on top of a retaining wall, but the wall must be designed to carry the added load from the fence posts and wind. Posts are typically set in the top course with a core-drilled hole and secured with construction adhesive or rebar and grout, or mounted to a cap. Many jurisdictions treat a wall plus fence as a combined height, so confirm the maximum before you build.

Do retaining walls need drainage behind them?

Yes. Water pressure behind a wall is one of the most common causes of bowing and failure. Place a perforated drainage pipe at the base of the backfill, surround it with clean gravel, and add a filter fabric layer to keep soil from clogging the stone. Water management is especially important where the fence and wall meet, because runoff can concentrate there and soften the soil supporting the posts.

Ready for a new fence?

Serving the Midlands, SC area — get a free estimate today.

Get a Free Estimate