Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • jQuery
  • AngularJS
  • ReactJS
  • Next.js
  • React Native
  • NodeJS
  • Express.js
  • MongoDB
  • MERN Stack
  • PHP
  • WordPress
  • Bootstrap
  • Tailwind
  • CSS Frameworks
  • JS Frameworks
  • Web Development
Open In App
Next Article:
How to Learn ReactJS in 2025?
Next article icon

How to Install ReactJS on Linux

Last Updated : 17 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Installing ReactJS on a Linux system is the first step toward building dynamic, interactive web applications. ReactJS, a popular JavaScript library developed by Facebook, is widely used for creating user interfaces. Setting it up on Linux ensures a smooth development environment for building and running your React applications.

In this guide you will learn how using tools like Node.js, npm (Node Package Manager), and create-react-app, you can set up a React development environment in no time.

Note: Whether you’re using Ubuntu, Fedora, or any other Linux distribution, these steps will help you get started with React development quickly and efficiently.

Requirements

Before starting the ReactJS on Linux installation process, there are a few prerequisites that you need to have in place:

System Requirements

  • Linux-based operating system: Ubuntu, Fedora, Debian, etc.
  • Node.js: ReactJS relies on Node.js for package management and running JavaScript code outside the browser.
  • npm (Node Package Manager): npm is used to install packages and dependencies required for React applications.
  • A terminal or command-line interface: To run the installation commands.

Required Tools and Software

  • Node.js: ReactJS requires Node.js to run.
  • npm: The Node Package Manager (npm) will help you install React and its dependencies.
  • Git (optional): It’s helpful if you plan to use version control or clone repositories from GitHub.

Install ReactJS on Linux (Step-by-Step Guide)

To get started, you need to install Node.js on your computer. When you do, npm (Node Package Manager) will usually be installed automatically because it comes with Node.js.

Help: If npm doesn't install automatically, you can download and install it separately from the npm website.

Step 1: Installation of Node.js

The first step in installing ReactJS is to ensure that Node.js is installed on your system. ReactJS requires Node.js to run JavaScript on the server side and handle package management.

1. Update System Package List

  • Open your terminal. and update the system package list.
Command: sudo apt update
Update-System-Package-List
Updating System Package List

2. Install Node.js

  • Now write the command in your terminal, after updating the package list.
Command: sudo apt install nodejs
Installing-Nodejs
Installing NodeJS

3. Installation verification

  • You should see the version of Node.js installed on your system.
Command: node -v
Installation-verification
Installation verification

Step 2: Install npm (Node Package Manager) if not Installed

npm is the default package manager for Node.js, and it will be needed to install ReactJS and other dependencies.

1. Install npm

  • If npm is not installed with Node.js, install it manually.
Command: sudo apt install npm

2. Installation verification

  • You should see the version of npm installed on your system.
Command: npm -v
npm-Installation-Verification
Installation verification

Step 3: Install ReactJS using Create React App

Create React App is a tool that allows you to set up a React project with a single command. It sets up a modern web development environment with a good default configuration.

1. Create a new React applications

  • This command will create a folder called my-app with all the files and configurations required for a React project

Command: npx create-react-app my-app

2. Navigate to Your Desired Directory for the React Application

  • Once the installation is complete, navigate into the newly created project folder.
Command: cd my-app

3. Starting the server

  • Start the development server.
Command: npm start
Starting-Server
Starting the server
  • After running the above command, the development server will start, and you can open your browser and go to http://localhost:3000 to see your React app running.

Step 4: Verifying the Installation

Once the development server is running, open your browser and go to http://localhost:3000. If everything is set up correctly, you should see the default React welcome page with a "Learn React" message. This confirms that React has been successfully installed on your Linux system.

ReactJS on Linux Alternate Method

While Create React App is the most popular way to set up a React project, there are other alternative methods available for creating a React app.

Using npx

npx is a package runner tool that comes with npm. It allows you to run commands without installing them globally on your system.

  • This will create a new React app in the my app folder without needing to install create-react-app globally.
Command: npx create-react-app my-app

Note: The server will start by the same command that is npm start.

Using Yarn

Yarn is an alternative package manager to npm that is faster and more reliable in some cases. If you prefer Yarn over npm, you can follow these steps to install React.

1. Yarn Installation

To install yarn write the command in your terminal which is given below-

Command: npm install --global yarn

2. Create a new React app

  • Create a new React app using Yarn.
Command: yarn create react-app my-app

3. Navigate to the Project Folder and Start the Development Server

  • Navigate to the project folder and start the server.
