In recent times, the Industrial Internet of Things (IIoT) has developed significantly. In the application of automation, and intelligence, industrial digitalization introduced cyber risks, and the varied and complex industrial IoT platform presented a novel attack surface for network invaders. Several Intrusion Detection Systems (IDS) were advanced recently as many computer networks exposure to privacy and security threats. Availability, Data confidentiality, and integrity, the damage will happen in case of IDS prevention failure. Traditional methods were ineffective in dealing with advanced attacks. Advanced deep learning (DL) methods were designed for automatic ID and abnormal behavior detection of networks. Therefore, this article focuses on the design of Improved Reptile Search Optimization with Ensemble Deep Learning based Cybersecurity (IRSO‐EDLCS) technique in the IIoT environment. The major aim of the IRSO‐EDLCS technique lies in the accurate identification of cyberattacks in the IIoT environment. To accomplish this, the presented IRSO‐EDLCS technique performs IRSO algorithm‐based feature selection (IRSO‐FS) technique. In addition, the IRSO‐EDLCS technique performs an ensemble of three DL models namely deep belief network (DBN), bidirectional gated recurrent unit (BiGRU), and autoencoder (AE). The hyperparameter tuning process is performed by a modified gray wolf optimizer (MGWO) to enhance detection process. To exhibit the improved performance of the IRSO‐EDLCS algorithm, a wide range of simulations were performed on the benchmark database. The experimental outcomes depict the betterment of the IRSO‐EDLCS technique over other existing models.