[Step by Step] Deploy NextJS on Ubuntu Digital Ocean (2 NextJS Apps on one server)

  Рет қаралды 35,431

Digital CEO

Digital CEO

Күн бұрын

In this video you'll learn how to host a NextJS app on an Ubuntu server from scratch. We'll use Digital Ocean, not the digital ocean apps platform. You don't only have to host NextJS on Vercel or Netlify! This is a wonderful option because with your own server you can host multiple NextJS apps on the same server. You can even host a MySQL database and even another backend service on the same server. While Vercel is a great option for NextJS because they created it, keep in mind Vercel is a hosting company where you can host not only NextJS but many other technologies. NextJS itself is open source and only needs a server running Node JS. You can copy the full syntax from the video from the Gists below:
CONNECT ON MY DISCORD:
/ discord
NGINX config file Gist: gist.github.com/oelbaga/50196...
Terminal Commands: (I also placed all the terminal commands I ran in a Gist as well)
gist.github.com/oelbaga/50196...
Here is a rundown of all the steps:
Step 1: Setup and Install packages on server: NGINX, NPM, NodeJS, PM2
Step 2: Setup NextJS boiler plate
Step 3: Create NGINX Config file.
Step 4: Launch app on server
0:00 Intro
1:05 Demo: 2 NextJs apps running on Ubuntu
1:40 Create Ubuntu Droplet
2:30 Point domain names to Server
3:10 Connect to Server
3:48 Update Server with latest Packages
4:00 Check A record propagation
4:30 Install Nginx & Certbot
4:50 Allow Firewall
5:30 Install NPM
5:45 Install PM2
6:30 Install NVM & NodeJS
7:10 Make NextJS Boiler Plate App on Server
8:20 Make NGINX config file
11:34 Launch Site with PM2
12:00 Add SSL to domain name
12:30 Done: Final Next JS App working
13:15 ---- Second NextJS app ----
14:30 Make second NGINX config file with new ports
15:45 Update Next JS port on second site.
17:00 Two NextJS apps demo
#nextjs #ubuntu #digitalocean #vercel #react

