Posts Learn Components Snippets Categories Tags About
/

How to Terminate Horizon during Deployment in Laravel Forge

Learn how to Terminate Laravel Horizon during deployment process in Laravel Forge

8 months ago

4 mins read

55 views

Horizon is a beautiful dashboard for Laravel applications that make use of the Redis queue. In this short post, you'll learn how to terminate the Horizon process on the Laravel Forge deployment process.
Laravel Horizon dashboard

Deployment Scripts


Inside the deployment script, do add the command below and on each deployment, it will gracefully terminate the master Horizon process on the machine. Any of the jobs that horizon is processing will be completed then horizon will exit.
// existing deployment scripts

// command to terminate laravel horizon
php artisan horizon:terminate
Do note that you'll have to set up horizon daemon by accessing the "daemons" page on the dashboard and defining the configuration. The command would be "php artisan horizon" and the directory is the full path of where the website is located in the machine.
Laravel Forge New Daemon

By having a daemon, the horizon instance will automatically be restarted by the process monitor such as the supervisor upon each successful deployment.
Active Daemons in Laravel Forge

By now you should know How to Terminate Horizon during Deployment in Laravel Forge. If you find this tutorial to be helpful do make sure to share it with your friends and happy learning.
new

PostSrc Code Snippets

Learn new snippets today, level up your Laravel, Alpine JS, Vue JS, Tailwind CSS skills and more.

Learn New Snippets

Authored by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your project.

View Components