If you live in an earthquake prone area, you need to strap down and secure your water heater so it won't fall over during a tremor. Here's how I secured mine; while you won't be able to replicate my setup exactly, hopefully this will inspire you to install, upgrade, or at least check and confirm that yours is safe.
Step 1: What an Earthquake Can Do
Most water heaters I've seen are held in place by their own weight and, perhaps, the water connections. In earthquake prone areas that's not enough. Think of shaking a table with a tall glass of water sitting on it, or check out these movies of simulated earthquakes:
See how the water heater just falls over?
You might be thinking that if there's a strong enough earthquake to tip over my water heater, I've probably got bigger issues. Perhaps true, but I don't want to add fire from broken gas lines and flood from broken water lines into the mix.
You'll note in the pictures, I've already installed a flexible gas line, and semi-flexible water lines. The water lines are ribbed copper pipes that have some flex to them.
Step 2: Get a Strapping Kit
When we moved in, the home inspector pointed out that the water heater wasn't properly strapped down and suggested that correcting it be made a condition of the sale. The previous owners just bought a strapping kit, left it on the water heater, and called it good. I'm actually glad they didn't do it, because they probably would have done a bad job.
Here's the kit: It's essentially some metal straps and fittings.
Step 3: Plan
My water heater is located in a corner, so I decided to attach the straps on perpendicular walls and snug the water heater into the corner.
Step 4: Mount the Straps
One of the walls is concrete and the other is drywall on studs. On the concrete wall, I hammer-drilled and install concrete anchors. On the stud wall, I pre-drilled and installed lag screws.
Step 5: Supports Behind the Water Heater
The water heater is a few inches from the walls, so cut some scrap 2x4's and 2x6's to fit behind it. The metal straps are threaded through two metal buckles screwed to this wood assembly. The straps then hold the assembly in place against the water heater.
Step 6: Shove the Support in Place
After much fussing and shoving, I managed to get the wood assembly behind the water heater. While half in position, I screwed in the second metal buckle. After threading the straps through the buckles and ensuring proper positioning, I screwed the top 2x6 into place.
Step 7: Tighten Straps
Tighten down the straps ensuring not to over-tighten and damage the water heater.
Previously my water heater had some play; it now feels rock solid.
Step 8: Just in Time!
Literally three hours after I finished this project, there was a magnitude 2.8 quake centered less then three miles from my house!:
It wasn't strong enough that the strapping was actually necessary, but made me feel really glad to have it complete.