Deployment Overview of Node.js on Server¶
Prerequisites and Basic Requirements¶
The deployment process requires a Linux-based operating system compatible with the APT package manager. The following conditions must be met before initiating the installation:
- Operating System: Debian or Ubuntu.
- Privileges: Root access or a user account with
sudoprivileges. - Network Access: The server must have outbound internet access to download packages and repositories.
- Required Packages: The system must be able to install
curlandnpm.
Application Installation Process¶
The Node.js application is installed using the APT package manager after adding the official NodeSource repository. This ensures the installation of the current stable version of Node.js.
The installation sequence involves the following steps:
- Install the prerequisite packages
curlandnpmusing the APT package manager. - Add the NodeSource APT repository by executing the setup script for the current version.
- Install the
nodejspackage from the newly added repository. - Verify the installation by checking the installed version.
The specific commands executed during this process are:
apt update
apt install -y curl npm
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt install -y nodejs
node -v
Upon successful completion, the system will display the installed Node.js version, confirming that the runtime environment is ready for use.