Our main objective, in this thesis, is to propose a solution that solve the optimal deployment of IoT services in CloudFog system. The achieved results as follows: A mathematical model that represents the IoT services and CloudFog system was built. We have proposed a Mixed Integer Linear Programming model for minimizing energy consumption of system while maintaining the resource requirements and QoS constraints of IoT services. We have designed two algorithms to efficiently deploy IoT services onto CloudFog system. We have implemented simulation scenarios to present experiment results of our proposed algorithms and compare it with the existing solutions Our main objective, in this thesis, is to propose a solution that solve the optimal deployment of IoT services in CloudFog system. The achieved results as follows: A mathematical model that represents the IoT services and CloudFog system was built. We have proposed a Mixed Integer Linear Programming model for minimizing energy consumption of system while maintaining the resource requirements and QoS constraints of IoT services. We have designed two algorithms to efficiently deploy IoT services onto CloudFog system. We have implemented simulation scenarios to present experiment results of our proposed algorithms and compare it with the existing solutions