A retaining wall holds back soil, either in a planting bed or on a slope or hillside. It can be built out of anything - from stone to wood to poured concrete - and it can significantly alter the contours of your yard or garden. These guidelines cover a low, reinforced wood wall. For anything stronger, you'll need a contractor.
Figure out where and why you want a wall: at the bottom of a gentle slope to create a new planting bed? Between two beds to provide contour and definition? (If the answer to this is "to keep my house from sliding down the hill" see Warnings below.)
Use a trowel, shovel or grub axe to chop out the cut (a combination of ditch and ledge) where your wall will start.
Cut 4-by-4 posts to a length equal to the height of your wall plus the amount they will be sunk into the ground; your building code will tell you how far they need to be sunk.
Dig holes for 4-by-4 posts at the inside base of your wall every 4 feet.
Lower the 4-by-4 posts into the holes.
Pour concrete around the posts to ground level.
Level the concrete. Allow to dry and cure for a week.
Cut boards (or buy pre-cut boards) - 2-by-6s or 2-by-12s are a good choice - to fit the length of your wall. For example, if you're building an 8-foot wall, you'll have sunk three posts - two 8 feet apart and one in the middle (at the 4-foot mark) - so you'll want to use boards that are 8 feet long. If the wall requires more than one length of board to reach from end to end, you'll need to measure carefully so that they'll meet in the middle of a post where they can be bolted for stability.
Bolt boards to posts using carriage bolts, placing the boards on the outside of the post (use at least two bolts per board-post intersection).
Dig a couple of 2-inch diameter tunnels under the wall for drainage using a trowel or screwdriver.
Fill the drainage holes with gravel.
Backfill the cut - the area behind the wall - with at least 6 inches of gravel at the bottom for drainage. Fill the remaining space with soil to the top.
If your yard's got drainage problems, you're probably best off consulting a contractor. Whatever you do, make sure water doesn't drain toward the foundation of your house.
A retaining wall is like a dam: the higher the wall and the heavier the soil behind it, the greater the pressure on the wall. Most retaining walls over 3 feet (2 feet in some areas) are thus subject to some kind of permitting process; this is taken more seriously in areas of seismic activity (where walls must be able to withstand shock loads in addition to everything else). Check your local regulations before you start.