In nature, all fish have adapted to the chemistry of their home waters. Sometimes, a fish hobbyist's tap water doesn't match these conditions, and the fish suffer. Many fish, including livebearers and Rift Valley cichlids, need hard alkaline water. You can raise aquarium water hardness a few different ways.
What Is Hardness?
In an aquarium, hardness is measurement of dissolved minerals in water, mostly calcium and bicarbonates. These minerals tend to buffer the pH of water, making it resist changes in pH. Because of this, most aquarium fish who prefer hard water also like their water with a higher pH. Never use water softened by home water softeners for aquariums, even for soft-water fish. Home water softeners replace calcium and bicarbonates with other minerals, making it even less like the water that a fish would encounter in the wild.
You can passively raise the hardness of water with certain decorations. Crushed coral sand and calcium-rich rocks like tufa rock and limestone can raise the hardness of aquarium water by slowly leaching minerals into the water that harden it. For this reason, these rocks and substrates are popular for saltwater tanks and African cichlid aquariums. Avoid driftwood for such tanks, since many driftwood types have the opposite effect on water, releasing organic acids and absorbing minerals.
You can raise the hardness of aquarium water with chemical additives. Pet shops sell commercial additives, but you can make your own. Dissolve 1 teaspoon of baking soda, 1 teaspoon of Epsom salt and 1 teaspoon of rock salt in 5 gallons of dechlorinated water. Slowly add this water 1 cup at a time while testing the hardness and pH between cups. You can get test kits at pet shops. The exact amount you will have to add will vary with existing water conditions and the volume of your tank.
Avoid sudden changes to water chemistry. Fish react poorly to sudden changes in water chemistry, even changes toward better conditions. Never change the hardness by more then 1 degree of hardness per day. If you don't have a test kit specifically for hardness, you can gauge pH to get a rough idea of how much you're changing the hardness. Never change the water pH by a factor of more than 0.2 per day.