Wash the crab carefully, scrubbing the shell.
Slice the onion, slice the ginger thinly. Chop the tender part of the lemongrass (usually 1/3 of the lemongrass stalk, near the bottom).
In medium deep saucepan, put the crab in. Scatter the onion, ginger and lemongrass around it and on top. Pour in the can of beer. Cover the pan. Cook on high heat for 5 minutes then around 10-15 minutes on medium heat, depending on the size of the crab.
In the meantime, prepare the dipping sauce. Squeeze juice of 2 limes, add salt and pepper. Optional: you can add a teaspoon of fish sauce, chopped chili and garlic to the dipping sauce.