Building a Retaining Wall: Soil, Footings, Drainage and Backfill
Retaining walls rarely fail because the block or timber was too weak. They fail because water built up behind them, because the base could not handle the ground or the frost, or because the backfill was dumped in rather than compacted. This page is about the parts you never see once the job is done, and they are the parts that decide whether the wall is still standing in 20 years.
General principles, not a design, and no structural calculations are given here. A safe wall depends on height, soil, groundwater, frost depth and loads above it. Tall walls, walls near the house or below a driveway, and walls near a property line should be designed by a licensed engineer and built by an experienced contractor. Many jurisdictions require a permit, and often an engineer's plans, for walls over about 4 ft (some set the limit lower), so check with your building department, and call 811 before you dig. Part of the PlantMapper Retaining Walls section.
The drainage stone behind the wall is what keeps it standing · photograph via Pexels
What this guide is, and is not
Principles, not calculations
This guide explains what every retaining wall has to get right: how the ground underneath carries the load, how water is kept from building up behind it, how the soil behind it goes back in, and how the drop at the top is made safe. It is written so you can judge whether a plan, a contractor's bid or a block manufacturer's detail makes sense.
It deliberately contains no structural calculations and no design tables. Wall thickness, footing size, reinforcement and geogrid all depend on how much soil the wall holds back, the soil type, groundwater, your frost depth and whatever sits on the ground above, and those are specific to your lot. Those numbers should come from a manufacturer's published installation guide, an experienced contractor or a licensed engineer.
Get professional advice from about 2 to 3 ft of wall height upward, and for any wall supporting a driveway, parking or a building, any wall near a property line or holding up a neighbor's yard, and any wall on old fill, expansive clay, loose sand or wet ground. Those are not rare edge cases; they are where retaining walls actually fail.
Understanding the forces
Why retaining walls fail
Four things push a retaining wall over, and knowing them explains every construction detail that follows.
Water pressure and frost
By far the most common cause
Soaked soil pushes much harder than dry soil, because the wall is now holding back water as well as earth. That water pressure (hydrostatic pressure) builds against the back of the wall and shoves it forward. In cold regions, trapped water also freezes and heaves.
That is why the drainage stone, the drain pipe and the weep holes matter more than the wall material.
A wall that stood for 20 years and then bulged has usually had its drainage clog with silt.
Free-draining walls such as gabions and dry-laid stone largely sidestep the problem.
On expansive clay, common in Texas, Colorado and parts of California, it is worse still.
A weak base or footing
Settling and tipping
The wall carries its own weight plus the sideways push, and the base has to spread that into ground that can take it. Too small, too shallow or on soft ground, and the wall settles unevenly or rotates forward.
Footing size and depth depend on the soil, so they must come from a design or a system guide.
Building on topsoil, old fill or construction debris is a guaranteed failure.
Expansive clay shrinks and swells with the seasons and can move a shallow footing.
Frost heave lifts anything that sits in the frozen zone, so rigid footings go below the local frost line.
Loads above the wall
The load people forget
Anything on the ground behind a wall adds to the sideways push (engineers call it surcharge), and vehicles and buildings add a lot. A wall built for a flower bed will not hold up a parked pickup.
Patios, sheds, hot tubs, a slope above and a second wall above all add load.
Driveways and parking are a different league; always a licensed engineer.
Decide what will be above the wall now and ten years from now, and design for it.
Soil dumped in loose behind a wall settles for years, pulling at the wall or leaving voids that fill with water. Clay backfill is worse still, because it swells when wet and holds water.
Backfill goes in in thin layers (lifts), each compacted, not all at once.
Clean crushed stone right behind the wall, not the clay you dug out.
Compact parallel to the wall, not by driving equipment hard against it.
Filter fabric between the drainage stone and the soil so fines cannot migrate in.
What you are building on
Checking your soil and site
A retaining wall design is a response to the ground. Checking it is the cheapest thing you will do on the whole project and the thing most likely to change the answer.
Call 811, then dig a test hole on the wall line
Call 811 (or file online) a few business days ahead so buried utilities are marked. Then dig down at least as deep as the likely footing or base, and deeper if you can. You are looking for what the soil actually is, how deep the topsoil goes and where firm, undisturbed soil starts.
On a long wall, dig in more than one spot. Soil changes more than people expect over a few yards.
Watch what the hole does overnight
Leave it open and look again the next morning, and again after a heavy rain or snowmelt. A hole that fills with water means a high water table or groundwater moving through the slope, and that changes the design completely.
Water in a test hole is a reason to bring in an engineer, not a detail to work around.
Identify the soil type
Clay holds water and, where it is expansive, swells and shrinks with the seasons and pushes hard when wet. It needs extra care with both footing depth and drainage.
Sand and gravel drain well but can run when saturated and cave in an open cut.
Silt is treacherous when wet. Caliche and shallow rock, common in parts of the Southwest and the hills, are firm but hard to dig and can trap water on top.
Fill (old dirt, rubble, yard waste, a filled-in pool or pond) is not a foundation. Dig through it or get advice.
Look for the things that mean stop
A spring or running water in the hole. Old drain lines, a dry well or a septic field. Tree roots of any size. Utility lines. Fill of unknown depth. Signs of earlier slope movement, such as a lumpy slope, tilted trees or leaning fence posts.
Any of these means get advice before going on, rather than working around it.
Treat the excavation itself with respect
Cuts for retaining walls are dangerous. Trench and cut walls collapse without warning, especially in sand, silt, wet ground and fill, and even a shallow collapse can trap and injure someone. OSHA requires work crews to use protection such as shoring or sloped sides in trenches 5 ft deep or more, and collapses happen in shallower ones too.
Never work in an unsupported cut deeper than you are comfortable with, never work alone in one, slope the sides back or support them, and keep spoil piles and machines well back from the edge. Where the cut is deep or the ground is poor, this is a job for a contractor with the right equipment.
Check what the digging might affect
Digging near a house, a wall, a fence or a property line can undermine it, and you may be responsible for damage to a neighbor's property. Confirm the property line from your survey or plat before you dig near it, and talk to the neighbor early.
Big trees near the cut need an arborist's advice, and some cities protect certain trees by ordinance, so check before you cut roots.
What holds it up
Footings and base
The footing or base does two jobs: it spreads the weight into ground that can carry it, and it resists the wall being pushed forward or tipped over. Its size, depth and reinforcement come from the design, not from a rule of thumb.
✓Principles that apply to every retaining wall
Bear on firm, undisturbed native soil, never on topsoil, fill or rubble.
Rigid walls (poured concrete, mortared block, brick and stone) need footings below the local frost line, which ranges from a few inches in the Deep South to 4 ft or more in the northern states. Your building department publishes the local figure.
A concrete footing is normally wider than the wall, often projecting in front as a toe to resist tipping.
It must be level and continuous, stepped rather than sloped where the ground falls away.
Concrete strength, thickness and rebar should come from the design or the manufacturer's guide.
Let the concrete cure before building on it and before backfilling behind the wall.
!Common footing mistakes
Setting the base in topsoil because digging deeper was hard work.
A footing no wider than the wall, with no toe.
Sloping the footing to follow the ground instead of stepping it in level sections.
Building on the concrete before it has gained strength.
Backfilling behind the wall the same day it is built.
Assuming a number from an online forum fits your soil; footing depth responds to your ground and your climate, and only a site-specific design gets it right.
Segmental retaining wall block and gabions are usually built on a compacted crushed-gravel leveling pad rather than a concrete footing, with the first course buried below grade. That works because the systems are flexible and drain freely, and it is part of a designed system with a published guide. Follow it exactly, including the pad depth, the gravel type and the compaction, and do not swap in a cheaper material.
The single most important detail
Drainage behind the wall
More retaining walls fail from water than from everything else put together. Soaked soil pushes much harder than dry soil, and frozen soil heaves. The whole job of the drainage system is to make sure the ground behind the wall never gets saturated.
Put a free-draining zone against the back of the wall
A layer of clean, angular crushed stone with no fines (often sold as 3/4 in clean stone or #57 stone), at least 12 in wide, against the full height of the back of the wall.
It gives water a fast path straight down to the drain pipe instead of building up against the wall. The exact width and stone should follow the design or the system guide.
Separate it from the soil with filter fabric
A non-woven geotextile (filter fabric) between the drainage stone and the soil behind it stops fine particles washing into the stone and clogging it.
This is the detail that decides whether the drainage still works in 20 years. Without it, silt slowly fills the gaps in the stone and the wall starts holding water, which is why so many walls fail long after they were built.
Overlap the fabric generously and fold it over the top of the drainage stone as well as up the back.
Run a perforated drain pipe along the base
A 4 in perforated pipe along the length of the wall at the bottom of the drainage stone, holes facing down, bedded in clean stone (and wrapped in fabric where the soil is fine), collects the water and carries it away.
It needs to slope along its length, commonly at least about 1/8 in per foot, and it needs somewhere to go. A drain with no outlet is not a drain.
Send the water somewhere legitimate
Run the pipe to daylight further down the slope, a dry well, a rain garden or another suitable outlet on your own property. Never onto a neighbor's lot, never into a septic system or sanitary sewer, and check local rules before tying into the street or a storm drain.
On tight clay a dry well may not drain; test how fast water soaks away before relying on one. See French Drains & Dry Wells.
Damp-proof the back of a solid wall
Poured concrete, block, stucco, brick and mortared stone all suffer from wet soil sitting against them: staining, white efflorescence, freeze damage and peeling stucco.
A damp-proofing coating, a waterproofing membrane or a dimpled drainage board on the back face protects the wall. It is not a substitute for the drainage stone; you need both.
Handle surface water above the wall too
A wall across a slope dams the water running down it. Catch that water before it reaches the soil behind the wall with a swale, a shallow gravel trench or a channel drain across the slope above.
Slope the ground at the top slightly away from the edge, point downspouts away from the wall, and make sure any patio above drains away from the wall rather than toward it.
Clean, angular stone with no fines: the drainage zone is no place to save moneyWater that cannot get away is what pushes a retaining wall overCatch surface water above the wall before it reaches the soil behind it
As an Amazon Associate, PlantMapper may earn from qualifying purchases. Prices and availability are set by Amazon. No structural sizes are given here. Design depends on height, soil, frost depth, drainage and loads above; tall walls, and any wall supporting a building, driveway or a neighbor's yard, should be designed by a licensed engineer.
Putting the ground back
Backfill and compaction
What goes behind the wall, and how it goes in, matters almost as much as the wall itself. Backfill is where slow, quiet failures begin.
Backfill materials behind a retaining wall.
Material
Where it belongs
Notes
Clean crushed stone, no fines (3/4 in clean, #57)
The drainage zone right behind the wall, and in segmental block cores
Free-draining; the whole point is that water passes straight through
Granular fill (as specified)
Behind the drainage zone in a designed or geogrid wall
Follow the spec; the type and the compaction are both part of the design
Native soil you dug out
General fill, well back from the wall
Only if it is sandy or gravelly and drains, and compacted in lifts
Clay
Not against the wall
Holds water, swells when wet and pushes hard. Keep it back and drain it
Topsoil
The top 6-12 in only, for planting
Not structural. Never use it as bulk backfill
Construction debris and broken concrete
Nowhere behind a retaining wall
Leaves voids, settles unpredictably and can tear the filter fabric
Sod, roots, wood scraps, yard waste
Nowhere behind a retaining wall
It rots, leaving voids that fill with water and sink
✓How backfill should go in
In lifts, each compacted before the next goes on. The lift thickness comes from the spec; commonly 6 to 8 in for granular fill.
Compact with a plate compactor or a jumping jack, working parallel to the wall rather than into it, and keep heavy compactors a few feet back from the wall face.
Keep skid steers and other heavy machines out of the zone right behind the wall; equipment is itself a load on a new wall.
Raise the drainage stone and filter fabric with the backfill, not afterward.
Let a poured or mortared wall cure before backfilling. Backfilling fresh masonry or green concrete is a classic way to push a new wall over.
Finish with topsoil only in the top 6 to 12 in, sloped away from the edge.
!What goes wrong
Dumping the spoil straight back in, unlayered and uncompacted. It settles for years.
Putting the clay you dug out right against the back of the wall.
Burying sod, roots, lumber scraps and packaging in the backfill, which then rot.
Driving a loaded skid steer right up to the back of a new wall.
Backfilling before the concrete or mortar has cured.
Forgetting to bring the filter fabric up as the fill rises, so the drainage stone silts up from day one.
Letting water out
Weep holes and outlets
Weep holes are the visible half of the drainage system on a solid wall. They let water that reaches the drainage stone escape through the face instead of building up behind it.
✓Getting weep holes right
Set them just above finished grade on the low side, so they can actually drain.
Space them evenly along the wall, commonly every 4 to 8 ft, following the design or system guide.
Use a weep vent, an open head joint or a short length of pipe through the wall, with the back of each in contact with the drainage stone.
Back each one with filter fabric or stone so soil does not wash out through it.
Add more low down where the wall holds back a lot of soil, or where water is known to move through the slope.
Make sure the water has somewhere to go: a gravel strip, a channel or a drain, on your own property.
!Weep holes are not enough on their own
They only work if there is free-draining stone behind them for water to reach.
They are the outlet, not the system. The drain pipe at the base does most of the work.
They clog with silt, moss, leaves and soil, and need checking. See maintenance.
A wall with weep holes and no drainage stone will still fail; a wall with drainage stone and a properly outletted drain pipe can manage with fewer.
Gabions, dry-laid stone and segmental block drain through their joints, which is why they cope so well with water.
A dark stain or green growth below a weep hole is normal; it means it is working.
The wall itself
Construction principles for low backyard walls
These are the principles behind a low wall built to a manufacturer's guide or a contractor's design. They are not a substitute for that design, and none of them tells you how thick to build or how deep to dig.
Principles that apply to all of them
Lay out and step the base level. On sloping ground, the footing or leveling
pad steps up in level sections; it never slopes with the ground.
Lean the wall back into the slope (a batter) where the design allows. It resists
the forward push and still looks upright if the wall settles a little.
Build the drainage as you go. The stone, the fabric and the drain pipe go in
with the wall, not after it.
Let each stage gain strength before loading it. Mortar and concrete both need
time.
Do not backfill early. It is the most common way a new wall gets pushed out of
line.
Stick to the spec. Whether it comes from a manufacturer, a contractor or an
engineer, the dimensions and materials are the design.
Timber walls
Landscape timber walls built a lot of American terraces, and they are the type most often
built badly, because stacking timbers looks like the whole job.
Use ground-contact pressure-treated lumber (UC4A or UC4B on the tag) and seal every cut
end with end-cut preservative.
Lay timbers flat, stepping each course back slightly into the slope; on edge they
need heavy vertical support.
Courses must be fastened to each other with long timber screws, spikes or rebar,
and lapped like brickwork.
The wall needs anchoring: deadmen (timbers running back into the slope, tied to a
crosspiece), posts set below the frost line, or rebar driven into the ground. The layout
should come from a supplier's detail or a contractor.
Put filter fabric against the back so wet soil does not sit on the wood, and include
the drainage stone and drain pipe as with any other wall.
Avoid old creosote railroad ties: they are not recommended near food gardens,
play areas or seating and they bleed tar in hot weather.
The dry-stacked concrete block sold at home improvement stores and landscape suppliers,
with a published installation guide. The most DIY-friendly engineered option, as long as
the guide is followed exactly.
The first course is everything. It sits on a compacted crushed-gravel leveling
pad, perfectly level and buried below grade, and every course above inherits any error.
Follow the manufacturer's height limits, and remember they assume nothing heavy
on top: a patio, shed, slope or driveway above takes you outside them.
Blocks step back as they rise (the setback gives the wall its batter). Never build them
plumb unless the system is designed for it.
Use the specified drainage stone and backfill; swapping in fill dirt is the usual
failure.
Taller walls in these systems use geogrid layers laid into the compacted backfill at
set heights and lengths. That is an engineered design, not an optional extra.
Fill hollow block cores with clean stone where the guide says to, and glue the caps
down with exterior masonry adhesive.
Gabion walls
Free-draining, forgiving and well suited to a wet slope, but the quality of the wire
and the care taken filling them decide whether they last thirty years or ten.
Prepare a level, compacted gravel base. Gabions tolerate small movement but not a soft
spot.
Lace or clip the baskets together along every edge, and fit the internal
bracing wires. Unbraced baskets bulge into pillows.
Hand-place stone at the face for looks and pack it tight. Loose fill settles and the
basket sags.
Use angular stone too big to pass through the mesh, and keep the fill clean.
Put filter fabric behind so the soil cannot wash out through the stone.
Step the courses back as they rise, into the slope, rather than stacking them
straight up.
Safety at the top
Guards where there is a drop
A retaining wall creates a drop, and a drop is a hazard, especially where people walk past the top in the dark, and especially with kids in the yard. Plan for it at the design stage instead of bolting something on later.
✓When a guard should be considered
Wherever the drop from the top of the wall is significant, especially beside a path, patio, steps or door.
Anywhere people will walk close to the edge, or after dark.
Where children play, or anyone with limited sight or mobility uses the yard.
Beside a route used with a wheelbarrow, a mower or a wheelchair.
Many codes require a guard where a walking surface is more than about 30 in above the grade below, and some apply that to retaining walls beside walkways; check with your building department.
On any wall where the top edge is hard to see; a drop hidden by plants is more dangerous, not less.
!What a guard can look like
A railing anchored into the wall structure or its own footings, not into the cap alone.
A fence set back from the edge, which is often simpler and looks less institutional.
A dense planted barrier along the top; attractive, but slow to fill in and not a physical restraint.
A raised bed or wide planter along the edge, which puts distance between people and the drop.
A wide seat cap that reads clearly as an edge and slows people down.
Good landscape lighting on any path past the top of a wall, and a clearly visible edge.
A guard attached to the wall has to be anchored into something structural; a railing bolted only into a cap will pull out. And a barrier a child can climb is not much of a barrier. If the drop is significant and kids use the yard, get advice on the guard as well as the wall, and check pool-barrier rules if the wall is near a pool.
Knowing the limit
When you need an engineer or a specialist contractor
A low terrace on good ground with proper drainage is within reach of a careful DIYer or a general landscaper. Several very common situations are not, and it is worth recognizing the difference before anything is dug.
✓Usually fine without a custom design
A wall up to about 2 ft on firm, well-drained ground with nothing loading the top.
A segmental block or gabion system built strictly within the maker's published limits and guide.
Low timber terraces built to a supplier's detail, well clear of property lines and buildings.
Terracing a gentle slope into several low steps rather than one tall wall.
Repairs to caps, mortar joints, weep holes and drain outlets on a sound wall.
Planting, capping and finishing work on an existing wall that is not moving.
!Get a licensed engineer
Any wall over about 4 ft (where many jurisdictions require engineering and a permit anyway), and get advice from about 2 to 3 ft up.
Any wall supporting or close to a building: house, garage, addition or shed foundation.
Any wall with a driveway or parking above it. Vehicle loads are a different league.
Any wall on or near a property line, or holding up a neighbor's yard, plus a check of the survey and any easements.
Poor ground: fill, expansive clay, loose sand, silt, a high water table, a spring, or a test hole that fills with water.
Any existing wall that is leaning, cracked or bulging, before you touch it.
Any wall where two terraces are close enough that the upper one loads the lower.
Anywhere you are unsure. An engineer's design for a residential wall typically costs a few hundred to a couple of thousand dollars; a rebuild often costs far more.
Avoid these
Six construction mistakes
The ones that make retaining walls lean, bulge and fall, roughly in order of how often they do it.
1. No drainage behind the wall
The most common cause of failure by far. Soaked soil pushes much harder than dry soil, and in cold regions it freezes and heaves; a wall with nowhere for water to go is holding back soil and water together.
The fixA clean crushed-stone zone against the back of the wall, filter fabric between it and the soil, a perforated drain pipe at the base sloped to a real outlet, and weep holes where the wall type needs them. All of it, not some of it.
2. Leaving out the filter fabric
Without fabric between the drainage stone and the soil, fines wash into the stone and clog it. The wall drains well for a decade, then quietly stops, which is why so many walls fail long after they were built.
The fixOverlap a non-woven filter fabric generously between the soil and the drainage stone, and fold it over the top of the stone as well as up the back.
3. Building on the wrong ground
Building on topsoil, fill, debris or a filled-in pool guarantees uneven settling and forward tipping, whatever the wall is made of. A rigid footing above the frost line gets heaved as well.
The fixDig a test hole first, bear on firm undisturbed soil below the topsoil, put rigid footings below the local frost line, and take the size and depth from a design or system guide rather than a rule of thumb.
4. Dumping the backfill in loose
Uncompacted backfill settles for years, tugging at the wall or leaving voids that fill with water. Putting the excavated clay against the wall makes it worse, because clay swells.
The fixPlace backfill in lifts and compact each one, working parallel to the wall. Use clean stone right behind it, and keep clay, topsoil, debris and anything organic out entirely.
5. Backfilling too soon
Loading fresh masonry or green concrete pushes a new wall out of line before it has any strength, and it happens in the end-of-job rush more than anything else on this list.
The fixLet mortar and concrete cure before backfilling, and keep compactors and machines away from the zone right behind a new wall.
6. Ignoring the drop at the top
A retaining wall creates a fall, and one hidden by plants or unlit at night is genuinely dangerous, especially with kids in the yard.
The fixPlan the guard from the start (a railing anchored into the structure, a set-back fence, a raised bed or dense planting along the edge) plus lighting, and check with your building department whether a guard is required.
Print or tick as you go
The construction checklist
Fifteen checks from test hole to finished wall. Your ticks are saved in this browser only.
Site and design
Drainage
Backfill and finish
Questions
Building a retaining wall: your questions answered
Eight answers to the questions that come up most.
Why do retaining walls fail?
Four main causes, and water is by far the biggest. Soaked soil pushes much harder than dry soil, so a wall with no drainage, or with drainage that has clogged with silt, is holding back soil and water together, and in cold climates that water freezes and heaves. The other three are a base or footing too weak for the ground, a load above the wall it was never designed for (a driveway, a patio, a slope), and backfill dumped in loose instead of compacted in layers. Notice that none of them is the wall material.
What drainage does a retaining wall need?
A complete system, not one piece of it: at least 12 in of clean crushed stone against the full height of the back of the wall, filter fabric between that stone and the soil so fines cannot clog it, a 4 in perforated drain pipe at the base sloped to a real outlet on your own property, and weep holes or open joints through the face where the wall type needs them. Solid concrete and masonry walls should also be damp-proofed on the back. Leave out any one part and the wall is at risk.
How deep should a retaining wall footing be?
It depends on the soil, the height, the loads and your local frost depth, which is why this guide gives no single number. The principle is universal: bear on firm, undisturbed soil below the topsoil, and for poured concrete and mortared walls, below your local frost line, which ranges from a few inches in the Deep South to 4 ft or more in the northern states. Segmental block walls usually sit on a compacted gravel leveling pad with the first course buried instead, as the maker's guide specifies. Your building department can tell you the local frost depth; the footing size should come from an engineer, a contractor or the system's published guide.
What should I backfill behind a retaining wall with?
Clean, angular crushed stone with no fines (often sold as 3/4 in clean or #57 stone) right behind the wall, with filter fabric between it and the soil, then granular fill placed and compacted in lifts of about 6 to 8 in. Keep clay away from the wall, because it holds water and swells. Never backfill with topsoil, construction debris, sod, roots or anything organic: debris leaves voids, and organic material rots and leaves hollows that fill with water. Topsoil belongs only in the top 6 to 12 in, for planting.
What are weep holes and do I need them?
Weep holes are openings through the face of a solid wall, just above the ground on the low side, that let water in the drainage layer escape instead of building up behind the wall. They are commonly spaced every 4 to 8 ft, as the design or system guide says, and backed with filter fabric or stone so soil does not wash out. They are worth having on solid concrete and masonry walls, but they only work if there is free-draining stone behind them, and they are the outlet, not the whole system. Segmental block, gabions and dry-laid stone drain through their joints.
Can I build a retaining wall myself?
A low wall up to about 2 ft, on firm, well-drained ground with nothing heavy above it, built to a segmental block maker's guide or a supplier's detail: yes, if you are a careful DIYer. From about 2 to 4 ft, hire an experienced hardscape contractor and stay well inside the system's limits. Over about 4 ft, or with a driveway, building, slope or property line involved, or on poor ground, it should be designed by a licensed engineer, and many jurisdictions require a permit. Always call 811 before you dig.
Is digging for a retaining wall dangerous?
It can be. Trench and cut walls collapse without warning, especially in sand, silt, wet ground and old fill, and even a shallow collapse can trap someone. OSHA's rules for work crews require protection such as shoring or sloped sides in trenches 5 ft deep or more, and collapses happen in shallower ones too. Never work alone in an unsupported cut, slope the sides back, keep spoil and machines away from the edge, call 811 first, and remember that digging next to a house, wall or fence can undermine it.
Do I need a railing on top of a retaining wall?
Think about one wherever the drop is significant, especially beside a path, patio, steps or door, anywhere people walk near the edge or in the dark, and anywhere children play. Many building codes require a guard where a walking surface sits more than about 30 in above the grade below, and some apply that to retaining walls next to walkways, so check locally. A guard need not be a railing: a fence set back from the edge, a raised bed along the top or dense planting can work, but whatever you use must be anchored into something structural, not just the cap.