Setup Steps
1. Add the NodeSource repository (Node.js 20 LTS):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -2. Install Node.js:
sudo apt install nodejs -y3. Check versions:
node --version
npm --version4. Alternative: Install with nvm (recommended):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
nvm alias default 205. Install global packages:
npm install -g yarn pnpm6. Start a new project:
mkdir project && cd project
npm init -y7. Install packages:
npm install express
npm install -D typescript @types/node8. package.json scripts:
"scripts": {
"dev": "node --watch index.js",
"start": "node index.js"
}Related Guides
Linux VPS Server Setup (Ubuntu)
Configure your Ubuntu-based VPS server from scratch. Security, user management and basic settings.
Apache Web Server Setup
Install Apache HTTP server and configure virtual hosts.
Nginx Web Server Setup
Install Nginx web server and configure it as a reverse proxy.
Let's Encrypt SSL Certificate Setup
Get a free SSL/TLS certificate with Certbot and enable HTTPS.