If you've found a hermit crab on a beach or in the shallow waters of the Gulf of Mexico, there's a good chance it is a striped hermit crab (Clibanarius vittatus) or a close relative in the Clibanarius family. These hardy crabs can live for several days out of water, but they are not land crabs. If you already have a warm water marine tank, you can add your hermits and let them be a "cleaner crew" eating any food that hits the bottom of the tank. Otherwise, you will need to replicate a subtropical marine ecosystem.
Set up a tropical saltwater aquarium. Striped hermit crabs can grow up to 10 centimeters, so a 20-gallon tank or larger is good for one or two crabs. They need a deep sand bed in which to bury themselves when they molt, and will do well with some live rock for climbing and hiding places. They need filtration, a hang-on-back or canister filter is fine for a crab-only tank. Aim for a water temperature of 78 F with a pH close to 8.0 and a salinity between 1.024 and 1.027. Make sure your tank is properly cycled (has run for at least a week without animals to build up beneficial bacteria) before adding crabs.
Feed your crabs a variety of food. Alternate between sinking pellets and thawed frozen baitfish and shrimp, brine or krill. Feed two to three times daily in small amounts. They may also munch on algae growing naturally in the tank, or you can offer seaweed wafers or sheets. In the wild, they are opportunistic scavengers and in captivity will accept most aquarium-safe foods.
Add an assortment of clean, aquarium-safe seashells. The crab will move into slightly larger shells as it molts and gets bigger, so most of the shells should be slightly larger. It is not uncommon for a crab to decide to move into a slightly smaller shell on occasion, so provide a few of these as well.