Deploy React and NodeJS on Linux

  Рет қаралды 15,098

DevOps For Developers

DevOps For Developers

Күн бұрын

Get the DevOps Roadmap for 2022 here: devopsfordevelopers.io/roadmap
In this video you will learn how to setup a Linux server to host your React + NodeJS application from scratch. This video uses Ubuntu with NVM for providing the NodeJS runtime, PM2 to kee our applications running, and Nginx as a reverse proxy to provide scalability and SSL termination.
I also share with you why I rarely use this configuration for my own apps, and what I do instead.
----------🎥 C H A P T E R S ----------
0:00 Introduction
1:52 Application overview
2:42 SSH into our Linux server
3:58 Create a user account for nodejs
6:10 Git the code for our applications
6:55 Install NodeJS
8:30 Install application dependencies
9:49 Use PM2 to keep our apps running
13:40 Start PM2 at boot time
15:20 Installing nginx
18:39 Verify our setup
22:30 Troubleshooting connectivity issues
24:30 Setting up SSL on nginx
25:50 When to use this setup
28:30 Other ways to deploy
----------👋 C O N N E C T ----------
Discord ▻ devopsfordevelopers.io/discord
Twitter ▻ / wfbutton
----------🛠 R E S O U R C E S ----------
The DevOps Career Guide ▻ devopsfordevelopers.io/devops...
DevOps Roadmap ▻ devopsfordevelopers.io/roadmap
DevOps merch ▻ devopsfordevelopers.io/merch

