Skip to content

MCVelasquez45/web-development-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🛠️ Web Development Environment Setup (Linux)

This guide will help you set up a complete development environment on Linux (Ubuntu/Debian) with:

This setup is designed for developers starting from scratch.


🔄 Step 1 — Update System Packages

First, ensure your system is up to date.

sudo apt-get update -y
sudo apt-get upgrade -y

🟩 Step 2 — Install NVM (Node Version Manager)

NVM allows you to install and manage multiple versions of Node.js. This is preferred over installing Node.js directly with apt.

# Download and install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# Load NVM (you may need to restart your terminal afterwards)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

Install Node.js (LTS)

# Install latest LTS version of Node.js
nvm install --lts

# Use the installed version
nvm use --lts

# Verify installation
node -v
npm -v

📝 Step 3 — Install Visual Studio Code

We’ll install VS Code directly from Microsoft’s repository.

# Install wget and gpg if missing
sudo apt-get install -y wget gpg

# Import Microsoft GPG key
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/packages.microsoft.gpg

# Add VS Code repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" | \
  sudo tee /etc/apt/sources.list.d/vscode.list

# Update and install VS Code
sudo apt-get update
sudo apt-get install -y code

Launch VS Code

code

Recommended Extensions:

  • Prettier – Code Formatter
  • ESLint
  • MongoDB for VS Code

🍃 Step 4 — Install MongoDB Community Edition

We’ll install MongoDB 7.0 and run it locally.

# Import MongoDB public GPG key
curl -fsSL https://pgp.mongodb.com/server-7.0.asc | \
  sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor

# Add MongoDB repository
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | \
  sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

# Update and install MongoDB
sudo apt-get update
sudo apt-get install -y mongodb-org

# Start MongoDB service
sudo systemctl start mongod
sudo systemctl enable mongod

# Check status
sudo systemctl status mongod

Open MongoDB shell

mongosh

✅ Step 5 — Verify the Setup

1. Verify Node.js & npm

node -v
npm -v

2. Test Node.js

echo 'console.log("✅ Node.js is working!")' > test.js
node test.js

3. Verify MongoDB

mongosh

You should see the MongoDB shell prompt.


🚀 You’re Ready to Code!

  • Use NVM to switch Node.js versions easily:

    nvm install 20   # Install Node.js 20
    nvm use 20       # Switch to Node.js 20
  • Use VS Code as your editor (code . inside any project folder).

  • Use MongoDB locally for your database.

Happy coding! 🎉

About

Setup for anyone who wants to code using Node.js Vscode and Mongodb community with a Linux.

Resources

License

Stars

Watchers

Forks

Packages

No packages published