To launch NodeJS on Cloudways, follow these steps:
- Sign in to your Cloudways account or create a new account if you don't have one.
- Once you're logged in, click on the "Launch" button from the top menu.
- Select the desired cloud infrastructure provider such as Amazon Web Services (AWS), DigitalOcean, Vultr, Linode, Google Cloud Platform (GCP), or others.
- Select the server size and location for your NodeJS application. It's recommended to choose a server location closest to your audience for better performance.
- Choose the PHP stack as the application type, even if you're planning to use NodeJS. This selection is to ensure that the server is configured correctly.
- Provide a server name and select the project you want to associate with this server.
- Enable Varnish and Redis for better performance, if required.
- Click on "Launch Now" to create your server.
- Once the server is launched, go to the "Application Management" tab.
- Click on "Access Details" to get your SSH credentials.
- Use an SSH client like PuTTY to connect to your server using the provided credentials.
- After connecting to the server, install NodeJS by running the following commands:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
- Verify the installation by running node -v and npm -v commands. You should see the versions of NodeJS and npm installed.
- Upload your NodeJS application files to the server using FTP or any other preferred method.
- Install the required dependencies by navigating to the application directory and running npm install.
- Start your NodeJS application using the command node app.js or any other command based on your application setup.
- Verify that your NodeJS application is running successfully.
That's it! You have successfully launched your NodeJS application on Cloudways.