You catch pneumonia when germs, most commonly bacteria or viruses, get into your lungs and overwhelm your body’s defenses. This can happen in several ways: breathing in infected droplets from someone nearby, accidentally inhaling food or liquid into your airways, or picking up fungal spores from contaminated soil. The route depends on the type of pneumonia, and so does how quickly you get sick.
Breathing In Germs From Other People
The most common way to catch pneumonia is simply breathing in bacteria or viruses that someone else has coughed or sneezed into the air. The same germs that cause colds, the flu, COVID-19, and RSV can all lead to pneumonia if the infection moves deep enough into the lungs. Bacterial pneumonia caused by Streptococcus pneumoniae (the most well-known culprit) has a short incubation period of just one to three days from exposure to first symptoms.
Not every cold or flu turns into pneumonia. Your airways have built-in defenses: tiny hair-like structures that sweep mucus and trapped particles upward, a cough reflex, and immune cells stationed throughout the respiratory tract. Pneumonia develops when a pathogen gets past all of these barriers, usually because the germ is particularly aggressive, you’re exposed to a large amount of it, or your immune system is already weakened.
How “Walking Pneumonia” Spreads Differently
Walking pneumonia, caused by the bacterium Mycoplasma pneumoniae, spreads through the same respiratory droplets as other forms. But it has a distinct pattern: brief, casual contact with a sick person usually isn’t enough to infect you. The risk goes up significantly when you spend a lot of time around someone who’s ill.
That’s why outbreaks tend to happen in crowded settings like college dorms, military barracks, schools, and long-term care facilities. During school outbreaks, family members of sick children are the most likely people in the community to get infected next, precisely because they share a home. Walking pneumonia is generally milder than other types, which is how it gets its name. People often stay on their feet and keep going to work or school, unknowingly spreading it further.
Aspiration: When Food or Liquid Enters the Lungs
Aspiration pneumonia doesn’t come from another person at all. It happens when you inhale something other than air into your lungs: food, liquid, saliva, stomach acid, vomit, or even a small foreign object. Whatever enters the lungs brings bacteria along with it, and those bacteria cause an infection.
Normally your gag reflex and cough reflex prevent this. You’re at higher risk if something disrupts those protective reflexes:
- Neurological conditions like stroke, brain injury, Parkinson’s disease, or multiple sclerosis that make swallowing difficult
- Impairment from alcohol or drugs that suppresses your cough reflex
- Recent general anesthesia or dental work
- Age, particularly being older than 65 or younger than 5
People living in assisted living or nursing home settings also face elevated risk, partly because swallowing problems become more common with age and partly because immune function tends to decline.
Fungal Pneumonia From Soil and the Environment
Some forms of pneumonia aren’t contagious at all. Fungal pneumonia comes from breathing in spores found in the environment. Histoplasma, for example, lives in soil contaminated with bird and bat droppings and causes lung infections in certain regions of the United States. Valley fever (coccidioidomycosis) comes from a fungus that lives in soil in the southwestern U.S. and parts of other states.
You can inhale these spores while digging, gardening, exploring caves, or simply being outside in an area where the fungus is common, especially on windy days when soil gets disturbed. Most healthy people who breathe in small amounts of these spores fight off the infection without symptoms, but larger exposures or a weakened immune system can lead to full-blown pneumonia.
Hospital-Acquired Pneumonia
Pneumonia caught in a hospital tends to be more serious than the kind you pick up in daily life. Hospitals harbor bacteria that have been exposed to antibiotics repeatedly, making them harder to treat. You’re most vulnerable if you’re on a ventilator, recovering from surgery, or already in a weakened state from another illness. The longer a hospital stay, the greater the risk.
Why Some People Are More Vulnerable
Exposure to a germ is only half the equation. Whether that exposure turns into pneumonia depends heavily on how well your lungs can defend themselves. Smoking and vaping both compromise those defenses in measurable ways. Research on e-cigarette users found that vaping reduces cough sensitivity, meaning your body is less likely to expel inhaled particles before they reach the lungs. Animal studies have shown that e-cigarette vapor disrupts the sweeping motion of the tiny hairs that clear mucus from your airways. Healthy vapers were found to have irritated, reddened airway tissue and elevated markers of lung inflammation, all of which make the lungs more hospitable to infection.
Beyond smoking and vaping, several other factors increase your chances of catching pneumonia after exposure. A weakened immune system from chronic illness, medications like chemotherapy, or conditions like HIV means your body has fewer resources to fight off germs before they establish an infection. Very young children have immune systems that haven’t fully developed, while adults over 65 face natural age-related immune decline. Chronic lung conditions like asthma or COPD leave the airways already inflamed and less capable of clearing pathogens.
Pneumonia Vaccines
Vaccines can’t prevent every type of pneumonia, but they can protect against some of the most dangerous bacterial strains. The CDC recommends pneumococcal vaccination for all children under 5, given as a four-dose series starting at 2 months of age. Adults 50 and older who have never received a pneumococcal conjugate vaccine are also recommended to get vaccinated.
The current options for adults include PCV15, PCV20, and PCV21. If you get PCV20 or PCV21, no additional pneumococcal vaccines are needed. If you get PCV15, a second vaccine (PPSV23) is recommended about a year later to broaden your protection. Adults younger than 50 may also be recommended pneumococcal vaccines based on specific risk factors like immune-suppressing conditions.
Staying up to date on flu and COVID-19 vaccines also matters, since viral infections frequently pave the way for bacterial pneumonia by damaging the airways and temporarily weakening local immune defenses. Preventing the initial viral infection can stop that chain reaction before it starts.
Practical Ways to Lower Your Risk
Beyond vaccination, the basics of infection prevention apply. Washing your hands regularly reduces the chance of transferring respiratory viruses from surfaces to your face. Avoiding close, prolonged contact with people who have respiratory infections limits your exposure to airborne droplets. If you smoke or vape, quitting gives your lungs a chance to restore some of their natural defenses over time.
For aspiration pneumonia, the focus is different: eating slowly, staying upright during and after meals, and managing any conditions that affect swallowing. If you care for someone with neurological problems or advanced age, awareness of choking signs and swallowing difficulties can help catch aspiration risks early.

