With the rapid development of mobile communication and the sharp increase of smart mobile devices, wireless data traffic has experienced explosive growth in recent years, thus injecting tremendous traffic into the network. Fog Radio Access Network (F-RAN) is a promising wireless network architecture to accommodate the fast growing data traffic and improve the performance of network service. By deploying content caching in F-RAN, fast and repeatable data access can be achieved, which reduces network traffic and transmission latency. Due to the capacity limit of caches, it is essential to predict the popularity of the content and pre-cache them in edge nodes. In general, the classic prediction approaches require the gathering of users’ personal information at a central unit, giving rise to users’ privacy issues. In this paper, we propose an intelligent F-RANs framework based on federated learning (FL), which does not require gathering user data centrally on the server for training, so it can effectively ensure the privacy of users. In the work, federated learning is applied to user demand prediction, which can accurately predict the content popularity distribution in the network. In addition, to minimize the total traffic cost of the network in consideration of user content requests, we address the allocation of storage resources and content placement in the network as an integrated model and formulate it as an Integer Linear Programming (ILP) problem. Due to the high computational complexity of the ILP problem, two heuristic algorithms are designed to solve it. Simulation results show that the performance of our proposed algorithm is close to the optimal solution.