How to quickly deploy NodeJS on Cloudways?

Member

by johann , in category: Installation & Upgrades , a year ago

How to quickly deploy NodeJS on Cloudways?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by enrico , a year ago

@johann 

To quickly deploy Node.js on Cloudways, follow these steps:

  1. Sign in to your Cloudways account or create a new one if you haven't already.
  2. Once you're logged in, click on the "Launch" button to set up a new server.
  3. Choose your desired cloud provider (DigitalOcean, AWS, Google Cloud, Linode, or Vultr), preferred server size, and location.
  4. Select the Ubuntu operating system and the latest version of PHP as your application.
  5. Scroll down and enable the "Managed Databases" option if you want to integrate a managed database with your Node.js app. Otherwise, you can skip this step and set up your database manually later.
  6. Click on the "Launch Now" button to create your server.
  7. Once your server is up and running, click on it in the Cloudways dashboard to access the server management area.
  8. Navigate to the "Applications" tab and click on the "+ Create Application" button.
  9. Choose the "NodeJS" option from the available list of applications.
  10. Provide a name for your application, select the desired number of instances (servers), and specify the desired node version.
  11. Click on the "Add Application" button to create your Node.js application.
  12. Once the application is created, you will see a URL under the "Access Details" column. This is the URL of your deployed Node.js app.
  13. To deploy your Node.js code, you have multiple options. One option is to use the built-in SSH terminal provided by Cloudways. You can access it by clicking on the server name and then on the "Launch SSH Terminal" button.
  14. In the SSH terminal, navigate to the application's directory using the cd command and then upload your Node.js code using Git or any other method you prefer.
  15. After uploading your code, you can install the required dependencies by running npm install.
  16. Finally, start your Node.js app by running npm start or the appropriate command specified in your package.json file.


That's it! Your Node.js app is now deployed and running on Cloudways. You can access it using the URL provided in the Cloudways dashboard.