Most hermit crabs live in shells. However, they do not produce them on their own but occupy the shells of other animals.

An excerpt from the article 22 facts about crustacean

Some hermit crabs do not inhabit shells at all but live, for example, in rock crevices or burrows. An example of such a species is the palm crab, which is a terrestrial animal and only at the larval stage lives in water and takes up residence in snail shells.