In survival and prepping type situations, keeping food from bacterial contamination is an important consideration. This applies to food in long-term storage, as well as food in your pantry, refrigerator, or freezer. To avoid food spoilage and possible food poisoning from bacteria, you need to know three things: (1) which conditions promote bacterial growth, (2) which conditions inhibit bacterial growth, (3) and which conditions kill bacteria.
Bacteria in food is a fact of life. Your food is not completely sterile, nor does it need to be. In most cases, what causes food poisoning is not the mere presence of bacteria, but the presence, in sufficient quantity, of pathogenic bacteria (bacteria that cause illness in humans). So to prevent food poisoning, you can prevent contamination in the first place, or kill the bacteria with cooking, or prevent the growth of bacteria to sufficient levels that would cause illness. Some types of bacteria must be present in large numbers to cause illness; others can cause illness in low numbers.
Which conditions promote bacterial growth?
Moisture and temperature are the two most important conditions that promote bacterial growth. Which foods need to be refrigerated or frozen to prevent spoilage by bacteria? Generally, it is foods with a high moisture level. Most of the foods that you store in your pantry at room temperature are dry foods: rice, dry beans, pasta, sugar, etc. For example, cheese generally needs to be refrigerated. But grated parmesan cheese is dry enough to be stored in the pantry (unopened). Meat needs refrigeration, but beef jerky is dry enough to not need refrigeration. If your stored food becomes damp or wet, it spoils rapidly, even within a few hours.
Some guidelines on temperature from the FDA:
“Growth rates of pathogens are highly temperature dependent. Ordinarily, pathogenic bacteria growth is relatively slow at temperatures below 70°F (21.1°C). In most cases, growth is very slow below 50°F (10°C), and 40°F (4.4°C) is below the minimum growth temperature of most pathogenic bacteria, although there are some exceptions. On the other hand, pathogenic bacteria grow relatively fast at temperatures above 70°F (21.1°C).”
Most bacteria need temperatures above refrigeration levels (above 40 degrees F) to grow well. Food should not be kept at temperatures above 70 degrees F (and below 135 degrees) for more than 2 hours. If the temperature is between 50 and 70 degrees, the food should not be kept at those temperatures for more than 5 hours. For more detailed info, see this PDF from the FDA.
Of course, even at refrigerator temperatures, pathogenic bacteria can grow, though much more slowly. That is why food will spoil in the refrigerator after a certain number of days or weeks. However, food kept in the freezer, continuously below zero degrees F, will keep indefinitely. The main issue with frozen food is the amount of bacteria in the food when it was frozen, and any bacterial growth that occurs while it is thawing. The safest way to thaw food is in the refrigerator (takes a day or two). For a quick thaw, immerse the frozen food, still in its packaging, in a container of cold water. Change the water if it becomes warm. The water should stay below 50 degrees F.
Which conditions inhibit bacterial growth?
Low temperature inhibits bacterial growth, as does dryness. Interestingly, dryness is not solely a function of how much water is in the food. The amount of sugar and salt also affects how much moisture is available for bacterial growth. So sugar and salt are natural preservatives. Essentially, they make the moisture unavailable to the bacteria, inhibiting growth.
Acidity inhibits growth of pathogenic bacteria. The bacteria that inflict illness on humans generally grow best in the conditions found in the human body: moisture, warm temperature, low acidity. Acids like vitamin C (ascorbic acid) and vinegar (used in pickling) inhibit bacterial growth, and so these compounds are also natural preservatives.
Artificial preservatives inhibit bacterial growth. For health reasons, you should probably prefer your food to be free from artificial preservatives. However, it is not such a bad trade-off to have some foods that contain preservatives in order to make bacterial contamination less likely, especially when storing food long-term. High-quality freeze-dried foods are dry enough not to need preservatives, but many store-bought items will keep longer with artificial preservatives.
What conditions kill bacteria?
Practically speaking, the best way to kill bacteria is with heat: baking, frying, boiling, etc. Once the food reaches an internal temperature of 165 degrees F or higher, the food is instantly safe. See this food safety chart for safe cooking at lower temperatures.
For most bacteria, it is sufficient to cook the food to kill the bacteria, making the food safe. However, some bacteria contain endotoxins, proteins that cause illness even if the bacteria are killed by heat. What this means, from a practical standpoint, is that you can’t eat food that has spoiled from bacterial contamination, even if you cook the hell out of it so that all the bacteria are killed. If food has spoiled from bacteria, it has to be thrown out.