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

Digital CEO
Digital CEO
37.3 هزار بار بازدید - 2 سال پیش - In this video you'll learn
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: discord

NGINX config file Gist: https://gist.github.com/oelbaga/50196...

Terminal Commands: (I also placed all the terminal commands I ran in a Gist as well)
https://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
2 سال پیش در تاریخ 1401/04/12 منتشر شده است.
37,398 بـار بازدید شده
... بیشتر