There are several key factors in creating the ideal crabitat. The first factor is tank size. The ideal amount of recommended space is 10 gallons per hermit crab. So if you have a 20 gallon tank, you can house two or three (smaller) hermit crabs comfortably. Make sure you have an air tight, glass lid to top the crabitat in order to keep humidity and heat inside. Don't worry, hermit crabs breathe through gills and need the moisture to breathe properly. There is enough circulation through daily opening and closing to clean and feed.
The second factor is substrate. The recommended depth of substrate is six inches, or four times the size of your largest hermit crab. This ensures that your hermit crabs can dig deep enough to molt comfortably. In order to do this, the right substrate texture is important. Five parts play sand to one part eco earth creates just the right texture with a little bit of water to dampen it. The result should be a "sand castle" consistency, which is perfect for them to create tunnels that won't collapse (which would happen with eco earth only). Play sand is easily found at local hardware stores like Lowes for $3.50 for 50 pounds. Reptile calcium sand is not recommended as it hardens into a cement like state once wet.
The third factor is water. There are two types of water crucial to hermit crabs, freshwater and saltwater. You can use a gallon of distilled water or sink water treated with ocean prime conditioner to remove the chemicals. The saltwater is also easily made by mixing a gallon of distilled water with 1/2 cup of instant ocean. Hermit crabs love the water and may spend up to 30 minutes soaking in the pool. The water dishes should be deep enough for your largest hermit crab to fully submerge. Use mesh, vines, etc to make sure your hermit crab can get back out. Another addition to the water pools is air stones/bubble stones. Air stones prevent the water from becoming stagnant and many hermit crabs enjoy the bubbles.
Creating a stimulating and safe environment is the fourth factor. Hanging vines and branches, attaching egg crate to the crabitat, and using textured backgrounds all allow your hermit crabs climb as they love to do. Provide a hamster wheel and pieces of cholla wood to explore. In the wild hermit crabs can walk miles in one day so having as many opportunities for them to climb and explore is important. Having hiding places is also crucial as hermit crabs are prey animals and need to feel secure. Use coconut huts or flower pots tilted on their side for hermit crabs to venture into and feel safe.
The fifth factor is humidity and heat. The water in the water pools naturally create moisture in the air while heating pads (found in the reptile section) keep the crabitat at an ideal temperature of 75-85 degrees and humidity level of the same 75-85. The heating pads should only be placed above sand level as a molting crab may get to close if a heating pad were below the substrate.