Crabs are great additions to the right tank. They are great for keeping your tank clean of algae and detritus. Be sure to check out the crab before you purchase them because some are known to eat fish and some are reef safe while most are not. Crabs go through a molting process where the shed their outer shell and either grow one back or find a bigger shell in your tank.
They will need plenty of places to hide from predators and they also like to sift through your sandy substrate, which is a great way to oxygenate your sand. Crabs are Omnivores and will eat algae, plankton, bacteria, detritus, worms, and meaty marine food left over in the tank.