<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ubuntu 18.04 &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/ubuntu-18-04/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Wed, 21 Jul 2021 13:16:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Ubuntu 18.04 &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Setup Node.js Persistent Applications on Ubuntu 18.04</title>
		<link>https://help.hostry.com/knowledge-base/how-to-setup-node-js-persistent-applications-on-ubuntu-18-04/</link>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 07:29:06 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=3826</guid>

					<description><![CDATA[Based on the Chrome V8 Engine, Node.js is a popular language used to build highly scalable applications. He is already involved in many projects. Node.js applications are popular for their scalability. Running multiple concurrent processes on multiple servers reduces latency and increases uptime. This article will guide you through how [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Based on the Chrome V8 Engine, <strong>Node.js</strong> is a popular language used to build highly scalable applications. He is already involved in many projects. Node.js applications are popular for their scalability. Running multiple concurrent processes on multiple servers reduces latency and increases uptime. This article will guide you through how you can set up saving an application. The guide targets <em>Ubuntu</em> <strong>18.04</strong> and also <strong>20.04</strong> servers.</p>



<h2 id="install-node-js" >Install Node.js.</h2>



<p>In order to install Node.js you need to enter the following:</p>



<pre class="wp-block-code"><code>apt-get update
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install -y nodejs</code></pre>



<h2 id="install-yarn" >Install Yarn</h2>



<p>Yarn is Facebook&#8217;s very easy-to-use package manager for Node.js packages. Recommended for installation! This can be done as follows:</p>



<pre class="wp-block-code"><code>curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update &amp;&amp; apt-get install yarn</code></pre>



<h2 id="install-node-js-app" >Install Node.js app</h2>



<p>If your application is hosted in a git repository, you need to clone it and then use the command:</p>



<pre class="wp-block-code"><code>yarn install</code></pre>



<p>Then you install <strong>Process Manager 2</strong>. This is a special package that automatically launches applications. It is a very reliable tool; proof of this is that this tool is used by <strong>PayPal</strong>, <strong>Microsoft</strong>. You can install it using the following command:</p>



<pre class="wp-block-code"><code>yarn global add pm2</code></pre>



<p>The next step is to add the application as your personal process. It will run in background mode. To do this, you can use the following command:</p>



<pre class="wp-block-code"><code>pm2 start &#91;path to your entry.js] -i max</code></pre>



<h2 id="automatically-launch-the-app-at-boot-mode" >Automatically Launch the App at Boot Mode</h2>



<p>After starting the application, save the application configuration. Then run the startup command to automatically start Process Manager 2 in the background when you boot Ubuntu. For <strong>Ubuntu</strong> 16.04 Process Manager 2 will bind to <strong>systemd</strong></p>



<pre class="wp-block-code"><code>pm2 save
pm2 startup </code></pre>



<p>After successfully entering these commands, the Node.js application will crash due to an error, it will restart then immediately automatically. However, if Ubuntu crashes for any reason, the process will automatically restart from Ubuntu</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