Command: cd my-app
Command: yarn start

ReactJS on Linux - Troubleshooting Common Issues & Errors

1. Node.js or npm not found

If you encounter the error "node: command not found" or "npm: command not found," it usually means that Node.js and npm are not installed correctly. solution is given below:-

  • Make sure to follow the installation steps for Node.js and npm carefully.
  • Try reinstalling Node.js and npm using the instructions provided above.

2. Missing dependencies or build errors

Sometimes, when installing React or running the development server, you may encounter errors related to missing dependencies or build issues. solution is given below:-

  • Run the following command to install the required dependencies.
Command: npm install
  • If you are using yarn, run:-
Command: yarn install

3. Server not running on localhost

If the React development server does not start on http://localhost:3000, you may need to check the port or firewall settings. solution for this is given below:-

  • Check if another process is using port 3000 by running.
Command: lsof -i :3000
  • If another process is using the port, stop it and try restarting your React app.

Conclusion

Installing ReactJS on Linux is a easy process with multiple methods to choose from. Whether you prefer using Create React App, Yarn, or npx, the setup steps are simple and easy to follow. Once React is installed, you’ll be ready to build fast, scalable, and dynamic web applications with ease. These methods offer flexibility, allowing you to pick the one that best fits your workflow. Start leveraging the power of React to create high-performance user interfaces and enhance your web development projects today.


Next Article
How to Learn ReactJS in 2025?

S

shashwatbokos
Improve
Article Tags :
  • TechTips
  • Web Technologies
  • react-js

Similar Reads

  • How to Install ReactJS on MacOS
    Are you looking to set up ReactJS on your Mac? Whether you’re using a MacBook Air, MacBook Pro, iMac, or any macOS version like Monterey, Ventura, Big Sur, or macOS 15 Sequoia, this step-by-step guide is here to help. ReactJS, the popular JavaScript library for building dynamic user interfaces, requ
    4 min read
  • How to Install Node.js on Linux
    Installing Node.js on a Linux-based operating system can vary slightly depending on your distribution. This guide will walk you through various methods to install Node.js and npm (Node Package Manager) on Linux, whether using Ubuntu, Debian, or other distributions. PrerequisitesA Linux System: such
    6 min read
  • How to install node-sass to React project?
    Sass is a scripting language that is compiled into Cascading Style Sheets (CSS). It is a kind of preprocessor language. It was initially designed by Hampton Catlin and then it was developed by Natalie Weizenbaum. After its initial versions, Weizenbaum and Chris Eppstein have continued to extend SASS
    2 min read
  • How to Learn ReactJS in 2025?
    npx create-react-app myapp npm start npm run build npm install Aren't all the above commands familiar to you? If yes, then you might be working on React, or you might have started working on this amazing JavaScript Library. If you're a passionate developer, then surely you might be aware of the popu
    10 min read
  • How To Install Bootstrap in ReactJS?
    Bootstrap is one of the most popular CSS frameworks for developing responsive and mobile-first websites. Integrating Bootstrap with ReactJS helps you build sleek, responsive interfaces quickly and easily. In this article, we will walk you through the step-by-step process of installing Bootstrap in R
    4 min read
  • How to Install NodeJS on MacOS
    Node.js is a popular JavaScript runtime used for building server-side applications. It’s cross-platform and works seamlessly on macOS, Windows, and Linux systems. In this article, we'll guide you through the process of installing Node.js on your macOS system. What is Node.jsNode.js is an open-source
    7 min read
  • How To Install NodeJS on Your System?
    To run JavaScript outside a browser or use frameworks like React or Express, you need Node.js. Let's see how to install Node.js on Windows, Linux, and Mac systems, ensuring you’re ready for JavaScript development. Installing Node.js on WindowsIn this section, we'll discuss the three different method
    6 min read
  • How to integrate React-PDF in ReactJS ?
    React-PDF is a package that helps users to display PDF files in their React app. By using the react-pdf package we can add PDF files in our React app as if they were images. To use the latest version of react-pdf package, our project should use React 16.3 or later. We can integrate react-pdf using t
    2 min read
  • How to Implement Chakra UI in ReactJS ?
    Chakra UI is a powerful component library for React that is designed and developed by Segun Adebayo to build front-end applications. The Chakra UI comes with simple yet easy-to-understand documentation that gives us guidelines on how to build a reusable component, thereby reducing the time spent on
    3 min read
  • How to add code input in React JS?
    In this article, we are going to learn how we can add Code Input in React JS. React is a front-end JavaScript library for constructing user interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies. Approach to add code input: To incorporate our
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences