This will install NodeJS 18.x and NPM to your system. to verify the version, you can check by below command.
node-v
Output
v18.17.0
Install Apache server.
To install Apache2 package, follow the below command line in your terminal.
sudoaptinstallapache2
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:
sudoa2enmodproxy
sudoa2enmodproxy_http
sudoa2enmodproxy_balancer
Configure a new virtual host: Create a new virtual host configuration file for your domain.
Replace domain.online with your own domain.
Add the following content to the file. Replace domainhub.online and www.domainhub.online with your domain again.
Enable the virtual host: Replace domainhub.online 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.