In anaerobic fermentation, that is without air, having an airlock is key to the process. Certainly you can do some anaerobic ferments, like sauerkraut, with little more than a bag of brine and the sauerkrauts own brine to create an airlock. This can lead to kahms* yeast. Kahm’s yeast is awful looking, less tasty than our friend lactobacillus, and easily scooped off the surface. It’ll come back though.
Airlocks are cheap- around $1.50 USD at my local brew shop or about $1 when bought in a bulk pack of 12 on amazon. You can also purchase lids for mason jars and special gallon-sized containers with lids pre-drilled to hold an airlock. To get the airlocks to have a perfect airtight fit into the hole you need a silicone grommet. You drill a half-inch or so hole, fit the grommet in, and then slide the airlock in. I say half-inch because you want to start small and then work up as needed. I find that in thinner lids the grommet needs 1/2 inch, while thicker plastic it tolerates something a bit larger.
Going even further you can get special lids for mason jars that are made of silicone and have an integrated airlock.
I like the grommet and airlock method because I can use any container I can drill a hole into the lid for fermentation. This frees up my mason jars for preservation and lets me use recycled glass jars for fermenting. This also lets me match the size of the jar to my ferment. I recently snagged 4 quart-sized pickle jars. While I have plenty of quart-sized mason jars It’s nice to know that I can use those for canning rather than having them tied up for possible months as my hot sauces ferment.
I also create homebrew airlocks made of the one-way valves from coffee bags. carefully peel the valve off a coffee bag, peel off extra plastic and bag. Rinse it with water to get coffee oils off the airlock. You can measure the diameter with a caliper and then use a stepped drill bit to make a hole in the lid. After that use some food-grade silicone to fix it into place and seal the metal lid.
The best thing about these DIY lids, both with the one-way valve and with the o-ring is that they are easy and can be adapted to work with any type of lid. I’ve made both out of metal and plastic lids and they both work really well.
Airlocks and one-way valves keep air and pests out. From fruit flies to spores the locks keep pests out. Fruit flies and house flies are attracted to fermenting things like sauerkraut and wine. They get into your ferments and leave behind bacteria you don’t want and mold spores.
I plan a complete DIY post on making the homebrew oneway valve airlock.
*Kahm’s yeast is a generic term for a wide range of wild yeasts that grow on the top surface of your anaerobic lactobacillus ferments. In my experience, they tend to be white and somewhat fuzzy looking, or a glossy slippery but textured surface that looks like a kombucha pellicle.