Setup ReactJS on Ubuntu in Azure/AWS/GCP

Setup and install Reactjs on Ubuntu 24.04 in Azure, AWS or Google GCP.  Run the latest version of React.js using the publicly available image from the marketplace.

Cloud React.js on Ubuntu

Reactjs on Azure

Reactjs Azure

Deploy React.js on Ubuntu 24.04 in Azure

Reactjs on AWS

Coming soon…

Reactjs on GCP

Coming soon…

Getting Started with ReactJS on Ubuntu

Once your React.JS server has been deployed, the following links explain how to connect to a Linux VM:

 

 

Once connected and logged in, the following section explains how to start using ReactJS and create your first app.

Confirm ReactJS, Nodejs and NPM Versions

Once logged in you can confirm the versions ReactJS, NodeJS and NPM with the following commands:

				
					create-react-app --version
				
			
				
					node -v 
				
			
				
					npm -v
				
			

Create React.JS App

The first step is to create your ReactJS app with the following command. In my example i will create an app called InfraSOS:

				
					create-react-app infrasos
				
			

You will receive similar output to the following. Make a note of the React app installation folder as you will need this later. In my example its installed in /home/azureadmin/infrasos.

As you can see, there are commands to start the React.js server, but we will use another method in the next step.

Setup ReactJS Service

Creating a systemd service file will help you to easily manage your React.js application with the following commands. Let’s first create the service file:

				
					sudo touch /lib/systemd/system/reactjs.service
				
			

Next, open the file with the following command:

				
					sudo nano /lib/systemd/system/reactjs.service

				
			

Paste the following code in, making sure to add your app and working directory name as we created earlier “infrasos“:

				
					[Service]
Type=simple
User=root
Restart=on-failure
WorkingDirectory=/home/azureadmin/infrasos
ExecStart=npm start -- --port=3000
				
			

Save and exit the file. Then reload the daemon:

				
					sudo systemctl daemon-reload
				
			

Now you can start and enable ReactJS service:

				
					sudo systemctl start reactjs && sudo systemctl enable reactjs
				
			

Confirm ReactJS Service is running with the following command:

				
					sudo systemctl status reactjs
				
			

You can now access React.JS on the following URL and Port:

 

http://YourIPAddress:3000

React.js Firewall Ports

Reactjs runs on the following port:

 

  • TCP 3000

 

The links below explain how to modify / create firewall rules depending on which cloud platform you are using.

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Documentation / Support

Documentation on using Reactjs can be found on: https://react.dev/

Disclaimer: ReactJS® is a trademark owned by Meta Platforms, Inc. and is licensed under MIT License. The license comes with a “no warranty” clause, meaning the software is provided “as-is” without any guarantees or liability for issues that may arise.

Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x