Idiopathic pulmonary fibrosis (IPF) is a devastating disease of unknown etiology with limited treatment options. The role of the immune system in IPF has received increasing attention. Uncontrolled immune responses drive the onset and progression of IPF. This article provides an overview of the role of innate immune cells (including macrophages, neutrophils, mast cells, eosinophils, dendritic cells, nature killer cells, nature kill cells and γδ T cells) and adaptive immune cells (including Th1 cells, Th2 cells, Th9 cells, Th17 cells, Th22 cells, cytotoxic T cells, B lymphocytes and Treg cells) in IPF. In addition, we review the current status of pharmacological treatments for IPF and new developments in immunotherapy. A deeper comprehension of the immune system’s function in IPF may contribute to the development of targeted immunomodulatory therapies that can alter the course of the disease.