How to deploy node api with ngnix on VPS

How to deploy node api with ngnix on VPS

10.665 Lượt nghe
How to deploy node api with ngnix on VPS
Deploying a Node.js application on a VPS with Nginx is essential for making your app accessible via a domain name. Begin by installing Node.js on your server. Create a new directory for your Express app, set up your package.json, and install necessary dependencies like Express and NodeMon. Create an ‘index.js’ file to serve as the entry point for your application. Test your setup by running ‘npm run dev’ to ensure the server is operational. To keep your app running in the background, install and use PM2, a process manager that ensures your app stays live and auto-restarts if it crashes. Next, configure Nginx as a reverse proxy by editing the Nginx configuration file. Set up the proxy to forward traffic from port 443 to your Node.js application, ensuring secure and efficient traffic management. Finally, test your configuration to confirm everything is working smoothly. This comprehensive guide simplifies the deployment process, making it straightforward to get your Node.js app live on a VPS with Nginx. Tools used in this course: Terminal : https://www.warp.dev/ VPS used: Linode and Digital Ocean Docs: https://docs.chaicode.com Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. Get all source code for react application: https://github.com/hiteshchoudhary/react-english All source code is available at my Github account: https://github.com/hiteshchoudhary Our Open-Source Project is here: https://freeapi.app Join me at whatsapp: https://hitesh.ai/whatsapp for community discord: https://hitesh.ai/discord Instagram pe yaha paaye jaate h: https://www.instagram.com/hiteshchoudharyofficial/ Learn React with 10 projects: https://www.youtube.com/watch?v=eCU7FfMl5WU&list=PLRAV69dS1uWQos1M1xP6LWN6C-lZvpkmq Learn Docker: https://youtu.be/rr9cI4u1_88?si=fSK00PNOt0gqBXp6 Learn Kubernetes: https://www.youtube.com/watch?v=7XDeI5fyj3w How does a browser works: https://youtu.be/5rLFYtXHo9s?si=UW1HrwGUzkk4E7qh How nodejs works: https://youtu.be/ooBxSg1Cl1w?si=Ks6Wih1smJZSDz4V Learn Redux-toolkit: https://www.youtube.com/watch?v=pX0SBJF01EU Learn NextJS: https://www.youtube.com/watch?v=iPGXk-i-VYU&list=PLRAV69dS1uWR7KF-zV6YPYtKYEHENETyE Learn Typescript: https://www.youtube.com/watch?v=j89BvWz8Eag&list=PLRAV69dS1uWRPSfKzwZsIm-Axxq-LxqhW Learn Javascript: https://www.youtube.com/watch?v=2md4HQNRqJA&list=PLRAV69dS1uWSxUIk5o3vQY2-_VKsOpXLD Learn React Native: https://www.youtube.com/watch?v=kGtEax1WQFg&list=PLRAV69dS1uWSjBBJ-egNNOd4mdblt1P4c Learn Zustand: https://www.youtube.com/watch?v=KCr-UNsM3vA&list=PLRAV69dS1uWQMXekDgw7fRAsHmsbKWkwu Learn Golang: https://www.youtube.com/watch?v=X4q1OM0voO0&list=PLRAV69dS1uWSR89FRQGZ6q9BR2b44Tr9N