{"id":3753,"date":"2023-11-21T15:05:06","date_gmt":"2023-11-21T07:05:06","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3753"},"modified":"2025-12-26T17:10:04","modified_gmt":"2025-12-26T09:10:04","slug":"supervisor-installation","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/supervisor-installation","title":{"rendered":"Supervisor Installation: Your One-Stop Solution for Reliable Process Execution"},"content":{"rendered":"<div class=\"markdown markdown-main-panel\" dir=\"ltr\">\n<p data-sourcepos=\"3:1-3:38\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3754\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-300x169.jpeg\" alt=\"Supervisor Installation\" width=\"722\" height=\"407\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/k-390x219.jpeg 390w\" sizes=\"(max-width: 722px) 100vw, 722px\" \/><\/p>\n<p data-sourcepos=\"7:1-7:308\">Managing processes on a <a href=\"https:\/\/www.servergigabit.com\/linux-vps-hosting\/\">Linux<\/a> server can be a complex task, especially when dealing with custom applications or programs that require automatic restarts upon crashes. Supervisor is a powerful process management tool that simplifies this process and ensures that your applications are always running smoothly.<\/p>\n<h2 data-sourcepos=\"9:1-9:45\"><strong>Supervisor Installation and Configuration<\/strong><\/h2>\n<p data-sourcepos=\"11:1-11:372\">Supervisor is available as a pre-built package for most Linux distributions. Once installed, you can configure it using the provided configuration file, typically located in \/etc\/supervisor\/conf.d\/. In the configuration file, you define programs to be managed by Supervisor, specifying the program name, command to execute, and the user under which the program should run.<\/p>\n<h2 data-sourcepos=\"13:1-13:25\"><strong>Example Configuration<\/strong><\/h2>\n<p data-sourcepos=\"15:1-15:258\">Consider a simple <a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noopener\">Python<\/a> web application stored in a file named app.py. To run this application using Supervisor, create a configuration file named hello.conf and place it in \/etc\/supervisor\/conf.d\/. The contents of the hello.conf file should look like this:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">[program:hello]\r\ncommand=\/usr\/bin\/python \/home\/markus\/app.py\r\nuser=markus\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"23:1-23:130\">This configuration defines a program named &#8220;hello&#8221; that executes the command &#8220;python \/home\/markus\/app.py&#8221; using the user &#8220;markus&#8221;.<\/p>\n<h2 data-sourcepos=\"25:1-25:40\"><strong>Starting and Monitoring Applications<\/strong><\/h2>\n<p data-sourcepos=\"27:1-27:52\">To start the application, use the following command:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">supervisorctl start hello\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"33:1-33:44\">To check the status of the application, use:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">supervisorctl status\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"39:1-39:66\">This command should display the application&#8217;s status as &#8220;RUNNING&#8221;.<\/p>\n<h2 data-sourcepos=\"41:1-41:34\"><strong>Simulating a Crash and Restart<\/strong><\/h2>\n<p data-sourcepos=\"43:1-43:117\">To simulate a crash and verify that Supervisor restarts the application as expected, terminate the application using:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">kill -9 32675\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"49:1-49:37\">Check the application&#8217;s status again:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">supervisorctl status\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"55:1-55:110\">The application should now be listed as &#8220;RUNNING&#8221; again, indicating that Supervisor successfully restarted it.<\/p>\n<h2 data-sourcepos=\"57:1-57:25\"><strong>Supervisor Advantages<\/strong><\/h2>\n<p data-sourcepos=\"59:1-59:77\">Supervisor offers several advantages for managing processes on Linux servers:<\/p>\n<ul data-sourcepos=\"61:1-65:0\">\n<li data-sourcepos=\"61:1-61:46\">Automatic restarting of crashed applications<\/li>\n<li data-sourcepos=\"62:1-62:60\">Configuration for different process execution environments<\/li>\n<li data-sourcepos=\"63:1-63:34\">Log file management and rotation<\/li>\n<li data-sourcepos=\"64:1-65:0\">Detailed program status information<\/li>\n<\/ul>\n<h2 data-sourcepos=\"66:1-66:14\"><strong>Conclusion<\/strong><\/h2>\n<p data-sourcepos=\"68:1-68:370\">Supervisor is a versatile and powerful tool for managing processes on Linux servers. It simplifies the process of ensuring that your applications are always running smoothly, even in the event of unexpected crashes. With its comprehensive configuration options and extensive documentation, Supervisor is an invaluable tool for system administrators and developers alike.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Managing processes on a Linux server can be a complex task, especially when dealing with custom applications or programs that require automatic restarts upon crashes. Supervisor is a powerful process management tool that simplifies this process and ensures that your applications are always running smoothly. Supervisor Installation and Configuration Supervisor is available as a pre-built package for most Linux distributions.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1180],"class_list":["post-3753","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-supervisor-installation"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3753"}],"version-history":[{"count":3,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3753\/revisions"}],"predecessor-version":[{"id":4292,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3753\/revisions\/4292"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3753"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3753"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}