Updated on Oct 6, 2023
If you are just starting out with Node.js and you have access to a CloudLinux server, which is a derivative of AlmaLinux, then you should check out the Node.js Selector tool. It is a graphical interface that helps immensely with the deployment of Node.js applications. No command line is involved, and everything is done via the tool’s interface. It is simple, easy, and convenient for beginners. We wanted to mention it because the tool is available on our services, and we found it prudent to bring it up. The Selector will show you precisely what you need to do to get your application running and will also show you any errors that may occur during the deployment process.
When you open the Selector, you will see a list of all Node.js applications currently deployed through the Selector. You can edit, stop, start, restart, and delete the applications from this screen or create a new one. When creating a new application, several fields must be filled, and that is what we meant: that the tool itself will tell you what you need to do. Firstly, select the Node version you wish to use and if you want to run the application in production or development. Next are these fields:
As you can see, this is a convenient way of deploying your applications without using the command line. You can’t code and package an application through the interface, but at least the deployment can be automated for you. Now, let us show you an example of the setup process with the “Hello World” application. To begin, log into cPanel or DirectAdmin and locate the Node.js Selector. Its name may vary, but it is called Setup Node.js App on our services and is located in the Software section.
Since we used the “Hello World” application, there were no errors; it is simple. It has no real potential for encountering errors. If you encounter any errors, they will appear in the top right corner during deployment.
Finally, if you have recently added any new modules or packages to your application’s package.json file, you can install them from the Node.js Selector’s interface as well. Simply click on the pencil icon next to your application to edit it, and then Run NPM Install. That will go through the package.json file and install any missing modules. If any errors occur, they will also appear in the top right, informing you of what has gone wrong and why the installation can’t proceed.
With this, our beginner section of working with Node.js concludes. We hope we gave you a foundational understanding of how a basic application works and how to deploy it. Next up, we will write a slightly more complex application to provide you with a more in-depth example of working with Node.js.