×

React is a very powerful front-end library of JavaScript that can be used to define user interfaces and related components.

It is an open-source library that is maintained by Facebook.

It uses Virtual DOM that makes the app fast.

Also, It offers a rich set of features including, Virtual DOM, One-way Data Binding, Components, JSX, Conditional Statements and many more.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related ReactJS queries.

In this context, we shall look into how to install ReactJS on your Ubuntu 20.04 system.


How to install ReactJS on your Ubuntu 20.04 System ?

To install ReactJS and running the respective applications on your Ubuntu 20.04 system, you need to perform the steps that follow.


1. Add the Relevant PPA Repository to your Ubuntu 20.04 System:

You need to add the NodeJS PPA repository to your Ubuntu 20.04 system since a ReactJS application can only run on your system if NodeJS is installed on your system. 

The said repository can be added with the following command:

$ curl –sL https://deb.nodesource.com/setup_14.x | sudo bash -


2. Install NodeJS on your Ubuntu 20.04 System:

After that, you can install NodeJS on your Ubuntu 20.04 system with the following command:

$ sudo apt install nodejs –y


3. Check the Installed Version of NodeJS on your Ubuntu 20.04 System:

You can verify the successful installation of NodeJS on your Ubuntu 20.04 system by checking its version with the following command:

$ node –v

This will show the version of NodeJS on our Ubuntu 20.04 system.


4. Install Yarn on your Ubuntu 20.04 System:

Now you need to install Yarn on your Ubuntu 20.04 system, with the following command:

$ sudo npm install –g yarn


5. Create your First ReactJS Application on Ubuntu 20.04:

You can now create your first ReactJS application on Ubuntu 20.04 with the following command:

$ sudo npm init react-app myfirstreactapp

Alternatively, you can also create a ReactJS application with the command that follows:

$ yarn create react-app myfirstreactapp

It will take a few minutes for the successful creation of a ReactJS application.


6. Navigate to your ReactJS Project Directory:

After creating your ReactJS application successfully, you need to move to its project directory with the following command:

$ cd myfirstreactapp


7. Start your ReactJS Application in Ubuntu 20.04:

Now you need to start your ReactJS application with the command shown below:

$ npm start

It will take some time for the development server to start.

You will be able to view your ReactJS application in your default web browser by giving your localhost address followed by port number ":3000".


[Need urgent assistance in installing Software on Ubuntu Linux System ? We are available to help you. ]


Conclusion

More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com