Пікірлер: 161
@ThysRoes
@ThysRoes Жыл бұрын
One tip! Please refrain from saying that things are 'just basic'. Anyone trying to get started with next js is already on a steep learning curve. Nothing is basic!
@alvinolavarrieta
@alvinolavarrieta Жыл бұрын
This has to be the best straightforward guide I have ever seen! Thanks.
@olegvegan
@olegvegan Жыл бұрын
What a clean guide. Thank you, dude
@Cainitech
@Cainitech Жыл бұрын
This video might be the most exact match for what I need, and the ultimate step-by-step tutorial. Thank you very much for the time you invested and congrats: you now have a new fan
@toshitsingh7270
@toshitsingh7270 Жыл бұрын
Exactly what I was looking for!! Appreciate the hard work
@coininstant6908
@coininstant6908 4 ай бұрын
Best NGINX NEXTJS HTTPS video ever, exctly as advertised, everything you need, works like a charm indeed! Thanks for taking the time to share.
@matthewbell5282
@matthewbell5282 Жыл бұрын
Really awesome tutorial. Concise and to the point! Thank you - I’ll be using digital ocean to do this!
@abdu1wahid105
@abdu1wahid105 10 ай бұрын
I just did! Great stuff Omar, I'm loving ubuntu now, thankyou!
@Dysfunctional704
@Dysfunctional704 6 ай бұрын
Thanks, you've helped me a lot with my internship! Very useful since most KZfaqrs would just opt for Vercel or Netlify when deploying.
@kwadoskii
@kwadoskii Жыл бұрын
Just stumbled upon your channel and I am loving it. Great contents
@JonBrookes
@JonBrookes Жыл бұрын
Many thanks for taking the time to post this content. It is really good to see this kind of material on 'hosting your own' - its not ( that ) difficult to do this sort of thing and particularly when deploying a few things together like node, nginx, nextjs and friends and you are so right, we are cheap scates, we have to be - hosting services like vercel, railway, heroku etc, even firebase all have their place and use cases but when doing this for everything, costs add up. So why not save yourself a bumch of money for small ventures or try outs and employ a small droplet in Digital Ocean or a Linode VM. Even AWS and Azure have small, budget VMS. Theres hetzner, which can be even less. There are loads of options out there. With your video on this and the skills there in, there are many, many options 🙂 thanks again
@henokurufa6171
@henokurufa6171 Жыл бұрын
No words to how much I am grateful for your video. keep up the great work
@NasorullahKhan-lx2eo
@NasorullahKhan-lx2eo 10 ай бұрын
Instead of going over all the topics and telling what is what and overwhelming the viewers, you gave simple examples without telling the complexity. Thanks for making it happen.
@manno9149
@manno9149 5 ай бұрын
This is really an amazing video. It was very to the point so simply following along was all that was necessary to get the desired result. Also it was really great that you included all the commands you ran in this video on github. I could simply copy and paste them all. Keep up the good work!
@sentinel_bear
@sentinel_bear Жыл бұрын
Perfect course. You helped me so much, thank you.
@abdullahilgaz
@abdullahilgaz Жыл бұрын
Great course! Thank you for your help. Also thank you for your fun :)
@DonchenkoNadia
@DonchenkoNadia Жыл бұрын
Hey!!!!! Thank you so much for your work! It really was much easier to get then from digital ocean instruction. Thank you so much! So happy to see my App working :)
@rizwanssyed
@rizwanssyed Жыл бұрын
Thanks for this awesome video showing the simple process to start. You earned a subscriber here. 👍
@gustavonardino4919
@gustavonardino4919 9 ай бұрын
Hello from Brasil! I have to say, thanks a lot! This simple and fun vídeo teached me exactly what i needed. Seems like you read my mind hahaha 🥰🙏
@cempakajanuari5983
@cempakajanuari5983 Жыл бұрын
Wow... this is what I am looking for. You are great my bro... thanks and thanks a lot.
@doepaflex
@doepaflex Жыл бұрын
That is exactly what I was looking for! Thank you so much ... Appreciate it! Keep up the good work!
@thedigitalceo
@thedigitalceo Жыл бұрын
Took me a while to get the perfect steps down. Enjoy!
@doepaflex
@doepaflex Жыл бұрын
@@thedigitalceo Can you maybe show how to to the same with differnet urls - and not subdomains :) That would be awesome
@doepaflex
@doepaflex Жыл бұрын
sry mb ... i just figured it out :D Its the same process ... thx a lot :)
@thedigitalceo
@thedigitalceo Жыл бұрын
@@doepaflex yes exactly! It’s the same process. I used a subdomain because I didn’t have another domain to use and wanted to demo. But it’s the same. 😊
@okerik8099
@okerik8099 Ай бұрын
Thank you Omar, it works!
@user-es2on6th2g
@user-es2on6th2g 7 ай бұрын
You helped me so much! Very grateful
@sandeshjadhav2188
@sandeshjadhav2188 Жыл бұрын
This is really awesome tutorial, thank you so much sir for this tutorial.
@nicolas_vl
@nicolas_vl Жыл бұрын
This is GOLD! Thanks man!
@JacobPrice-uj9si
@JacobPrice-uj9si 11 ай бұрын
Great video! Thank you very much for the help.
@FarhanAhmed1360
@FarhanAhmed1360 Жыл бұрын
Great Tutorial man. Gold Bless you
@razorjhon2622
@razorjhon2622 Жыл бұрын
Best video made for nextjs , if i can like this video thousands of time i will
@noeliaferrer72
@noeliaferrer72 Жыл бұрын
Thanks so much for this video, I really enjoy it and help me a lot!!
@brightglitch958
@brightglitch958 Жыл бұрын
Excelent tutorial! Thank you
@user-yu5ev9gm3f
@user-yu5ev9gm3f 3 ай бұрын
Well explained! exactly wha I need.
@free_audiobooks
@free_audiobooks Жыл бұрын
I subscribed because of your next js deploy video . please upload more , some of us really struggles to deploy
@thedigitalceo
@thedigitalceo Жыл бұрын
Deployment is tough! I suppose it’s one of the reasons places like Vercel and Netlify are really winning. Which I love but we do need options.
@free_audiobooks
@free_audiobooks Жыл бұрын
@@thedigitalceo Great part is that you simplified it for upcoming developers
@kokleekio7124
@kokleekio7124 Жыл бұрын
Amazing video!
@stevemitto9942
@stevemitto9942 8 ай бұрын
Awesome content... Right to the point
@icyrealm7
@icyrealm7 9 ай бұрын
Amazing tutorial!
@umarchy
@umarchy Жыл бұрын
Excellent video
@saziknows3614
@saziknows3614 Жыл бұрын
Quality content at its finest
@thedigitalceo
@thedigitalceo Жыл бұрын
Wow. Thank you.
@abduljavad788
@abduljavad788 8 ай бұрын
This video is the only thing we need to deploy something something on vps 🔥
@tim.bogdanov
@tim.bogdanov 11 ай бұрын
helpful, thank you
@user-dp6di4kd4k
@user-dp6di4kd4k Жыл бұрын
You are rock! Thank's
@evaltools
@evaltools Жыл бұрын
I like it. Thanks.
@rhmtin
@rhmtin Жыл бұрын
This is what I'm looking for! btw, could you please continue this tutorial by auto deploying GitHub?
@AndrewSWE
@AndrewSWE 2 ай бұрын
AMAZING video! Thank you so much! For me I had to run npm run build and only after that pm2 start ... works well. before npm run build the pm2 has throwing an error that BUILD_ID directory is not found
@miteshkalal4396
@miteshkalal4396 4 ай бұрын
nice one
@mohdsajidshaikh4291
@mohdsajidshaikh4291 9 ай бұрын
Thanks a lot
@jefrycayo4582
@jefrycayo4582 5 ай бұрын
thanks a million sr
@narek1771
@narek1771 11 ай бұрын
thank you bro
@clipartinc
@clipartinc Жыл бұрын
✅ Thank you!
@3IMAD69
@3IMAD69 Жыл бұрын
thank you , i followed everything and its working fine , can you make a video about how to link github actions to make auto deploy avalaible ?
@user-yd8hq6bw8d
@user-yd8hq6bw8d 6 ай бұрын
U r a god
@ThysRoes
@ThysRoes Жыл бұрын
Thanks for the different approach. All the help files out there are the same, and none are suitable for my situation. I want to be 100pct independent from any monthly service except the server hosting.
@AmitErandole
@AmitErandole Жыл бұрын
Hey this is cool ❤️ Can you expand on this and show us how to add postgresql and redis to this same setup and then wire up whole thing up? Also this covers just installation. Knowing to write a simple deploy script that pulls from main branch on git push would be great 👍
@thedigitalceo
@thedigitalceo Жыл бұрын
Thank you! I didn’t want to make the video too long but I can definitely expand more. You can add continuous deployment integration between Git and an Ubuntu server. And you can add a database system to Ubuntu as well. I use MySQL but I’m certain same principles apply. I’ll consider all this on upcoming videos.
@clipartinc
@clipartinc Жыл бұрын
@@thedigitalceo Yes, please do some connecting to mySQL databases! Everyone has forgotten about mySQL, but it's so powerful and free!
@maxjustmax521
@maxjustmax521 8 ай бұрын
that sound you did is not ASMR it made me almost wanna puke ... thank you for the best video on youtube explaining exactly what I needed
@gabrielmoraes4516
@gabrielmoraes4516 Жыл бұрын
Awesome video! Thanks for sharing it! If you're using next + wordpress as a headless cms, would the same steps apply? I want to set up my own vps but had a bit of trouble following the instructions.
@thedigitalceo
@thedigitalceo Жыл бұрын
Yeah because you can even host a Wordpress site on the same Ubuntu server! Setting up a Wordpress site on this server isn’t covered in this video though.
@gabrielmoraes4516
@gabrielmoraes4516 Жыл бұрын
@@thedigitalceo Cool! Going to follow the same process to set up mine then. Have you used Hostinger before? I wanted to use digital ocean, but their options/services are a bit intimidating for someone with limited backend knowledge like myself.
@boi46
@boi46 Жыл бұрын
This tutorial is great, but don't ignore the sites-enabled file, use symlink instead. Otherwise, Certbot won't be able to redirect users from HTTP to HTTPS.
@samsHandle
@samsHandle Жыл бұрын
Awesome video - keeping it succinct but with enough explanation! I'm having an issue where the Next app loads, but without the CSS. I followed all steps to the dot so not sure what the issue could be. Would you have any pointers please?
@samsHandle
@samsHandle Жыл бұрын
My bad. In the sites-available config I listed the domain name instead of the next project folder name. It works as expected now. Thanks again!
@thedigitalceo
@thedigitalceo Жыл бұрын
I believe I’ve seen that before. That’s tricky because I don’t recall where the issue was. I would try to delete the directory and re-clone. Double check the path in nginx config file. Worst case I would destroy the droplet and try it over. I’ve done that several times when I couldn’t retrace where I went wrong. My discord link is link now up to date also if you want to join there as well
@thedigitalceo
@thedigitalceo Жыл бұрын
@@samsHandle ah I see you just replied and found the issue. Ok great!
@RohanGupta-tc5uz
@RohanGupta-tc5uz Жыл бұрын
Thank you for this excellent video course; the video's quality and instructions were outstanding. I'm having a slight issue; I am getting a 502 Bad Gateway Error with nginx/1.22.0 (Ubuntu). If you could guide me in the right direction, that would be amazing. Thank You
@sannjayy
@sannjayy Жыл бұрын
You need to run - npm run build / on your project directory.
@anowarulhassan5117
@anowarulhassan5117 9 ай бұрын
Hey bro can u make a video on how can i can setup email server at the same vps where you deployed these two demo project?
@kubilaybzk
@kubilaybzk Жыл бұрын
Could you please continue this tutorial by auto deploying GitHub with docker?
@salmaindrianputri164
@salmaindrianputri164 11 ай бұрын
WordPress as headless cms plus next js in one vps. Is it possible. Please make video about this. I love youuuu
@fedeabj
@fedeabj Жыл бұрын
Hi! I have a question. I've been working with react and nextjs for the past year, and I wanted to start deploying some of my projects. I do understand that when building the project you serve static files and that fetch functions are, out of the box, not available. Am I right? Will this method of deploying fix that, and allow me to keep my useEffects and stuff that perfom api/fetch requests? Is this something like running "npm run dev" that lets me those requests? Im a 100% noob at hosting and deploying. Thanks
@numananees4464
@numananees4464 Жыл бұрын
If anyone facing issue of .includes undefined try running npm start -p 3000
@palle1765
@palle1765 Жыл бұрын
Very good explaination! Thank you! When i follow your tutorial the starter script run fine. but when I tried to installed a nextjs from a third party but i get a bad gateway. I contacted the guy which made the app he said i should set serversideprops. How does that work?
@thedigitalceo
@thedigitalceo Жыл бұрын
Awesome. Thank you. GetServerSideProps wouldn’t have any affect on this tutorial. But you can look into that feature right on nextjs online docs. Fyi getServerSideProps is actually going to be deprecated eventually though for fetch in the next 13 app directory when it becomes stable
@cardinaldreampark7341
@cardinaldreampark7341 Жыл бұрын
Please which hosting server supports both next js and Django together because my website comprises of both
@amansagar4948
@amansagar4948 4 ай бұрын
I’m confused. Can we do all this stuff with docker as well? If yes then why this all needed ?
@Its-InderjeetSinghGill
@Its-InderjeetSinghGill 5 ай бұрын
I have an old computer can we do the same there? I installed ubuntu server and i need some help with it.
@MrAlao675
@MrAlao675 Жыл бұрын
Thank you for this beautiful tutorial. Meanwhile, I followed all steps, the default NGINX page displayed, but the moment I deleted the default, I started getting "Bad Gateway" error. Any idea what could have caused this? Thank you.
@MrAlao675
@MrAlao675 Жыл бұрын
I terminated the AWS instance and launched a new one. Everything seems fine now. Thank you.
@Moanv
@Moanv 6 ай бұрын
Hi, I really enjoyed the video, however your video only shows, running a nextjs project on ubuntu when you clone the source code files from git and run the project on the server. my project build files are getting dropped through the Azure Devops release agent as I do not intend to keep the source code files on the server. Please let me know how to deploy I am stuck, your method works when I get the source code files. this is for anyone in the comments too.
@striderhere
@striderhere 11 ай бұрын
If I already have cyberpanel installed on my VPS, is it possible to host a nextjs website on the same Ubuntu?
@vidhanshuborade5977
@vidhanshuborade5977 Жыл бұрын
Exactly what i was looking for!! Thank you so much man but one doubt My next.js project contains some environment variables and i tried adding .env.local file and then rebuilding and restarting the nginx server but it isn't working can you please suggest me the solution updated:: I did worked i just forget to restart the pm2
@thedigitalceo
@thedigitalceo Жыл бұрын
Yes exactly. In this tutorial pm2 is really the service that starts the node apps
@ilirbajrami2902
@ilirbajrami2902 Жыл бұрын
I don't see the changes even thought i run `npm run build`. I'm makeing the changes from ftp client. Any help on this?
@Grolliiitjk
@Grolliiitjk 11 ай бұрын
how get that terminal to write everything? can you show us?
@leoemrys5751
@leoemrys5751 Жыл бұрын
Sir How do you setup pm2 configuration file in nextjs package.json?
@JCCreatorStudio
@JCCreatorStudio Жыл бұрын
after first time deployment, and i have updated the application, how to deploy the update?
@mohdsajidshaikh4291
@mohdsajidshaikh4291 9 ай бұрын
Did it restart nextjs after system restart. Also api routes also working 😊
@adnanaslam9604
@adnanaslam9604 Жыл бұрын
how to setup all these in current project directory without creating new project?
@borntodestroy6892
@borntodestroy6892 Жыл бұрын
Hello Thank you very much for this tutorial. Is it necessary to enable ssl to deploy nextjs? I have done all the steps but I have a 403 error when accessing the files in the _next/static path. Is there a way to fix this?
@thedigitalceo
@thedigitalceo Жыл бұрын
Yes you need to do the SSL step
@excalibur2417
@excalibur2417 Жыл бұрын
Api routes, dynamic routes and server-sided features from nextjs will still work once I deploy it the way you showed in the video?
@thedigitalceo
@thedigitalceo Жыл бұрын
They should
@excalibur2417
@excalibur2417 Жыл бұрын
@@thedigitalceo Awesome, great tutorial. Love that you also made a gist for this, thank you so much
@marcusshane6880
@marcusshane6880 Жыл бұрын
Hey, this is amazing and thank you for posting this video. Likewise, I would love to get little help from you, Everything was going well and I cloned my GitHub repo with a next js project into the var/www directory, installed npm and the project was online with pm2 as well. followed you thoroughly for every process and SSL was also active however, in the end, I get a 502 Bad Gateway Nginx/1.18.0 (Ubuntu) error. What might be missing?
@thedigitalceo
@thedigitalceo Жыл бұрын
Thank you. That’s hard to debug because the error is so generic but I believe it must be related somewhere in the nginx file. Somehow it’s not pointing to the right directory where the NextJS site lives on the site. Also make sure you removed the default nginx files. Also make sure you didn’t miss the step where I changed nginx code config to only use the sites-available folder and ignored sites-enabled
@ranuvijay1
@ranuvijay1 Жыл бұрын
502 may also arise if your upstream server is not running. May be nginx was trying connect localhost:3000 but nothing was running there on port 3000
@techspace_solutions
@techspace_solutions Жыл бұрын
Hi Marcus, I am having this same issue with bad gateway 502, how did you solve it?
@rekhilaliaspaulose9171
@rekhilaliaspaulose9171 Жыл бұрын
i got this same error because i forgot to install my next.js packages make sure to install npm packages then run ( npm i to install ) npm run build if your're terminal get killed follow this setup and run again 1, sudo fallocate -l 1G /swapfile 2, sudo chmod 600 /swapfile 3, sudo mkswap /swapfile 4, sudo swapon /swapfile 5, sudo swapon --show 6, sudo cp /etc/fstab /etc/fstab.bak 7, echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab 8, sudo sysctl vm.swappiness=10 9, echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf 10, sudo sysctl vm.vfs_cache_pressure=50 11, echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf then npm i and npm run build ( make sure crct path var/www/your domain or app folder name
@tim.bogdanov
@tim.bogdanov 11 ай бұрын
my CPU usages jumps to 100% when I run pm2, and get a 502 gateway, any ideas why?
@baruchmanigrasso5493
@baruchmanigrasso5493 Жыл бұрын
There is one thing that is not clear to me about Next.js, if I do follow your tutorial and just upload a Next.js App to a server from scratch, will the APIs in my application be "Serverless" like in Vercel deployments? I expect not, but I am not sure about this. By the way, THANK YOU for this tutorial, it's very useful!
@thedigitalceo
@thedigitalceo Жыл бұрын
NextJS wouldn’t be described as serverless regardless of where it’s hosted since it’s just a software framework. It’s where you host itself that would be described as serverless. So Vercel hosting would be serverless since they serve as a middle network between you and the server if I’m not mistaken. And you’re welcome! I’m glad you enjoyed it
@baruchmanigrasso5493
@baruchmanigrasso5493 Жыл бұрын
@@thedigitalceo Oh, Thank you so much for this clarification, now the concept is clearer! 🙂 You got a new subscriber! Have a good day!
@landotamayo3149
@landotamayo3149 6 ай бұрын
anyone having problems with their site tagged as not secure in apple devices? it appears that way when i use my ipad or macbook pro... everywhere else it's secure...
@beterworld
@beterworld Жыл бұрын
what about git? is there any of your tutrial about it? so we can easily edit the codes from local pc, than we do pul on the server some kind like that.
@thedigitalceo
@thedigitalceo Жыл бұрын
I don’t have a tutorial on that. Perhaps I will do one in the future
@sergsergesrgergseg
@sergsergesrgergseg Жыл бұрын
you can use something called jenkins
@alexkey9372
@alexkey9372 Жыл бұрын
Excellent tutorial! i just have one question. I have a headless woocommerce project in nextjs. the woo site is hosted in siteground but the front-end in vercel. Is it worth switching to digital ocean? I'm afraid of hidden costs using vercel. The site i have has over 20,000+ products and is quite big generally.
@thedigitalceo
@thedigitalceo Жыл бұрын
What plans and costs are you using on site ground and vercel?
@alexkey9372
@alexkey9372 Жыл бұрын
​@@thedigitalceo on siteground very expensive cloud hosting like $160/mo (200GB SSD, 11GB RAM, 5 core CPU)+ cloudflare plus $11.95 . that's because the site is like 60GB overall with db and traditional woocommerce. i'm doing it headless now (still in test mode) so im thinking what would be best. vercel has quite a lot of limitations in image optimizations etc. on vercel im still on free plan but im considering either to upgrade there or move to DO. what's best in your opinion?
@thedigitalceo
@thedigitalceo Жыл бұрын
@@alexkey9372 got you but what is your main concern right now in general. Is it cost? Is it scale? Etc. this way you’ll know which route to take
@alexkey9372
@alexkey9372 Жыл бұрын
@@thedigitalceo both. already paying high fees for backend, so i wouldn't want to use very expensive platform for front-end and definitely scalability is a concern. The current traditional woo site is having 70-80k users daily on average. It will scale for sure because there's high traffic expectation. So i want to still use vercel goodies like image optimizations etc but not pay them $9 per 1000 images. the site has 20,000+products. I'm a little bit stuck tbh. initially i thought vercel would do it but i see there's a lot of hidden costs. and last concern, vercel does lots of things by default, hopefully DO won't be problematic
@thedigitalceo
@thedigitalceo Жыл бұрын
@@alexkey9372 but right now it’s already hosted on vercel hobby? And it’s not breaking? And when you say woo site you mean the backend API, the headless content? What language and database is the backend using. Is it using the headless Wordpress content you mean? (So it’s not directly accessible but just the json is) And that is $160 a month?
@gulabpatel7477
@gulabpatel7477 Жыл бұрын
Is there any specific task we have to perform if we launch multiple site to one server and want to connect MySQL database. Because my database connection is not working some how Getting error connect ECONNREFUSED::1:3306 what could be wrong?
@thedigitalceo
@thedigitalceo Жыл бұрын
Connecting to a database is not really in the scope of this tutorial. A lot can be the issue connecting to a server on a digital ocean droplet. Make sure to follow a strict tutorial on setting up and connecting to a MySQL database on a droplet. Also what you can do to check is use MySQL workbench to test your connection and db first to be sure you have the right connection setting s
@minheinhtet9800
@minheinhtet9800 7 ай бұрын
how to update nextjs to existing
@ArturComunello
@ArturComunello 6 күн бұрын
I'm trying to reproduce this in 2024, but i cant install or build the next app in the droplet due to a low memory, how can I fix this?
@ArturComunello
@ArturComunello 6 күн бұрын
It was just thi. export NODE_OPTIONS=--max_old_space_size=1024
@qckq
@qckq Жыл бұрын
i am using cloudflare domain not working
@StringSwoosh
@StringSwoosh Жыл бұрын
how to do it from existing open source repo's? Just git pull from the repo?
@thedigitalceo
@thedigitalceo Жыл бұрын
Same idea but instead of setting up a new next js app, git clone your app right in terminal in the same spot. But remember you need to grant the repo permissions so create an ssh key on the droplet and the add that public key to the deploy keys settings for the repo on github
@StringSwoosh
@StringSwoosh Жыл бұрын
@@thedigitalceo got it! Great video btw! I’m wondering if its also possible to create a github actions runner that rebuilds on pushes to main. Maybe a video idea for the future?
@alsherifkhalaf7385
@alsherifkhalaf7385 Жыл бұрын
Very good tutorial but is this secure ?
@remapple5368
@remapple5368 4 ай бұрын
why is the subdomain not secure
@m.hammadhassan
@m.hammadhassan Жыл бұрын
How can we backup & Restore Nextjs Website from Ubuntu Server?
@thedigitalceo
@thedigitalceo Жыл бұрын
What happened to your server. If you enabled backups on your digital ocean droplet. You can make a new droplet from one of the backups
@greenpvpservers4847
@greenpvpservers4847 Жыл бұрын
I have a 502 Bad Gateway :(
@born2die827
@born2die827 19 сағат бұрын
why don't you tell us where we have to move the .next folder? Who tf creates a project on the production Server???
@ginthozan
@ginthozan Жыл бұрын
Hi, can you share me the NGINX config file Gist for Reactjs application?
@thedigitalceo
@thedigitalceo Жыл бұрын
The config file and commands I used are in gists in the description
@ginthozan
@ginthozan Жыл бұрын
@@thedigitalceo yes it works with NextJs but with pure ReactJs getting bad gateway error
@thedigitalceo
@thedigitalceo Жыл бұрын
@@ginthozan ah that one I’m not sure because this tutorial is definitely more Next related.
@ginthozan
@ginthozan Жыл бұрын
@@thedigitalceo OK thanks, I will try to find a solution
@sahnounmohamed5871
@sahnounmohamed5871 Жыл бұрын
but how can we set environment variables ?
@thedigitalceo
@thedigitalceo Жыл бұрын
You would just create the file in the terminal after logging into the server with terminal bash commands. Cd into the route “nano .env.local” creates the file puts you in edit mode and then type out the variables and save the file with ctrl o.
@sahnounmohamed5871
@sahnounmohamed5871 Жыл бұрын
i did , but it doesn't work , i don't know if it's about the .env this time , i think digitalocean doesn't support serverless functions such as getServerSideprops and getInitialprops ?
@thedigitalceo
@thedigitalceo Жыл бұрын
@@sahnounmohamed5871 it should support those. Test everything locally piece by piece to make sure you know where the real problem actually is. FYI you may need to restart pm2 or server if adding new environment variables
@vernevens1598
@vernevens1598 2 ай бұрын
I'm so cheap I have to carry a can of 3 in one oil to keep my ass from squeaking when I walk. So how about showing us how to do this with a REAL server? Ubuntu on a server and my laptop.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Is Next is the only thing you know?
@thedigitalceo
@thedigitalceo Жыл бұрын
Coding videos on this channel are mostly about web development in react/nextjs/css and what I care about the most.
@sbdev5853
@sbdev5853 Жыл бұрын
Sorry if you have gotten my comment multiple times. It keeps getting deleted for some reason. If you can see it on your end and post a response, greatly appreciate it
@thedigitalceo
@thedigitalceo Жыл бұрын
Hi I only see this comment above. What was the question
@sbdev5853
@sbdev5853 Жыл бұрын
@@thedigitalceo Can you store a database on the server with this setup and still pay $7? Or is it an additional fee of $15 for storing your database with them?
@thedigitalceo
@thedigitalceo Жыл бұрын
@@sbdev5853 if you install the database on this same server it should all be one cost - the cost of the server only. I use MySQL which is open source. You can install MySQL on this Ubuntu server like any other database system and use that as the database for any backend service at no additional cost. But if you opt to using Digital Oceans separate “managed database” service and put the database over there and then pull from there that I believe is an additional $15 a month.
@sbdev5853
@sbdev5853 Жыл бұрын
@@thedigitalceo That's where I was confused with the managed database service. I thought the only way to add a database with Digital Ocean is to use that service. This makes sense now. Please add a video with adding a MySQL database to this setup. Thanks for the clarification.
@rekhilaliaspaulose9171
@rekhilaliaspaulose9171 Жыл бұрын
i got bad gateway 502 error because i forgot to install my next.js packages make sure to install npm packages then run ( npm i to install ) npm run build if your're terminal get killed follow this setup and run again 1, sudo fallocate -l 1G /swapfile 2, sudo chmod 600 /swapfile 3, sudo mkswap /swapfile 4, sudo swapon /swapfile 5, sudo swapon --show 6, sudo cp /etc/fstab /etc/fstab.bak 7, echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab 8, sudo sysctl vm.swappiness=10 9, echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf 10, sudo sysctl vm.vfs_cache_pressure=50 11, echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf then npm i and npm run build ( make sure crct path var/www/your domain or app folder name
@tim.bogdanov
@tim.bogdanov 11 ай бұрын
im still getting a 502, i reran all the install commands, double checked everything, when I run pm2 start, my server hangs at 100% CPU usage. any ideas?
Deploy React and NodeJS on Linux
29:59
DevOps For Developers
Рет қаралды 14 М.
Зу-зу Күлпәш. Стоп. (1-бөлім)
52:33
ASTANATV Movie
Рет қаралды 1,2 МЛН
YouTube's Biggest Mistake..
00:34
Stokes Twins
Рет қаралды 76 МЛН
Setting up a Digital Ocean droplet with Docker
27:14
Did Coding
Рет қаралды 11 М.
How To Deploy A React App - Using NGINX & Linux
23:09
Tech With Tim
Рет қаралды 74 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 170 М.
My Problem with Next.js Server Actions
10:13
James Q Quick
Рет қаралды 14 М.
How To Deploy NextJS With Nginx and PM2
16:43
Full Stack Book
Рет қаралды 40 М.
How to Deploy a Node.js App to Digital Ocean (Nginx, Ubuntu)
20:03
Deploy your Next.js app to a VPS (EASY!)
15:45
ByteGrad
Рет қаралды 26 М.
Deploy NextJS Website From Scratch (with Ubuntu, NGINX and pm2)
53:19
How to Deploy a Frontend React App on Vercel in Minutes
9:37
Arpan Neupane
Рет қаралды 36 М.
Зу-зу Күлпәш. Әйел Құқығы (9 бөлім)
44:32
ASTANATV Movie
Рет қаралды 268 М.
Первая часть🔥#юмор #смешноевидео #смех
1:00