Finely shred your cabbage, then add 1.5% salt (15g per 1kg chopped cabbage). Put in a bowl with whatever spices you like (I use 1/2 a hot red chilli, 2 tbsp mustard seed, and 2 tbsp juniper berries per kg of shredded cabbage) and knead until you get a fair amount of liquid - enough to cover your cabbage when it's compressed in your bowl.
Now fill the kraut into glass jars and keep pressing new layers into your glass jar (large pickling jars are good). Make sure that it's not filled completely to the top, but that you cover the last bit with some of the liquid. Put a bag made from cling film filled with baking beans, or some stones on top to keep the sauerkraut submerged.
Remove and foam from the top daily. If there is green foam, chuck the whole lot. The foam should be white.
After about 3-14 days, the fermentation should be far enough advanced that you can remove the last bit of foam and tightly close the lid, and put the jar into the refrigerator. The Sauerkraut is ready for consumption. The longer you ferment, the more acid the kraut gets, and the softer it will get.
This is not the traditional way (done in an earthenware pot with muslin, weights, etc., but it's a lot easier and works just as well.