Because the crab has a hard shell and is thus self-protective, in dreams this quality can be highlighted. When someone is ‘crabby’ they are irritable or morose.

The crab apple is small and sour and therefore has this same connotation.