How To Install ReactJS on Debian 11

Install ReactJS on Debian 11

In this tutorial, we will show you how to install ReactJS on Debian 11. For those of you who didn’t know, React is an open-source JavaScript library and used to develop front-end web applications. It allows you to make reusable components for a single-page user interface. It is developed and maintained by Facebook and a large community of developers. ReactJS can be used in the development of Web Applications or Mobile Apps.

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 through the step-by-step installation of the ReactJS on a Debian 11 (Bullseye).

Install ReactJS on Debian 11 Bullseye

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt upgrade
sudo apt install build-essential

Step 2. Installing Node.js.

Node.js allows you to run JavaScript on the server-side and outside of the browser. Now we add the official Node.js repository manually on Debian 11:

curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -

Once the repository is added successfully, you can now install Node.js using the following command below:

sudo apt install nodejs

Finally, check the Node.js version using the following command:

node -v

Check the npm version:

npm -v

Step 3. Installing React.js on Debian 11.

After installing the node and npm, to create an app, the following command is needed to download the necessary dependencies your app needs to run:

npm install -g create-react-app

Next, create a React app with the following command below:

create-react-app reactapp

Output:

Success! Created reactapp at /root/reactapp
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd reactapp
  npm start

Then, change the directory into the app. NB: reactapp is the name of the app you want to create:

cd reactapp
npm start 0.0.0.0

Output:

> [email protected] start
> react-scripts start "0.0.0.0"
Compiled successfully!

You can now view reactapp in the browser.

  http://localhost:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

Step 4. Accessing ReactJS Web Interface.

Once successfully installed, open your web browser and test your React application using the URL http://your-server-ip-address:3000. You should see the React default page:

Install ReactJS on Debian 11 Bullseye

Congratulations! You have successfully installed ReactJS. Thanks for using this tutorial for installing the latest version of the ReactJS on Debian 11 Bullseye. For additional help or useful information, we recommend you check the official 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!