{"id":146164,"date":"2025-09-03T15:52:55","date_gmt":"2025-09-03T08:52:55","guid":{"rendered":"https:\/\/vinahost.vn\/?p=146164"},"modified":"2025-09-09T15:22:21","modified_gmt":"2025-09-09T08:22:21","slug":"the-definitive-guide-to-deploying-a-node-js-app-with-pm2-and-nginx","status":"publish","type":"post","link":"https:\/\/vinahost.vn\/en\/deploy-nodejs-app-pm2-nginx\/","title":{"rendered":"The Definitive Guide to Deploying a Node.js App with PM2 and Nginx"},"content":{"rendered":"<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Every Node.js developer knows the thrill of seeing their application run perfectly on <\/span><span class=\"inline-code ng-star-inserted\">localhost:3000<\/span><span class=\"ng-star-inserted\">. But the journey from your local machine to a live, stable, and secure production environment is a giant leap. How do you ensure your app stays running 24\/7? How do you handle crashes gracefully? And how do you serve it to the world on a standard, professional domain name?<\/span><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Simply running <\/span><span class=\"inline-code ng-star-inserted\">node app.js<\/span><span class=\"ng-star-inserted\"> on a server and hoping for the best is not a strategy\u2014it&#8217;s a recipe for disaster. Production environments demand robustness, security, and automation.<\/span><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">This is the definitive guide for developers looking to solve that exact problem. We will walk you through the professional, industry-standard method to <\/span><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">deploy a Node.js application on a VPS<\/span><\/strong><span class=\"ng-star-inserted\">. You will learn how to:<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Set up your server<\/span><\/strong><span class=\"ng-star-inserted\"> with a solid security foundation.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install Node.js<\/span><\/strong><span class=\"ng-star-inserted\"> using a flexible version manager.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Use PM2<\/span><\/strong><span class=\"ng-star-inserted\">, a powerful process manager, to keep your app alive forever.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Configure Nginx<\/span><\/strong><span class=\"ng-star-inserted\"> as a reverse proxy to securely serve your app to the world.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Add free SSL<\/span><\/strong><span class=\"ng-star-inserted\"> with Let&#8217;s Encrypt to secure your application with HTTPS.<\/span><\/p>\n<\/li>\n<li>\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Choosing Your Battlefield: The Importance of Server Location<\/span><\/strong><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Before we dive in, let&#8217;s talk about a crucial strategic decision: server location. The physical distance between your server and your users directly impacts your application&#8217;s speed and responsiveness (latency). For a global audience, you might use a CDN, but for a regional user base, placing your server at the heart of that region is paramount.<\/span><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">This guide uses a\u00a0<\/span><strong class=\"ng-star-inserted\"><a class=\"ng-star-inserted\" href=\"https:\/\/vinahost.vn\/en\/dedicated-server-laos\/\" target=\"_blank\" rel=\"noopener\"><span class=\"ng-star-inserted\">server Laos<\/span><\/a><\/strong><span class=\"ng-star-inserted\">\u00a0as its foundation. This is an ideal choice for applications targeting users across the Mekong sub-region, including Laos, Thailand, Vietnam, and Cambodia, ensuring the lowest possible latency and a superior user experience. The principles you learn here, however, are universal and can be applied to any VPS, anywhere in the world.<\/span><\/p>\n<\/li>\n<\/ol>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">By the end of this guide, you will have transformed a blank <\/span><strong class=\"ng-star-inserted\"><a class=\"ng-star-inserted\" href=\"https:\/\/vinahost.vn\/en\/vps-laos\/\" target=\"_blank\" rel=\"noopener\"><span class=\"ng-star-inserted\">VinaHost Laos VPS<\/span><\/a><\/strong><span class=\"ng-star-inserted\"> into a production-grade hosting platform for your JavaScript applications.<\/span><\/p>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">1. The Production Stack: Why PM2 and Nginx?<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Let&#8217;s briefly understand the role of our two key players:<\/span><\/p>\n<ul class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">PM2:<\/span><\/strong><span class=\"ng-star-inserted\"> When your Node.js app crashes, the process stops. PM2 is a guardian that constantly watches your app. If it crashes, PM2 instantly restarts it. It also allows you to run your app in a &#8220;cluster,&#8221; leveraging all CPU cores of your VPS, and provides tools for monitoring and logging.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Nginx:<\/span><\/strong><span class=\"ng-star-inserted\"> Your Node.js app typically runs on a high-numbered port like 3000 or 8080. Nginx is a high-performance web server that sits in front of your app. It listens on the standard web ports (80 for HTTP, 443 for HTTPS) and acts as a &#8220;reverse proxy.&#8221; It takes incoming traffic from users and intelligently forwards it to your Node.js app. This is more secure, more efficient, and allows you to host multiple websites on the same server.<\/span><\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-146276 size-full\" src=\"https:\/\/static.vinahost.vn\/wp-content\/uploads\/2025\/08\/The-Production-Stack_-Why-PM2-and-Nginx.jpg\" alt=\"The Production Stack_ Why PM2 and Nginx\" width=\"700\" height=\"500\" title=\"-\" srcset=\"https:\/\/static.vinahost.vn\/wp-content\/uploads\/2025\/08\/The-Production-Stack_-Why-PM2-and-Nginx.jpg 700w, https:\/\/static.vinahost.vn\/wp-content\/uploads\/2025\/08\/The-Production-Stack_-Why-PM2-and-Nginx-560x400.jpg 560w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">2. Prerequisites<\/span><\/strong><\/h2>\n<ul class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">A VinaHost VPS:<\/span><\/strong><span class=\"ng-star-inserted\"> We&#8217;ll be using a server running <\/span><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Ubuntu 24.xx<\/span><\/strong><span class=\"ng-star-inserted\">.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">A Domain Name:<\/span><\/strong><span class=\"ng-star-inserted\"> You should have a domain name pointed to your VPS&#8217;s IP address.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">An SSH Client:<\/span><\/strong><span class=\"ng-star-inserted\"> PuTTY for Windows or Terminal for macOS\/Linux.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Your Node.js Application:<\/span><\/strong><span class=\"ng-star-inserted\"> Ready to be deployed, likely in a Git repository.<\/span><\/p>\n<\/li>\n<\/ul>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Step 1: Initial Server Setup &amp; Security<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Before deploying any code, we must secure our server. We&#8217;ll perform the essential &#8220;first hour&#8221; security tasks. For a deep dive, check out our <\/span><strong><span class=\"ng-star-inserted\">guide to securing a new VPS<\/span><\/strong><span class=\"ng-star-inserted\">.<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Connect as root:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-92\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-92\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>ssh root<span class=\"hljs-meta\">@your_server_ip<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Create a new sudo user<\/span><\/strong><span class=\"ng-star-inserted\"> (replace <\/span><span class=\"inline-code ng-star-inserted\">devuser<\/span><span class=\"ng-star-inserted\"> with your choice):<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-93\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-93\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>adduser devuser\r\nusermod -aG sudo devuser<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Set up a basic firewall (UFW):<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-94\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-94\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>ufw allow OpenSSH\r\nufw allow <span class=\"hljs-string\">'Nginx Full'<\/span>\r\nufw <span class=\"hljs-built_in\">enable<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Log out and log back in as your new user:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-95\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-95\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>exit\r\nssh devuser<span class=\"hljs-meta\">@your_server_ip<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">From now on, we will execute all commands as this new <\/span><span class=\"inline-code ng-star-inserted\">devuser<\/span><span class=\"ng-star-inserted\">.<\/span><\/p>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Step 2: Installing Node.js with NVM<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Hard-coding a single version of Node.js on a server is inflexible. We&#8217;ll use NVM (Node Version Manager), which allows you to easily install and switch between multiple Node.js versions.<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install NVM:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-96\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-96\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>curl -o- https:<span class=\"hljs-comment\">\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.39.1\/install.sh | bash<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Source your profile to activate NVM:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-97\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-97\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code><span class=\"hljs-built_in\">source<\/span> ~\/.bashrc<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install the latest LTS (Long-Term Support) version of Node.js:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-98\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-98\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>nvm install <span class=\"hljs-comment\">--lts<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Verify the installation:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-99\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-99\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>node -v\r\nnpm -v<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">You should see the versions of Node and npm printed to the console.<\/span><\/p>\n<\/li>\n<\/ol>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Step 3: Get Your Application on the Server<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">The most common way to bring your application code to the server is by using Git.<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install Git:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-100\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-100\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo apt update\r\nsudo apt install git -y<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Clone your repository:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-101\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-101\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>git clone https:<span class=\"hljs-comment\">\/\/github.com\/yourusername\/your-node-app.git<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Navigate into your project directory and install dependencies:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-102\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-102\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code><span class=\"hljs-built_in\">cd<\/span> your-node-app\r\nnpm install<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Note: If your application requires environment variables (like API keys or database credentials), now is the time to create a <span class=\"inline-code ng-star-inserted\">.env<\/span> file.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Test your app<\/span><\/strong><span class=\"ng-star-inserted\"> to make sure it runs correctly:<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-103\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-103\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>node app.js  <span class=\"hljs-comment\"># Or whatever your entry file is<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">If it starts without errors, you&#8217;re ready for the next step. Press <\/span><span class=\"inline-code ng-star-inserted\">Ctrl+C<\/span><span class=\"ng-star-inserted\"> to stop it.<\/span><\/p>\n<\/li>\n<\/ol>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Step 4: Keep Your App Alive with PM2<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Now, we&#8217;ll install PM2 and use it to manage our application process.<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install PM2 globally using npm:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-104\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-104\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo npm install pm2<span class=\"hljs-meta\">@latest<\/span> -g<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Start your application with PM2:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-105\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-105\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>pm2 <span class=\"hljs-keyword\">start<\/span> app.js <span class=\"hljs-comment\">--name my-app<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<ul class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><span class=\"inline-code ng-star-inserted\">pm2 start app.js<\/span><span class=\"ng-star-inserted\">: This is the main command.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><span class=\"inline-code ng-star-inserted\">&#8211;name my-app<\/span><span class=\"ng-star-inserted\">: This gives the process a memorable name, which is useful when you have multiple apps.<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Check the status:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-106\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-106\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>pm2 status<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">You will see a table with your app, its status (<\/span><span class=\"inline-code ng-star-inserted\">online<\/span><span class=\"ng-star-inserted\">), CPU usage, and memory usage.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Crucial Step: Make PM2 start on boot.<\/span><\/strong><span class=\"ng-star-inserted\"> This command generates a startup script that will automatically resurrect all your PM2 processes after a server reboot.<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-107\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-107\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>pm2 startup<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">PM2 will give you a command to run. Copy and paste it into the terminal and execute it. It will look something like <\/span><span class=\"inline-code ng-star-inserted\">sudo env PATH=$PATH:\/home\/user\/.nvm\/versions\/node\/v18.12.1\/bin \/home\/user\/.nvm\/versions\/node\/v18.12.1\/lib\/node_modules\/pm2\/bin\/pm2 startup systemd -u devuser &#8211;hp \/home\/devuser<\/span><span class=\"ng-star-inserted\">.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Save the current process list:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-108\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-108\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>pm2 save<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Your app is now running and managed by PM2. It will restart automatically if it crashes or if the server reboots.<\/span><\/p>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Step 5: Configure Nginx as a Reverse Proxy<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Our app is running (probably on port 3000), but we need Nginx to route public traffic to it.<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install Nginx:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-109\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-109\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo apt install nginx -y<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Create a server block configuration file.<\/span><\/strong><span class=\"ng-star-inserted\"> This file tells Nginx how to handle traffic for your specific domain. Replace <\/span><span class=\"inline-code ng-star-inserted\">your_domain<\/span><span class=\"ng-star-inserted\"> with your actual domain name.<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-110\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-110\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo nano \/etc\/nginx\/sites-available\/your_domain<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Paste the following configuration<\/span><\/strong><span class=\"ng-star-inserted\"> into the file. Read the comments to understand what each part does.<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Nginx<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-111\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-111\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>server {\r\n    <span class=\"hljs-comment\"># Listen on port 80 for incoming connections<\/span>\r\n    listen 80;\r\n    listen [::]:80;\r\n\r\n    <span class=\"hljs-comment\"># The domain name this server block will respond to<\/span>\r\n    server_name your_domain www.your_domain;\r\n\r\n    <span class=\"hljs-comment\"># The location of your website's files (optional, but good practice)<\/span>\r\n    root \/home\/devuser\/your-node-app;\r\n\r\n    <span class=\"hljs-comment\"># Main configuration for proxying requests<\/span>\r\n    location \/ {\r\n        <span class=\"hljs-comment\"># Forward the request to your Node.js app running on port 3000<\/span>\r\n        proxy_pass http:\/\/localhost:3000;\r\n        \r\n        <span class=\"hljs-comment\"># Forward essential headers to your application<\/span>\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Upgrade <span class=\"hljs-variable\">$http_upgrade<\/span>;\r\n        proxy_set_header Connection <span class=\"hljs-string\">'upgrade'<\/span>;\r\n        proxy_set_header Host <span class=\"hljs-variable\">$host<\/span>;\r\n        proxy_cache_bypass <span class=\"hljs-variable\">$http_upgrade<\/span>;\r\n    }\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Make sure to replace <span class=\"inline-code ng-star-inserted\">your_domain<\/span> and <span class=\"inline-code ng-star-inserted\">http:\/\/localhost:3000<\/span> with your actual domain and the port your app is running on.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Enable the configuration file<\/span><\/strong><span class=\"ng-star-inserted\"> by creating a symbolic link to the <\/span><span class=\"inline-code ng-star-inserted\">sites-enabled<\/span><span class=\"ng-star-inserted\"> directory:<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-112\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-112\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo ln -s \/etc\/nginx\/sites-available\/your_domain \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Test your Nginx configuration for syntax errors:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-113\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-113\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo nginx -t<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">If it says <\/span><span class=\"inline-code ng-star-inserted\">syntax is ok<\/span><span class=\"ng-star-inserted\"> and <\/span><span class=\"inline-code ng-star-inserted\">test is successful<\/span><span class=\"ng-star-inserted\">, you&#8217;re good to go.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Restart Nginx to apply the changes:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-114\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-114\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo systemctl restart nginx<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Now, if you visit <\/span><span class=\"inline-code ng-star-inserted\">http:\/\/your_domain<\/span><span class=\"ng-star-inserted\"> in your browser, you should see your Node.js application!<\/span><\/p>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Step 6: Secure Your App with a Free SSL Certificate (HTTPS)<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Running a site on HTTP is not secure. We&#8217;ll use Let&#8217;s Encrypt and Certbot to automatically install a free SSL certificate.<\/span><\/p>\n<ol class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Install Certbot and its Nginx plugin:<\/span><\/strong><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-115\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-115\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo apt install certbot python3-certbot-nginx -y<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Run Certbot.<\/span><\/strong><span class=\"ng-star-inserted\"> It will automatically read your Nginx configuration, issue a certificate for your domains, and reconfigure Nginx to use it.<\/span><\/p>\n<div class=\"container\">\n<p><span class=\"mat-content\"><span class=\"material-symbols-outlined notranslate title-icon\" aria-hidden=\"true\"> code <\/span>Bash<\/span><\/p>\n<div class=\"mat-expansion-panel-content-wrapper\">\n<div id=\"cdk-accordion-child-116\" class=\"mat-expansion-panel-content\" role=\"region\" aria-labelledby=\"mat-expansion-panel-header-116\">\n<div class=\"mat-expansion-panel-body\">\n<pre class=\"ng-star-inserted\"><code>sudo certbot <span class=\"hljs-comment\">--nginx -d your_domain -d www.your_domain<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Follow the prompts.<\/span><\/strong><span class=\"ng-star-inserted\"> It will ask for your email address, agree to the terms of service, and ask if you want to redirect HTTP traffic to HTTPS (choose the redirect option, it&#8217;s more secure).<\/span><\/p>\n<\/li>\n<\/ol>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">That&#8217;s it! Certbot will handle the renewal automatically. Your application is now live, stable, and securely served over HTTPS at <\/span><span class=\"inline-code ng-star-inserted\">https:\/\/your_domain<\/span><span class=\"ng-star-inserted\">.<\/span><\/p>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">3. Scaling Your Operations: Deploying in New Regions<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Congratulations! You have successfully mastered the art of deploying a production-ready Node.js application. The setup on a VinaHost Laos VPS is a powerful foundation for serving users throughout the Indochina peninsula with minimal latency.<\/span><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">However, business growth often means audience growth in new regions. If your application starts gaining traction in markets like Malaysia, Singapore, or Indonesia, serving them from a server in Laos will introduce noticeable delays, negatively impacting user experience.<\/span><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">The professional solution is to replicate this exact high-performance stack on infrastructure physically closer to your new users. To deliver a lightning-fast experience for a Malaysian audience, the optimal strategy is to deploy your application on a\u00a0<\/span><strong class=\"ng-star-inserted\"><a class=\"ng-star-inserted\" href=\"https:\/\/vinahost.vn\/en\/dedicated-server-malaysia\/\" target=\"_blank\" rel=\"noopener\"><span class=\"ng-star-inserted\">server Malaysia<\/span><\/a><\/strong><span class=\"ng-star-inserted\">. This move not only drastically reduces latency but can also improve your site&#8217;s SEO ranking within that specific region. By using the same PM2 and Nginx architecture, you can manage multiple regional deployments with a consistent and reliable workflow.<\/span><\/p>\n<hr class=\"ng-star-inserted\" \/>\n<h2 class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">4. Conclusion: You Are Now a Deployment Pro<\/span><\/strong><\/h2>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">You&#8217;ve gone from a simple <\/span><span class=\"inline-code ng-star-inserted\">node app.js<\/span><span class=\"ng-star-inserted\"> command to a fully-fledged, production-ready deployment. Your Node.js application is now:<\/span><\/p>\n<ul class=\"ng-star-inserted\">\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Always-On:<\/span><\/strong><span class=\"ng-star-inserted\"> Managed by PM2, it will automatically restart on failure or reboot.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">High-Performance:<\/span><\/strong><span class=\"ng-star-inserted\"> Served by the lightning-fast Nginx web server.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Secure:<\/span><\/strong><span class=\"ng-star-inserted\"> Protected by a firewall and served exclusively over HTTPS.<\/span><\/p>\n<\/li>\n<li class=\"ng-star-inserted\">\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Professional:<\/span><\/strong><span class=\"ng-star-inserted\"> Accessible via your own domain name on standard web ports.<\/span><\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-146271 size-full\" src=\"https:\/\/static.vinahost.vn\/wp-content\/uploads\/2025\/08\/Conclusion-You-Are-Now-a-Deployment-Pro.jpg\" alt=\"Conclusion You Are Now a Deployment Pro\" width=\"700\" height=\"500\" title=\"-\" srcset=\"https:\/\/static.vinahost.vn\/wp-content\/uploads\/2025\/08\/Conclusion-You-Are-Now-a-Deployment-Pro.jpg 700w, https:\/\/static.vinahost.vn\/wp-content\/uploads\/2025\/08\/Conclusion-You-Are-Now-a-Deployment-Pro-560x400.jpg 560w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">This robust setup gives you the confidence to build and scale your applications, knowing that the underlying infrastructure is solid.<\/span><\/p>\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><span class=\"ng-star-inserted\">Ready to launch your next big idea? Get the perfect VPS to power it.<\/span><\/strong><\/p>\n<p class=\"ng-star-inserted\"><strong class=\"ng-star-inserted\"><a class=\"ng-star-inserted\" href=\"https:\/\/zalo.me\/115232343349592083\" target=\"_blank\" rel=\"noopener nofollow\"><span class=\"ng-star-inserted\">&gt;&gt; Deploy Your Node.js App on a High-Performance VinaHost VPS Today! &lt;&lt;<\/span><\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every Node.js developer knows the thrill of seeing their application run perfectly on localhost:3000. But the journey from your local machine to a live, stable, and secure production environment is a giant leap. How do you ensure your app stays running 24\/7? How do you handle crashes gracefully? And how do you serve it to&#8230;<\/p>\n","protected":false},"author":36,"featured_media":146276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[147],"tags":[],"class_list":["post-146164","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/posts\/146164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/comments?post=146164"}],"version-history":[{"count":7,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/posts\/146164\/revisions"}],"predecessor-version":[{"id":147088,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/posts\/146164\/revisions\/147088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/media\/146276"}],"wp:attachment":[{"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/media?parent=146164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/categories?post=146164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vinahost.vn\/en\/wp-json\/wp\/v2\/tags?post=146164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}