Key takeaways:
Bacteria is the most common cause of pneumonia. Viruses and fungi can also cause it.
Young children, older adults, and people with chronic medical conditions are at highest risk of getting pneumonia.
See a healthcare professional right away if you have trouble breathing, high fever, chest pain, or bluish skin.
Pneumonia is an infection in the lungs. Bacteria, viruses, and fungi can cause pneumonia, leading the lungs to fill with fluid or pus. It’s not always severe. But sometimes breathing difficulties from pneumonia need hospital treatment. Some people are at higher risk of developing pneumonia and getting sicker with it.
The good news is that there are things you can do to reduce your risk of developing pneumonia. Understanding how people get it — and who’s at risk — can help prevent severe illness.
How do you get pneumonia?
You can get pneumonia after exposure to microorganisms that cause infection. This happens when people who are infected cough, sneeze, or talk. This sends droplets into the air, which other people can breathe in.
You can also get pneumonia from germs on surfaces or objects if you touch that surface and then touch your nose or mouth. But this is less common.
If you have a weakened immune system or certain medical conditions (see below), it’s easier to get pneumonia. This is especially true for fungal pneumonia, which can happen after exposure to fungus in the environment.
What are the common causes of pneumonia?
Bacteria, viruses, and fungi can cause pneumonia. Bacterial pneumonia is the most common and requires treatment with antibiotics. It tends to make people sicker than viral pneumonias. Fungal pneumonias tend to most often affect people with weaker immune systems.
Bacteria
Bacteria can cause infection directly and fill your lungs with fluid or pus. Common causes of bacterial pneumonia include:
Streptococcus pneumoniae (the most common type)
Haemophilus influenzae
There are other types of bacteria that cause atypical pneumonia (also known as walking pneumonia). Common causes of atypical pneumonia include:
Mycoplasma pneumoniae
Chlamydia pneumoniae
Legionella pneumophila, which can cause a severe illness called Legionnaires’ disease
What does pneumonia feel like? Someone who’s been hospitalized several times with pneumonia shares his firsthand experience.
COVID-19 is still with us. So, it’s helpful to understand the signs and symptoms of COVID pneumonia — and to know when to get help.
What exactly is walking pneumonia? The name of this respiratory illness might be confusing. But the symptoms are pretty straightforward.
People who have trouble swallowing or coughing (after a stroke, for example) are at risk for aspiration pneumonia. If they accidentally inhale liquid or stomach contents, it can lead to bacterial infection in the lungs.
Viruses
Many viruses can cause pneumonia. Viral pneumonias don’t respond to antibiotic medicines.
Common viral causes of pneumonia include:
- ZithromaxAzithromycin
- ActiclateDoxycycline Hyclate
- MorgidoxDoxycycline Hyclate
Fungi
Fungi live in the soil in many areas of the U.S. They can often be found in bird droppings, as well.
Some causes of fungal pneumonia include:
Coccidioides, a fungus that causes valley fever
Histoplasma, a fungus found in soil, as well as bat and bird droppings
Blastomyces, a yeast fungus
Fungal pneumonias are rare. They tend to affect people who have weakened immune systems due to:
HIV
Chemotherapy
Older age
Medications for organ transplants or autoimmune illnesses
Protozoa
Protozoa are single celled organisms that can rarely cause pneumonia in people with weakened immune systems. Toxoplasma gondii is a parasitic protozoa that can cause pneumonia.
Can you catch pneumonia from somebody with it?
Whether you can catch pneumonia from someone with pneumonia depends on the cause of their illness. The bacteria and viruses that cause pneumonia are contagious. But not everyone who’s exposed to those bacteria and viruses will develop pneumonia.
For example, if you’re exposed to a person with a milder illness, like a cold, that could turn into pneumonia if you have a weakened immune system and you’re unable to fight it off.
If you have bacterial pneumonia, you remain contagious until you’ve been on antibiotics for 48 hours. If you have pneumonia caused by a virus, you could pass that virus until your symptoms start to go away.
Fungal pneumonia isn’t contagious.
Who is more likely to develop pneumonia?
It’s important to know that anyone can get pneumonia. But there are some things that make it more likely for some people.
These risk factors include:
Extremes of age (being under age 2 or over age 65)
Tobacco and alcohol use
Lung disease, such as asthma or chronic obstructive pulmonary disease (COPD)
Other medical conditions, like diabetes, heart failure, and liver disease
Sickle-cell disease
Weakened immune system
Recent illness or hospitalization
When should you get medical care for pneumonia?
If you’re concerned that you may have pneumonia, you should call or see a healthcare professional.
Common symptoms of pneumonia include:
Cough, especially with mucus
Fever and chills
Shortness of breath
Fast breathing
Chest pain with coughing or deep breaths
Decreased appetite and energy
Nausea and vomiting, especially in younger children
Confusion, especially in older adults
See a healthcare professional right away if you have:
Trouble breathing
Blue lips or fingers
Chest pain
Fever over 103°F (39.4°C), especially if it doesn’t decrease with acetaminophen or ibuprofen
If you’re at higher risk, you shouldn’t wait to get medical attention if you develop symptoms of pneumonia. Symptoms can worsen quickly and even become life-threatening.
How can you prevent pneumonia?
There are steps you can take to decrease your chances of developing pneumonia and the severity of pneumonia if you do get it.
Vaccines are an important way to prevent pneumonia. There are four pneumonia vaccines available in the U.S. While they don’t prevent every kind of pneumonia, they do prevent several strains of Streptococcus pneumoniae. This is the most common cause of bacterial pneumonia.
Other important vaccines that can reduce the risk of pneumonia include:
Pneumococcal vaccine
COVID vaccine
RSV vaccine
Flu vaccine
Some people who’ve received a vaccine may still get sick with this type of pneumonia. But, if they do, they tend to have milder infections and fewer complications. If you get pneumonia after receiving a vaccine it doesn’t mean the vaccine was ineffective.
There are other ways you can prevent pneumonia, too. You can:
Wash your hands or use hand sanitizer frequently to kill germs.
If you smoke, quit smoking, since smoking makes it difficult for your lungs to protect against infection.
Exercise, get plenty of sleep, and eat nutritious food to help keep your immune system strong.
If you have a weakened immune system, you may need to take antibiotics to prevent infection, even if you don’t have an infection.
If you have problems swallowing, you may need to take steps to prevent aspiration. These include eating smaller meals, thickening liquids, and elevating your head while sleeping.
Frequently asked questions
Respiratory illnesses like pneumonia are more common in the winter. That’s partly because some of the viruses that cause pneumonia are more active in the winter months. Colder weather also means that people are spending more time indoors. And that can make spreading respiratory illness easier.
The “pneumonia shot” is a vaccine against one of the most common causes of bacterial pneumonia — Streptococcus pneumoniae. There are several different pneumococcal vaccines. How often you need to be vaccinated depends on what type of vaccination you’ve had in the past and your risk for developing pneumonia.
Mycoplasma pneumonia is bacterial pneumonia caused by infection with Mycoplasma pneumoniae. It typically causes a mild pneumonia called a “walking pneumonia.” You can catch mycoplasma pneumonia just like any other respiratory illness — from coming into contact with the bacteria in the respiratory droplets from a person with the infection.
Respiratory illnesses like pneumonia are more common in the winter. That’s partly because some of the viruses that cause pneumonia are more active in the winter months. Colder weather also means that people are spending more time indoors. And that can make spreading respiratory illness easier.
The “pneumonia shot” is a vaccine against one of the most common causes of bacterial pneumonia — Streptococcus pneumoniae. There are several different pneumococcal vaccines. How often you need to be vaccinated depends on what type of vaccination you’ve had in the past and your risk for developing pneumonia.
Mycoplasma pneumonia is bacterial pneumonia caused by infection with Mycoplasma pneumoniae. It typically causes a mild pneumonia called a “walking pneumonia.” You can catch mycoplasma pneumonia just like any other respiratory illness — from coming into contact with the bacteria in the respiratory droplets from a person with the infection.
The bottom line
Pneumonia is a lung infection commonly caused by bacteria and viruses. People do spread these bacteria and viruses, though they don’t always cause pneumonia. Older adults, babies, and people with chronic medical conditions are at higher risk. Getting vaccinations, quitting smoking, and eating a balanced and nutritious diet reduce your risk of pneumonia. See a healthcare professional right away if you develop difficulty breathing, chest pain, high fever, or blue skin.
Why trust our experts?



References
American Lung Association. (2025). What causes pneumonia?
Centers for Disease Control and Prevention. (2024). About Mycoplasma pneumoniae infection.
Centers for Disease Control and Prevention. (2024). Fungal community-acquired pneumonias.
Cilloniz, C., et al. (2017). Seasonality of pathogens causing community-acquired pneumonia. Respirology.
Diaz, J. (2025). Protozoan. Britannica.
MedlinePlus. (2023). Pneumonia.
National Cancer Institute. (n.d.). Immunocompromised.
National Heart, Lung, and Blood Institute. (2022). Pneumonia: Causes and risk factors.
National Heart, Lung, and Blood Institute. (2022). Pneumonia: Prevention.












