1️⃣Install NodeJS
We will guide you here on how to install Nodejs with NPM, Apache server, and PM2 process manager.
To install the latest NodeJS version 18.x, type the commands below.
Then run the below command
This will install NodeJS 18.x and NPM to your system. to verify the version, you can check by below command.
Install Apache server.
To install Apache2 package, follow the below command line in your terminal.
Enable required Apache modules:
Next.js projects often use Node.js and require proxying to the Node.js application running on a different port. To enable the required Apache modules, run:
Configure a new virtual host: Create a new virtual host configuration file for your domain.
Replace hostinghub.com with your own domain.
Add the following content to the file. Replace hostinghub.com and www.hostinghub.com with your domain again.
Enable the virtual host: Replace hostinghub.com with your domain.
Restart Apache to apply the changes:
Thats it.
Install PM2 process manager
PM2 is a process manager, to install it, follow the below command line
We will use this service when we install the script.
Last updated