{"id":13257,"date":"2023-02-07T11:24:23","date_gmt":"2023-02-07T11:24:23","guid":{"rendered":"https:\/\/cloudkul.com\/blog\/?p=13257"},"modified":"2024-12-20T11:35:34","modified_gmt":"2024-12-20T11:35:34","slug":"how-to-install-and-configure-supervisor-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/","title":{"rendered":"How to Install and Configure Supervisor on ubuntu 20.04"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Supervisor<\/h2>\n\n\n\n<p>It is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open-source process management system. <\/p>\n\n\n\n<p>However, It restarts the processes if it crashes for any reason.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1- Update all the packages<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get update -y \n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2- Install Supervisor<\/h2>\n\n\n\n<p>By default, the<a href=\"https:\/\/cloudkul.com\/blog\/143-2\/\"> supervisor package <\/a>is present in the Ubuntu 20.04 repository. Install it with the below-mentioned command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install supervisor -y\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-27.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"316\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-27-1024x316.png\" alt=\"supervisor\" class=\"wp-image-13263\"\/><\/a><\/figure>\n\n\n\n<p>After installing it you can check its version by running the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisord -v<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-28.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"261\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-28-1024x261.png\" alt=\"supervisor\" class=\"wp-image-13265\"\/><\/a><\/figure>\n\n\n\n<p>Verify the status of the service by running the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl status supervisor<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-29.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"352\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-29-1024x352.png\" alt=\"supervisor\" class=\"wp-image-13267\"\/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3- Manage the Nginx process<\/h3>\n\n\n\n<p>First, we need to install the<a href=\"https:\/\/cloudkul.com\/features\/nginx-integration\/\"> nginx server<\/a> with the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install nginx -y\n<\/pre>\n\n\n\n<p>You must halt and disable the nginx service after installing it since we will use a supervisor to manage the nginx process.<\/p>\n\n\n\n<p>You can stop and disable the nginx service with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl stop nginx\nsystemctl disable nginx\n\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4- Create a conf file under the supervisor to serve nginx process<\/h3>\n\n\n\n<p>Now, for each service that you wish to manage, you must generate a separate configuration file. The following command will generate an Nginx configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/etc\/supervisor\/conf.d\/nginx.conf<\/pre>\n\n\n\n<p>Add the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[program:nginx]\ncommand=\/usr\/sbin\/nginx -g \"daemon off;\"\nautostart=true\nautorestart=true\nstartretries=5\nnumprocs=1\nstartsecs=0\nprocess_name=%(program_name)s_%(process_num)02d\nstderr_logfile=\/var\/log\/supervisor\/%(program_name)s_stderr.log\nstderr_logfile_maxbytes=10MB\nstdout_logfile=\/var\/log\/supervisor\/%(program_name)s_stdout.log\nstdout_logfile_maxbytes=10MB\n<\/pre>\n\n\n\n<p>After adding the above lines to the file. Now save and close the file.<\/p>\n\n\n\n<p>Next, tell the supervisor to know about the new config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisorctl reread<\/pre>\n\n\n\n<p>You should get below output<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-30.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"384\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-30-1024x384.png\" alt=\"supervisor\" class=\"wp-image-13307\"\/><\/a><\/figure>\n\n\n\n<p>Next, tell the supervisor to update its configuration:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisorctl update\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-31.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-31-1024x478.png\" alt=\"supervisor\" class=\"wp-image-13308\"\/><\/a><\/figure>\n\n\n\n<p>To verify whether the supervisor has started the nginx service or not run the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisorctl status<\/pre>\n\n\n\n<p>You should get the below output<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-33.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"398\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-33-1024x398.png\" alt=\"supervisor\" class=\"wp-image-13311\"\/><\/a><\/figure>\n\n\n\n<p>To stop the nginx service run the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisorctl stop nginx:nginx_00<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-34.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"415\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-34-1024x415.png\" alt=\"supervisor\" class=\"wp-image-13313\"\/><\/a><\/figure>\n\n\n\n<p>To start the nginx service run the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisorctl start nginx:nginx_00<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-35.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"429\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-35-1024x429.png\" alt=\"supervisor\" class=\"wp-image-13314\"\/><\/a><\/figure>\n\n\n\n<p>You can also verify the nginx process by the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ps -aux | grep nginx\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-36.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"338\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-36-1024x338.png\" alt=\"supervisor\" class=\"wp-image-13317\"\/><\/a><\/figure>\n\n\n\n<p><strong>You may also visit our Magento development services and quality&nbsp;<\/strong> <strong><a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 Extensions<\/a><\/strong>.<\/p>\n\n\n\n<p><strong>For further help or queries, please\u00a0<a href=\"https:\/\/cloudkul.com\/contact\/\">contact<\/a>\u00a0us or raise a\u00a0<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">ticket<\/a>.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Supervisor It is a client\/server system that allows users to control several processes <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,87],"tags":[3,800,805],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install and Configure Supervisor on ubuntu 20.04 - Cloudkul<\/title>\n<meta name=\"description\" content=\"Supervisor is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open source process management system.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install and Configure Supervisor on ubuntu 20.04 - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Supervisor is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open source process management system.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-07T11:24:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-20T11:35:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-27-1024x316.png\" \/>\n<meta name=\"author\" content=\"Saransh Gupta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/\",\"name\":\"How to Install and Configure Supervisor on ubuntu 20.04 - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2023-02-07T11:24:23+00:00\",\"dateModified\":\"2024-12-20T11:35:34+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/192dfa8a1a34baf98d1dcd9b9f2cbdb4\"},\"description\":\"Supervisor is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open source process management system.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install and Configure Supervisor on ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/192dfa8a1a34baf98d1dcd9b9f2cbdb4\",\"name\":\"Saransh Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/90cd23bb6492ae259a2882d76832579a?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/90cd23bb6492ae259a2882d76832579a?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Saransh Gupta\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/saranshgupta-cloud712\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install and Configure Supervisor on ubuntu 20.04 - Cloudkul","description":"Supervisor is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open source process management system.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install and Configure Supervisor on ubuntu 20.04 - Cloudkul","og_description":"Supervisor is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open source process management system.","og_url":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/","og_site_name":"Cloudkul","article_published_time":"2023-02-07T11:24:23+00:00","article_modified_time":"2024-12-20T11:35:34+00:00","og_image":[{"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-27-1024x316.png"}],"author":"Saransh Gupta","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/","url":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/","name":"How to Install and Configure Supervisor on ubuntu 20.04 - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2023-02-07T11:24:23+00:00","dateModified":"2024-12-20T11:35:34+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/192dfa8a1a34baf98d1dcd9b9f2cbdb4"},"description":"Supervisor is a client\/server system that allows users to control several processes running on a UNIX-like operating system. It is a free and open source process management system.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/how-to-install-and-configure-supervisor-on-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install and Configure Supervisor on ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/192dfa8a1a34baf98d1dcd9b9f2cbdb4","name":"Saransh Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/90cd23bb6492ae259a2882d76832579a?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/90cd23bb6492ae259a2882d76832579a?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Saransh Gupta"},"url":"https:\/\/cloudkul.com\/blog\/author\/saranshgupta-cloud712\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/13257"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=13257"}],"version-history":[{"count":37,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/13257\/revisions"}],"predecessor-version":[{"id":19158,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/13257\/revisions\/19158"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=13257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=13257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=13257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}