The liver is a central immunological organ with a high exposure to circulating antigens and endotoxins from the gut microbiota, particularly enriched for innate immune cells (macrophages, innate lymphoid cells, mucosal-associated invariant T (MAIT) cells). In homeostasis, many mechanisms ensure suppression of immune responses, resulting in tolerance. Tolerance is also relevant for chronic persistence of hepatotropic viruses or allograft acceptance after liver transplantation. The liver can rapidly activate immunity in response to infections or tissue damage. Depending on the underlying liver disease, such as viral hepatitis, cholestasis or NASH, different triggers mediate immune-cell activation. Conserved mechanisms such as molecular danger patterns (alarmins), Toll-like receptor signalling or inflammasome activation initiate inflammatory responses in the liver. The inflammatory activation of hepatic stellate and Kupffer cells results in the chemokine-mediated infiltration of neutrophils, monocytes, natural killer (NK) and natural killer T (NKT) cells. The ultimate outcome of the intrahepatic immune response (for example, fibrosis or resolution) depends on the functional diversity of macrophages and dendritic cells, but also on the balance between pro-inflammatory and anti-inflammatory T-cell populations. As reviewed here, tremendous progress has helped to understand the fine-tuning of immune responses in the liver from homeostasis to disease, indicating promising targets for future therapies in acute and chronic liver diseases.