Hermit crabs need warm water - at least 75 degrees farenheit, but they can't get too hot or else they will die.
There has to be at least 75 percent humidity in the habitat.
They need sandy soil to bury themselves in to protect themselves from the sun.
They need a shell to live in as a defence against predators. They need gastropod (snail) shells specifically because of their body shape. However, there is competition for shells and of course, like most things, they're a limited resource. There also needs to be predators to eat the snails so that there are more empty shells in tact for the hermit crabs.
Hermit crabs fighting over a shell.
Climate
A tropical hermit crab needs an air temperature of at least 75°F, with no direct sunlight.
Food/Water
The tropical hermit crab needs access to warm salty water (they aren't freshwater crustaceons. They're not fussy eaters. They will eat anything from dead fruit, wood and leaf litter, to plants, grasses or items that are washed in by the ocean. This will probably increase their chance of survival in the wild, but it doesn't matter in captivity.
Special Facts
Hermit crabs enter the snail shell backwards with their feet/legs pointing out so they can fit in the shell and peek out, and also because their pincers poke out of the shell, but can be retracted if necessary.
Hermit crab retracted into a shell and using its claws to block the entrance.