In Indonesia, diarrheal disease is the third leading cause of child death. This study examines the effects of drinking water and sanitation facilities on diarrhoea incidence among children under five, while controlling for risk factors at household and community level. We used nationally representative data from two waves (2007 and 2012) of the Indonesian Demographic and Health Survey. Multilevel logistic regression analysis was used. Interactions were studied between the water and sanitation variables and other risk factors to assess the role of the context. We found that piped water, child age and sex, household wealth, living in an urban area, environmental hygiene, health status and health facilities to be negatively associated with diarrhoea incidence. Water treatment, and mother’s education were not significantly associated with diarrhoea. An interaction analysis showed that the protective effects of piped water and sanitation are more important when conditions within the communities are poor.