One of the leading causes of cancer death for both men and women is the lung cancer. The best way to improve the patient’s chances for survival is the early detection of potentially cancerous cells. But, the conventional systems fails to segment the cancerous cells of various types namely, well-circumscribed, juxta-pleural, juxta-vascular and pleural-tail at its early stage (i.e., less than 3 mm) that leads to less classification accuracy. It is also noted that none of the existing systems achieved accuracy more than 98%. In this paper, we propose an optimal diagnosis system not only for early detection of lung cancer nodules and also to improve the accuracy in Fog computing environment. The Fog environment is used for storage of the high volume CT scanned images to achieve high privacy, low latency and mobility support. In our approach, for the accurate segmentation of Region of Interest (ROI), the hybrid technique namely Fuzzy C-Means (FCM) and region growing segmentation algorithms are used. Then, the important features of the nodule of interest such as geometric, texture and statistical or intensity features are extracted. From the above extracted features, the optimal features used for the classification of lung cancer are identified using the Cuckoo search optimization algorithm. Finally, the SVM classifier is trained using these optimal features, which in turn helps us to classify the lung cancer as either of type benign or malignant. The accuracy of the proposed system is tested using Early Lung Cancer Action Program (ELCAP) public database CT lung images. The total sensitivity and specificity attained in our system for the above said database are 98.13 and 98.79% respectively. This results in a mean accuracy of 98.51% for training and testing in a sample of 103 nodules occurring in 50 exams. The rate of false positives per exam was 0.109. Also, a high receiver operating characteristic (ROC) of 0.9962 has been achieved. © 2017, Springer-Verlag GmbH Germany, part of Springer Nature.