Installing React on Ubuntu 24.04 LTS and creating a Vite + React App in Linux

Posted by

How to install React on Ubuntu 24.04 LTS

How to install React on Ubuntu 24.04 LTS

To install React on Ubuntu 24.04 LTS, we will use Vite + React to create a new React app. Follow these steps to get started:

Step 1: Install Node.js

First, you need to install Node.js on your Ubuntu 24.04 LTS system. You can do this by running the following commands in your terminal:


sudo apt update
sudo apt install nodejs
sudo apt install npm

Step 2: Install Vite

Next, we will install Vite, which is a build tool for modern web development. To install Vite, run the following command:


npm install -g create-vite

Step 3: Create a new React app using Vite

Now, we will create a new React app using Vite. Run the following command to create a new React app in your desired directory:


create-vite my-react-app --template react
cd my-react-app
npm install

Step 4: Start the React app

Finally, you can start your React app by running the following command:


npm run dev

This will start a development server, and you can access your React app by opening your browser and navigating to http://localhost:3000.

Congratulations! You have successfully installed React on Ubuntu 24.04 LTS and created a new React app using Vite. Happy coding!