Today, cloud computing is an emerging paradigm in computing providing computing resources to users as a type of service. Scheduling refers to the mapping of tasks and jobs to the right resources. From the beginning of the technology of cloud computing, the problem of task scheduling has not been easy. The bursty and fluctuation of requests challenge the traditional resource scheduling framework. In this work, Deep Reinforcement Learning (DRL) is applied to resolve both scheduling and resource allocation to handle the heterogeneity of the resources and various tasks. To enhance the performance of the DRL, it is required to optimize the hyperparameters – learning rate and activation function. The metaheuristic methods are efficient in obtaining optimal or near-optimal solutions. This work proposes a heuristic deep learning-based scheduling algorithm based on Particle Swarm Optimization (PSO) and Firefly Algorithm in the cloud. The experiments demonstrated the Firefly DRL achieves improved performance compared to First Come and First Serve (FCFS), DRL, Tabu DRL, and PSO DRL.