This article describes how to migrate an existing Node.js application from the Node.js Selector in cPanel to a manual Node.js installation.
You may need to do this when migrating from a shared, reseller, or Turbo account to a hosting package that does not include the Node.js Selector in cPanel (such as an unmanaged VPS).
In most cases, Node.js applications can be migrated from Node.js Selector with only minor modifications. To do this, follow these steps:
mkdir ~/myapp cd ~/myapp npm init -y
Open the Node.js app tool:
If you are using the Paper Lantern theme, in the SOFTWARE section, click Setup Node.js App.
Modify the application files for the new application environment as follows:
const express = require('express') const app = express() const port = 3000 app.get('/myapp', (req, res) => res.send('Hello World!')) app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.