DEV Community

Cover image for How to Install React on Ubuntu 20.04
HostnExtra Technologies
HostnExtra Technologies

Posted on

How to Install React on Ubuntu 20.04

In this article, we’ll explain how to install React on Ubuntu 20.04.

React is an open-source, front end, JavaScript library for building user interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies.

This article will guide you with the installation process and deploying React site.

Prerequisites

A Ubuntu 20.04 installed dedicated server or KVM VPS.
A root user or normal user with sudo administrator privileges.
Installation of NPM

Install React on Ubuntu 20.04

Install create react app

In this article, we’ll use create-react-app tool. It is easiest and finest tool with production grade configurations pre-built. It is a comfortable environment for learning React, and is the best way to start building a new single-page application in React.

# npm install -g create-react-app

Verify the installation:

# create-react-app --version

Output:

4.0.2

Step 4 - Deploy React application
Create react applicaiton using following command:

# npx create-react-app my-app

Start development server

Once you’ve installed a React application, go to the root directory of your project and start the development server using following command:

# cd my-app

# npm start

You can now view my-app in the browser.

Local: http://localhost:3000
On Your Network: http://192.168.0.102:3000

Build

Bundles the app into static files for production. Run following command:

# npm run build

That’s it. The installation has been completed successfully.

In this article, we have seen how to install React on Ubuntu 20.04.

Top comments (0)