FedoraRHEL Based

How To Install ReactJS on Fedora 40

Install ReactJS on Fedora 40

In this tutorial, we will show you how to install ReactJS on Fedora 40. ReactJS is a popular open-source JavaScript library for building dynamic user interfaces. Developed and maintained by Facebook, React has become the go-to choice for many developers looking to create interactive web applications.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the ReactJS on Fedora 40.

Prerequisites

Before we dive into the installation process, ensure that you have the following prerequisites in place:

  • A server running one of the following operating systems: Fedora 40.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • You will need access to the terminal to execute commands. Fedora provides the Terminal application for this purpose. It can be found in your Applications menu.
  • A stable internet connection to download the necessary packages.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install ReactJS on Fedora 40

Step 1. Update the System.

To ensure a smooth installation, it’s crucial to update your Fedora 40 system with the latest packages and security patches. Open a terminal and run the following command:

sudo dnf clean all
sudo dnf update

The package manager will retrieve the latest package information and prompt you to confirm the update. Press “y” and hit Enter to proceed with the update process. Depending on the number of updates available, this step may take a few minutes to complete.

Step 2. Installing Node.js and npm.

ReactJS relies on Node.js and npm (Node Package Manager) to function properly. Fedora 40 includes Node.js in its official repositories, making the installation process straightforward. To install Node.js and npm, execute the following command:

sudo dnf install nodejs npm

Once the installation is complete, verify the installed versions by running:

node -v
npm -v

These commands will display the version numbers of Node.js and npm, respectively.

Step 3. Installing create-react-app Utility

To streamline the process of setting up a new React project, we’ll use the create-react-app utility. This tool provides a pre-configured development environment with all the necessary dependencies and scripts. Install create-react-app globally by running:

sudo npm install -g create-react-app

After the installation finishes, you can verify the installed version with:

create-react-app --version

Step 4. Create a New React Application.

With the prerequisites in place, it’s time to create your first React application. Navigate to the directory where you want to create your project and run the following command:

create-react-app my-react-app

Replace “my-react-app” with your desired project name. This command will generate a new directory with the specified name, containing the basic structure and files for a React application.

Step 5. Start the React Development Server.

Change into the newly created project directory:

cd my-react-app

To start the development server and run your React application, execute:

npm start

This command will compile your application and start a local development server. Once the server is up and running, you can access your React application by opening a web browser and navigating to http://localhost:3000.

Install ReactJS on Fedora 40

Step 6. Configure the Firewall.

To ensure that your React application is accessible from other devices on your network, you may need to configure your firewall to allow traffic on the development server’s port (default is 3000). Run the following command to permanently add a firewall rule:

sudo firewall-cmd --permanent --add-port=3000/tcp

Reload the firewall to apply the changes:

sudo firewall-cmd --reload

You can verify that the rule has been added correctly by listing the active firewall rules:

sudo firewall-cmd --list-all

Congratulations! You have successfully installed ReactJS. Thanks for using this tutorial for installing ReactJS on Fedora 40. system. For additional help or useful information, we recommend you check the ReactJS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button