Mix cabbage, onion, sea salt, and garlic together in a bowl. Firmly pack mixture into a large, clean, food-grade plastic bucket or a crock. The cabbage will start to make its own brine as the salt starts to draw out the water of the cabbage.
Fill a large, clean, food-grade plastic bag with water and place over the salted cabbage mixture so none of the cabbage is exposed to air. The cabbage should be submerged in the brine when you put the plastic bag of water on top to weigh it down.
Allow cabbage to ferment in a cool, dry place, 1 to 4 weeks (depending on how tangy you like your sauerkraut). The temperature of the room you ferment the sauerkraut in should not rise above 70 degrees F (21 degrees C).