The Internet of Things (IoT) revolution has led to a proliferation of connected devices. However, these IoT devices face inherent limitations, such as limited computing power, storage capacity, and battery life. This makes them susceptible to misuse and exploitation. Attackers exploit these vulnerabilities to compromise IoT devices and create botnets that threaten fog-IoT networks. Therefore, developing effective cyber-attack detection mechanisms such as Machine Learning (ML) based Intrusion Detection Systems (IDSs) becomes crucial, which is imperative to safeguard fog-IoT infrastructures. However, conventional ML approaches often require centralized data storage on a single server or in the cloud, leading to concerns regarding data confidentiality, communication overhead, and energy consumption. This paper addresses this issue by leveraging IDS-based anomaly detection to prevent cyber attacks on IoT networks. Specifically, we propose using Federated Deep Learning (FDL) across a fog-based IDS architecture that utilizes the Lost Short-Term Memory (LSTM) model and the Bot-IoT dataset. Our solution adopts a local learning approach, allowing devices to acquire knowledge from others by sharing only model updates without exposing their data. By adopting the FDL approach, the detection model demonstrates a comparable (slightly improved) performance compared to existing centralized deep learning while ensuring data privacy-preserving.