{"id":577,"date":"2022-06-15T20:43:05","date_gmt":"2022-06-15T18:43:05","guid":{"rendered":"http:\/\/osiris.itabc.cnr.it\/aton\/?page_id=577"},"modified":"2023-04-11T23:05:09","modified_gmt":"2023-04-11T21:05:09","slug":"run-deploy-advanced","status":"publish","type":"page","link":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/","title":{"rendered":"Run &#038; Deploy (advanced)"},"content":{"rendered":"\n<p>This is a more advanced tutorial on how to <strong>run and deploy<\/strong> ATON. You must follow <a href=\"http:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/\" data-type=\"page\" data-id=\"46\">this tutorial and its steps<\/a> first, in order to perform these additional steps and finally run your ATON instance on your production server, workstation, museum kiosk or raspberry pi.<\/p>\n\n\n\n<p>We are going to use a <strong>process manager<\/strong> for NodeJS (<a rel=\"noreferrer noopener\" href=\"https:\/\/www.tecmint.com\/process-managers-for-node-js-applications-in-linux\/\" target=\"_blank\">see here a list<\/a>) to manage ATON services &#8211; in our case <a rel=\"noreferrer noopener\" href=\"https:\/\/pm2.keymetrics.io\/\" target=\"_blank\">PM2<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png\" alt=\"\" class=\"wp-image-583\" width=\"462\" height=\"118\" srcset=\"https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png 584w, https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border-300x77.png 300w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/figure>\n\n\n\n<p>To install PM2 (on every OS) you should just type on command-line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">npm install pm2 -g<\/code><\/pre>\n\n\n\n<p>On debian-based systems (Linux OS servers) you should use <code><strong>sudo <\/strong><\/code>before the command, in order to install PM2 globally.<\/p>\n\n\n\n<p>Now, you can simply run and deploy all ATON services by typing (from main folder):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">pm2 start<\/code><\/pre>\n\n\n\n<p>This will launch ATON services in <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/pm2.keymetrics.io\/docs\/usage\/cluster-mode\/\" target=\"_blank\">cluster mode<\/a><\/strong>, so they will run on each CPU available on the system handling incoming requests, while PM2 will automatically take care of <em>load balancing<\/em> when needed. Furthermore, PM2 will manage services in <em>background<\/em>, so you can comfortably close the prompt\/shell or logout from the device\/server where you launched PM2.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.imgur.com\/kTAowsL.png\" alt=\"\" width=\"1019\" height=\"537\"\/><\/figure>\n\n\n\n<p>You can check that everything is up and running in background by typing <code><strong>pm2 list<\/strong><\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"204\" src=\"http:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/aton-pm2-1024x204.jpg\" alt=\"\" class=\"wp-image-585\" srcset=\"https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/aton-pm2-1024x204.jpg 1024w, https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/aton-pm2-300x60.jpg 300w, https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/aton-pm2-768x153.jpg 768w, https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/aton-pm2.jpg 1371w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>See how the main service is running independently on each CPU, ready to handle incoming requests. The <em>watching <\/em>options also allows to resurrect automatically the service if for some reason it goes down.<\/p>\n\n\n\n<p>If you want to check what&#8217;s happening live, you can type <strong><code>pm2 monit<\/code><\/strong>.<\/p>\n\n\n\n<p>Finally, if you want to stop all services, you can type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">pm2 stop all<\/code><\/pre>\n\n\n\n<p>You can indeed also launch ATON services individually, depending on your scenarios or requirements. For instance you can run <strong>only the &#8220;<em>main<\/em>&#8221; service<\/strong> on a single CPU by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">pm2 start services\/ATON.service.main.js -i 1<\/code><\/pre>\n\n\n\n<p>You can have a look at the <a rel=\"noreferrer noopener\" href=\"https:\/\/pm2.keymetrics.io\/docs\/usage\/quick-start\/\" target=\"_blank\">official PM2 documentation<\/a> for more options!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a more advanced tutorial on how to run and deploy ATON. You must follow this tutorial and its steps first, in order to perform these additional steps and finally run your ATON instance on your production server, workstation, museum kiosk or raspberry pi. We are going to use a process manager for NodeJS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":695,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-577","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Run &amp; Deploy (advanced) - ATON<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Run &amp; Deploy (advanced) - ATON\" \/>\n<meta property=\"og:description\" content=\"This is a more advanced tutorial on how to run and deploy ATON. You must follow this tutorial and its steps first, in order to perform these additional steps and finally run your ATON instance on your production server, workstation, museum kiosk or raspberry pi. We are going to use a process manager for NodeJS [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/\" \/>\n<meta property=\"og:site_name\" content=\"ATON\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-11T21:05:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/\",\"url\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/\",\"name\":\"Run & Deploy (advanced) - ATON\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/pm2-border.png\",\"datePublished\":\"2022-06-15T18:43:05+00:00\",\"dateModified\":\"2023-04-11T21:05:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/#primaryimage\",\"url\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/pm2-border.png\",\"contentUrl\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/pm2-border.png\",\"width\":584,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/run-deploy-advanced\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Getting Started\",\"item\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/index.php\\\/tutorials\\\/getting-started\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Run &#038; Deploy (advanced)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/#website\",\"url\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/\",\"name\":\"ATON\",\"description\":\"open-source Web3D\\\/WebXR framework by CNR ISPC\",\"publisher\":{\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/#organization\",\"name\":\"ATON\",\"url\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/aton-logo-100.png\",\"contentUrl\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/aton-logo-100.png\",\"width\":100,\"height\":100,\"caption\":\"ATON\"},\"image\":{\"@id\":\"https:\\\/\\\/osiris.itabc.cnr.it\\\/aton\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Run & Deploy (advanced) - ATON","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:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/","og_locale":"en_US","og_type":"article","og_title":"Run & Deploy (advanced) - ATON","og_description":"This is a more advanced tutorial on how to run and deploy ATON. You must follow this tutorial and its steps first, in order to perform these additional steps and finally run your ATON instance on your production server, workstation, museum kiosk or raspberry pi. We are going to use a process manager for NodeJS [&hellip;]","og_url":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/","og_site_name":"ATON","article_modified_time":"2023-04-11T21:05:09+00:00","og_image":[{"url":"http:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/","url":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/","name":"Run & Deploy (advanced) - ATON","isPartOf":{"@id":"https:\/\/osiris.itabc.cnr.it\/aton\/#website"},"primaryImageOfPage":{"@id":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/#primaryimage"},"image":{"@id":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/#primaryimage"},"thumbnailUrl":"http:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png","datePublished":"2022-06-15T18:43:05+00:00","dateModified":"2023-04-11T21:05:09+00:00","breadcrumb":{"@id":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/#primaryimage","url":"https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png","contentUrl":"https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/06\/pm2-border.png","width":584,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/run-deploy-advanced\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/osiris.itabc.cnr.it\/aton\/"},{"@type":"ListItem","position":2,"name":"Tutorials","item":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/"},{"@type":"ListItem","position":3,"name":"Getting Started","item":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/tutorials\/getting-started\/"},{"@type":"ListItem","position":4,"name":"Run &#038; Deploy (advanced)"}]},{"@type":"WebSite","@id":"https:\/\/osiris.itabc.cnr.it\/aton\/#website","url":"https:\/\/osiris.itabc.cnr.it\/aton\/","name":"ATON","description":"open-source Web3D\/WebXR framework by CNR ISPC","publisher":{"@id":"https:\/\/osiris.itabc.cnr.it\/aton\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/osiris.itabc.cnr.it\/aton\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/osiris.itabc.cnr.it\/aton\/#organization","name":"ATON","url":"https:\/\/osiris.itabc.cnr.it\/aton\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/osiris.itabc.cnr.it\/aton\/#\/schema\/logo\/image\/","url":"https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/12\/aton-logo-100.png","contentUrl":"https:\/\/osiris.itabc.cnr.it\/aton\/wp-content\/uploads\/2022\/12\/aton-logo-100.png","width":100,"height":100,"caption":"ATON"},"image":{"@id":"https:\/\/osiris.itabc.cnr.it\/aton\/#\/schema\/logo\/image\/"}}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/pages\/577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/comments?post=577"}],"version-history":[{"count":20,"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/pages\/577\/revisions"}],"predecessor-version":[{"id":1016,"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/pages\/577\/revisions\/1016"}],"up":[{"embeddable":true,"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/pages\/695"}],"wp:attachment":[{"href":"https:\/\/osiris.itabc.cnr.it\/aton\/index.php\/wp-json\/wp\/v2\/media?parent=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}