Deploy SandBox NodeJs Apps
How to deploy NodeJS Apps on Eenos?
This document will help you to deploy a NodeJs app on your eenos hosting control panel. Eenos control panel is a modern hosting control panel designed for modern apps.
Features Of Eenos NodeJs App Management
Eenos control panel has the following wonderful features for easy management of nodeJs apps.
- Manage unlimited NodeJs app domains or subdomains
- NodeJs version Selector
- Deploy NodeJs App with One click
- Set to Production or Development Mode
Every eenos NodeJs app has its own virtual environment. So migration and transfer of hosting accounts are very easy.
To start deploying the NodeJS app, login to your eenos control panel and go to the following Page:
Node.Js -> Deploy Node.Js Apps
Setup NodeJs SandBox and Install Apps
Now you need to fill out the simple form as follows,
Choose Domain For Node.Js App: Select a domain or subdomain for deploying a NodeJs app. This is the website url you are going to deploy the app.
Choose Node.Js Version: The version of the Node.Js distribution required for your project.
Now, you need to set the App settings also, so that the server knows where to start the applications.
App Startup Script: This is the app entry point script. It is normally a javascript file in the project document root ( eg: app.js )
Public Folder Name: This is where you upload your static files like CSS, JS, Images, etc.
Project Publicity Type: This option will help you to set up the project in either production or development mode.
Install Demo App: If you wish to install a demo nodejs app, choose install. If you already developed the app, you can select no and upload the files yourself.
Now, Click the button Deploy App and it will start deploying the app.
Manage NodeJs App From Shell
If your hosting account has enabled SSH access, you can easily manage your NodeJS app from the shell too. You may contact your hosting server provider and enable the ssh shell to access this feature.
You may login to the server with the ssh client from your desktop.
Here, we are going to use the following details to show you how to manage the NodeJS app from the eenos sever shell virtual environment.
Example eenso user: myuser
Example NodeJs app domain: nodejs.mydomain.com
Example eenos ssh server port: 22
The document Root of the App is : ~/nodejs
Login to the SSH terminal
Login to the SSH server with the following command,
ssh myuser@nodejs.mydomain.com -p 22
Activate NodeJs Virtual Environment
Activate the Virtual Sandbox NodeJS environment for the domain nodejs.mydomain.com as follows,
myuser:$ ~ $ source ~/.sandbox/nodejs/nodejs.mydomain.com/bin/activate
(nodejs.mydomain.com) myuser:$ ~ $
Done, you are on the domain's NodeJs environment, and you can start working on your NodeJS app from the terminal.
See some example commands below,
Go to the app document root, list NPMs, and check the nodejs version.
(nodejs.mydomain.com) myuser@:$ ~ $ cd nodejs/
(nodejs.mydomain.com) myuser:$ ~/nodejs $ npm list
nodejs@ /home/myuser/nodejs
├── async@3.2.3
├── express@4.17.3
├── list@2.0.19
├── lodash@4.17.21
├── rxjs@7.5.5
└── yes@1.1.1
(nodejs.mydomain.com) myuser:$ ~/nodejs $node -v
v16.13.0
Deactivate NdoeJs Virtual Environment
You can deactivate the current working NodeJs shell virtual environment using the following command,
(ndoejs.mydomain.com) myuser@:$ ~ $ deactivate
myuser@:$ ~ $
Switch NodeJs SandBox Virtual Environment
If we have another NodeJs app on the domain chat.mydomain.com on the same eenos hosting account, we can switch to the virtual environment for the chat app as follows,
myuser:$ ~ $ source ~/.sandbox/nodejs/chat.mydomain.com/bin/activate
(chat.mydomain.com) myuser:$ ~ $
With the above steps, you can start deploying NodeJs apps. The next session will help you to manage NodeJS NPM modules from the eenos control panel.