Before installing Node, you need to have installed an Ubuntu Sever. For this guide you need to use: Ubuntu Server 22.04.3 LTS


Node Installation


Before you install Nodemon for the first time on a new host machine, you need install the  specific version of Node.js you need. To follow this guide you have to use: Node.js v18.16.


  1. Install Node.js v18.16:


Commands

Description

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

This command downloads and runs the NVM installation script. The script version may change, so check the latest version in the NVM (Node Version Manager) GitHub repository.

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

To start using NVM, you need to load it into your current session. You can do this by closing and reopening your terminal or by running the command

nvm install 18.16

This command installs the version 18.16 of Node.js

nvm use 18.16

You can make sure you are using version 18.16 with this command:


  1. Install Nodemon:


Commands

Description

npm install -g nodemon

Nodemon is a tool that helps develop Node.js based applications by automatically restarting the application when file changes are detected. To install Nodemon globally, use this command


  1. Install Express.js


Commands

Description

npm install express

This command install the latest version of Express.js


  1. Deploy your application:


Commands

Description

NODE_ENV=development nodemon StartFile.js

Sets the NODE_ENV environment variable to the value development. Environment variables are a way to configure the behavior of applications in the operating system. In the context of Node.js applications, NODE_ENV is commonly used to indicate what environment the application is running in, such as development, production, test, etc.


As a result of executing these commands you must obtain the following result: