How to Install Express.js in 2026: A Beginner-Friendly Guide
If you are starting your journey in Node.js and backend development, Express.js is one of the most useful frameworks to learn. Express.js simplifies the process of building web applications and REST APIs with JavaScript.
In this guide, we’ll walk through the basics of installing Express.js in 2026, creating your first project, and running a simple Express server. The steps are based on the original guide from The Full Stack.
What Is Express.js?
Express.js is a lightweight and open-source web framework built on top of Node.js. It provides developers with simple tools for creating web applications, APIs, routing systems, and server-side applications.
Some of its key features include:
- Simple and flexible architecture
- Powerful routing
- Middleware support
- REST API development
- Easy integration with databases
- Support for scalable applications
Because of its simplicity and flexibility, Express.js is widely used in modern JavaScript backend development.
Prerequisites Before Installing Express
Before installing Express.js, you need Node.js and npm installed on your computer.
You can check whether Node.js is already installed by opening your terminal or command prompt and running:
node -vYou can also check the npm version with:
npm -vIf Node.js is not installed, download it from the official Node.js website before continuing.
Step 1: Create a New Project
Open your terminal and create a new project directory:
mkdir my-express-appMove into the newly created directory:
cd my-express-appThis directory will contain your Express application files.
Step 2: Initialize the Node.js Project
Now initialize your project using npm:
npm init -yThis command creates a package.json file.
The package.json file is important because it stores information about your project and keeps track of its dependencies and scripts.
Step 3: Install Express.js
Once your Node.js project is initialized, install Express using npm:
npm install expressThis installs Express locally inside your project and adds it as a dependency.
You can check the installed package with:
npm list expressInstalling Express locally is generally preferable to installing it globally because individual projects can maintain their own dependency versions.
Step 4: Create Your First Express Application
Create a file called:
app.jsThen add the following code:
const express = require('express');const app = express();
const port = 3000;app.get('/', (req, res) => {
res.send('Hello World!');
});app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
This code creates an Express application and starts a server on port 3000.
Step 5: Run Your Express Server
Save the app.js file and run:
node app.jsIf everything is configured correctly, your terminal will indicate that the server is running.
Now open your browser and visit:
http://localhost:3000You should see:
Hello World!
Congratulations! You have successfully created your first Express.js application.
Understanding Express Routing
One of the most important features of Express is routing.
Get Nikita Kamble’s stories in your inbox
Join Medium for free to get updates from this writer.
For example:
app.get('/about', (req, res) => {
res.send('About Page');
});Now when you visit:
http://localhost:3000/aboutExpress will execute the corresponding route.
You can work with different HTTP methods, including:
- GET
- POST
- PUT
- DELETE
These methods are essential when developing REST APIs and web applications.
What Is Middleware in Express?
Middleware functions are another important part of Express.js.
Middleware can be used for tasks such as:
- Authentication
- Logging
- Request processing
- Error handling
- Data validation
A middleware function typically works with req, res, and next and can pass control to another middleware or route handler.
Why Should Developers Learn Express.js?
Express.js is a valuable technology for developers who want to build backend applications using JavaScript.
By learning Express, you can move from basic JavaScript development to creating:
- REST APIs
- Backend services
- Web applications
- Authentication systems
- Database-driven applications
- Full-stack projects
Express is also commonly used alongside technologies such as MongoDB, React, Node.js, and other JavaScript tools.
Common Beginner Mistakes
When starting with Express.js, beginners often face a few simple issues:
1. Node.js Is Not Installed
If node -v doesn't work, install Node.js first.
2. Wrong Project Directory
Make sure you run npm install express inside your project folder.
3. Server Is Not Started
Remember to run:
node app.js4. Incorrect Port
If another application is already using port 3000, you may need to choose another available port.
What Should You Learn After Express Installation?
Installing Express is only the beginning. Once you understand the basics, you can start learning:
- Express routing
- Middleware
- REST API development
- CRUD operations
- Authentication and authorization
- Database integration
- Error handling
- API security
- Deployment
- Full-stack application development
These concepts will help you progress from a beginner Express developer to a confident backend developer.
Final Thoughts
Express.js provides a simple and flexible way to build backend applications with Node.js. The installation process is straightforward: install Node.js, create a project, initialize npm, install Express, create an application file, and start your server.
Once you have successfully created your first Hello World application, the next step is to practice building routes, APIs, middleware, and database-connected applications.
If you’re learning full-stack development in 2026, Node.js + Express.js is a strong combination to add to your development toolkit.
For the original step-by-step reference, see The Full Stack’s guide to installing Express.js.
Medium Tags
#ExpressJS #NodeJS #JavaScript #WebDevelopment #BackendDevelopment #RESTAPI #FullStackDevelopment #Programming #SoftwareDevelopment #Coding #MERNStack #NodeJSDeveloper





