Natural disasters are becoming more frequent and more severe as a result of global warming. It is critical to take precautions before disasters, to gather and analyze information simultaneously while they are happening, and to make accurate assessments after them given that the deaths and injuries brought on by such disasters both leave lasting traumas in the life of society and damage the economy. Internet of Things (IoT) technology, is a young field that can assist intelligent safety-critical systems with data collection, processing in cloud edge data centers, and application of prediction methodologies for discovering key points and unexpected patterns using 5G technology. With the use of a cloud-based prediction algorithm for disaster management in the IoT environment, this study seeks to quickly process the data that is gathered during disasters and to speed up the analysis that will be done both during and after the disasters. An Optimized Ensemble Bagged Tree (OEBT) algorithm with ANOVA-based feature selection is developed for this aim. The experimental results show that accuracy, F1-Score, precision, and recall of the proposed OEBT algorithm utilizing the US Natural Disasters Dataset are 97.9%, 78.3%, 98.7%, and 78.9%, respectively. Comparisons with decision tree, logistic regression, and the traditional ensemble techniques are made. The suggested algorithm outperforms them all in terms of success rates.