The growing reliance on cloud services necessitates a heightened focus on security measures to protect the integrity and privacy of crucial business data. Privacy preservation techniques, incorporating cryptographic and optimization methods, are instrumental in securely storing data in the cloud. The development of Intrusion Detection Systems (IDS) is crucial for pinpointing anomalies in data, playing a pivotal role in fortifying the reliability, confidentiality, and availability of cloud-based systems. The current surge in interest from research communities towards leveraging machine learning (ML) methods for IDS reflects a strategic shift in addressing anomaly detection within network traffic to enhance overall cloud security. Thus, this study introduces a sea horse optimization with deep echo state network-based intrusion detection (SHO-DESNID) method on the cloud environment. The goal of the SHO-DESNID technique is to accomplish security in the cloud environment via an intrusion detection process. To accomplish this, the SHO-DESNID technique undergoes a min–max normalization approach as a pre-processing step. Moreover, the SHO-DESNID approach uses the DESN model for the identification and classification of intrusions into multiple classes. To enhance the intrusion detection rate of the DESN method, the SHO algorithm is utilized for optimal hyperparameter selection. The simulation outcome of the SHO-DESNID system is tested on a benchmark IDS database and the experimental values state the supremacy of the SHO-DESNID technique compared with other approaches. © The Author(s), under exclusive licence to Bharati Vidyapeeth's Institute of Computer Applications and Management 2024.