Пікірлер: 60
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
The DevOps Roadmap for 2022 is available for free at devopsfordevelopers.io/roadmap One of the hardest things about learning is understanding how the different components work together. Using this guide, you start with a topic that interests or relates to you. At the end of the section, other related topics are shown allowing you to pick and choose your own path to DevOps mastery. Check it out and leverage the skills you learn to advance your career as a developer, sysadmin, IT Operations, QA and more!
@dad30189
@dad30189 2 жыл бұрын
Very nice video Will! I learned quite a bit.
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
That's awesome- glad it was helpful!
@minhduc8a21
@minhduc8a21 10 ай бұрын
Oh my god! This video is amazing. Thank you so much! My problems are gone
@DevOpsForDevelopers
@DevOpsForDevelopers 10 ай бұрын
Right on, glad you found it helpful!
@aldenisaac3789
@aldenisaac3789 2 жыл бұрын
Ive been waiting for you to do an actual devops cicd project. Looking forward to it. Hope you plan on adding observability to this project.
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
Aaaaaww yeah! We're gonna have all the bells and whistles before this is done!
@himanshushukla6451
@himanshushukla6451 2 жыл бұрын
Just what I needed rn.Thanks
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
Excellent!
@codinginflow
@codinginflow 2 жыл бұрын
Damn I would've needed this a few weeks ago 😂 👌
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
lol. I should've done a shout-out for the inspiration! 🤣
@prabhmeetsingh6995
@prabhmeetsingh6995 2 жыл бұрын
This is what i needed thanks guru!!please make more type of this. Make a video on cicd for multiple ec2 servers with git github
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
lol. Glad you enjoyed. Got more like this coming down the pipeline!
@HiddeTieleman
@HiddeTieleman 2 жыл бұрын
You DESTROYED this one. Looking forward to your other deployment methods.
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
Awwww yeah! Thanks!
@hannibalbarca7915
@hannibalbarca7915 2 жыл бұрын
We are waiting ! The vid !!
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
Lol- almost there!
@MrTouqeerhameed
@MrTouqeerhameed 7 ай бұрын
Excellent and thank you
@DevOpsForDevelopers
@DevOpsForDevelopers 7 ай бұрын
You’re welcome!
@AMM0beatz
@AMM0beatz 2 жыл бұрын
DevOps in action!! 💯
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
💥
@OfficialWirusChannelBBC
@OfficialWirusChannelBBC 2 ай бұрын
Thank you so much!
@ifuncuran
@ifuncuran Жыл бұрын
helps a lot, tnx!
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
Right on!
@user-gw8iz4qf9r
@user-gw8iz4qf9r 7 ай бұрын
Does the front end react application is running on port 8080? Whether it must be the same when we run pm2 serve build 8080 --spa ?
@genosthegreat7870
@genosthegreat7870 Жыл бұрын
24:28 lol Thanksssaa
@antonevseev2708
@antonevseev2708 Жыл бұрын
Hey Will! Thanks for the awesome tutorial! Can you please share what DNS Server app you used in your video (timestamp at 22:00) for setting up the custom domain name?
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
Thanks! It's the DNS app for Synology NAS devices. I use my NAS as a local DNS server.
@antonevseev2708
@antonevseev2708 Жыл бұрын
Cheers!@@DevOpsForDevelopers
@MrFontaineInc
@MrFontaineInc 2 жыл бұрын
Do you find it easier to type out the key location versus using a config file in your daily workflow or does it depend on the day/project?
@DevOpsForDevelopers
@DevOpsForDevelopers 2 жыл бұрын
My ssh key location? I always type it out. Decades of muscle memory behind those keystrokes. 🤣
@SanthoshKumar-dev
@SanthoshKumar-dev Ай бұрын
I can only connect with same network but If I tried on different network it's not working
@fibinjohnson299
@fibinjohnson299 9 ай бұрын
can i use npm run bild in my vs code terminal and later push it into github ropo then pull to this production terminal ...because it is taking too long in ubuntu
@DevOpsForDevelopers
@DevOpsForDevelopers 9 ай бұрын
I wouldn't. The node_modules folder needs to be built on the system where the application will run. Failing to do so may result in incompatibilities with dependencies. You also want to avoid storing node_modules in your github repo: it's a huge folder that changes frequently. Rely on your package-lock.json file to pin dependency versions
@chantellebradley6959
@chantellebradley6959 Жыл бұрын
I need to know what the api start script should be for people like me who built something from scratch. I can't get mine working. Keep getting errors.
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
What is the error?
@fibinjohnson299
@fibinjohnson299 9 ай бұрын
usually how long does it takes to complete npm run build?
@DevOpsForDevelopers
@DevOpsForDevelopers 9 ай бұрын
A couple of minutes at most
@tomaszprazniewski7499
@tomaszprazniewski7499 Жыл бұрын
Any Idea how to deploy after build a few react/node apps on the same ubuntu server? probably using nginx? it could be server on different url IP/APP1 IP/app2
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
Yeah, using a different path for each using Nginx would work.
@tomaszprazniewski7499
@tomaszprazniewski7499 Жыл бұрын
@@DevOpsForDevelopers HI May You know why it doesn't work in my case? server { listen 80; listen [::]:80; root /var/www/xxx.xxx.xxx.xx; /var/www/xxx.xxx.xxx.xx i have 2 folders portfolio and portfolio2 which have build react code inside of each path Thx a lot for response
@dtdionne
@dtdionne Ай бұрын
I tried to follow along but i guess the dashboard has changed since 2022. npm run build is no longer an option.
@chantellebradley6959
@chantellebradley6959 Жыл бұрын
What pm2 command do I run for a plain node ts app when I built one from scratch?
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
pm2 start "your command here" more info can be found in the pm2 docs: pm2.keymetrics.io/docs/usage/process-management/
@chantellebradley6959
@chantellebradley6959 Жыл бұрын
@@DevOpsForDevelopers thank you :)
@7DuRd3n
@7DuRd3n Ай бұрын
I would rather do it this way. Honestly
@milesyoung5360
@milesyoung5360 Жыл бұрын
how did he install pm2 globally without sudo?
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
Use nvm and you'll never install node packages with sudo again: github.com/nvm-sh/nvm Bonus: it's super easy to switch between different versions of Node.js for different use cases!
@percyai7776
@percyai7776 Жыл бұрын
where are the videos for this deployment in diffrent ways..
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
I think these might have what you're looking for: kzbin.info/www/bejne/r4TTgH-Zj9aLo9k kzbin.info/www/bejne/qGHLo5Vofd1oicU
@genosthegreat7870
@genosthegreat7870 Жыл бұрын
18:21 what did u click here?
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
:wq to save the file and edit vim
@genosthegreat7870
@genosthegreat7870 Жыл бұрын
@@DevOpsForDevelopers before that
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
@@genosthegreat7870 I’m not sure, I don’t see where I clicked anything before that. Got any additional detail to help me pinpoint it?
@genosthegreat7870
@genosthegreat7870 Жыл бұрын
@@DevOpsForDevelopers i figured it out Ctrl c to type in :wq
@DevOpsForDevelopers
@DevOpsForDevelopers Жыл бұрын
@@genosthegreat7870 aaaah, I gotcha. Yeah, you have to exit Insert mode in vim to enter the command. Sorry, it’s muscle memory now and I don’t even realize I’m doing it. The ESC key will work as well.
How To Deploy NodeJS API (Linode)
55:56
The Full Stack Junkie
Рет қаралды 18 М.
Deploy React and NodeJS With Heroku And Cloudflare
31:05
DevOps For Developers
Рет қаралды 3,5 М.
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 41 МЛН
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 7 МЛН
Don't Do DevOps (do this instead)!
5:21
DevOps For Developers
Рет қаралды 4,9 М.
Linux Server Setup & MERN Deployment
38:41
Traversy Media
Рет қаралды 63 М.
How To Deploy A React App - Using NGINX & Linux
23:09
Tech With Tim
Рет қаралды 76 М.
Deploy NextJS Website From Scratch (with Ubuntu, NGINX and pm2)
53:19
microsoft's new AI feature is an absolute dumpster fire
9:34
Low Level Learning
Рет қаралды 62 М.
Deploy a Node.js app to Ubuntu Server
17:04
Robotic Nation
Рет қаралды 11 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 21 МЛН
#miniphone
0:16
Miniphone
Рет қаралды 918 М.
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН
как спасти усилитель?
0:35
KS Customs
Рет қаралды 531 М.
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,3 МЛН