World Talking
Search

How to upload a Next.js project on a server

Today you will learn how to make your Next.js website live on a server. I will teach you step by step.

First of all, you need to run a command in your Next.js project: delete the old .next directory and run npm run build

Next Step : ->

  1. After that, the newly created .next directory needs to be converted into a zip file.

  2. After that, you need to copy the server's SSH, open the command prompt, and connect to the server.

Now you need to install npm, Node.js, and PM2 on it. The commands are like this:

Commands : -->

1 . Update your VPS :

  1. sudo apt update

  2. sudo apt upgrade -y

2 . Install Node.js and npm

  1. # Install NodeSource PPA

    curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

  2. # Install Node.js (includes npm)

    sudo apt install -y nodejs

Check installation:

  1. node -v

  2. npm -v

Install PM2 (Process Manager for Node apps)

  1. sudo npm install -g pm2

Check PM2 version:

  1. pm2 -v

After all this, you need to go to your main directory and create a file there.

package.json

And in this file, copy and paste your project's package.json, but make sure to leave out the devDependencies

And now, go back to the CMD and run the npm install command

Notes : Now, in your VPS server's project directory, a node_modules folder will be created.

Now, in the same directory, you need to upload your Next.js build zip file.

And after extracting it, you need to move the .next folder outside into the main project directory.

  • And after that, you need to start the project with pm2 start npm -- start

  • Congratulations, now your website is live. Point your domain and you can check your website.

YR4 asteroid धरती से टकरा सकता

धरती की आसमान दिन में भी पूरी काली हो सकती है इस YR4 एस्ट्रॉइड के चलते।

YR4 asteroid धरती से टकरा सकता

बेबीलोन का सबसे अमीर आदमी (The Richest Man in Babylon)

प्राचीन लोगों की सफलता के रहस्य धन पर लिखी गई पुस्तक यह पुस्तक प्राचीन बाबेल (Babylon) की कहानियों के माध्यम से धन-संपत्ति, सफलता और वित्तीय प्रबंधन के रहस्यों को सरल भाषा में समझाती है। इसमें बताया गया है कि कैसे बचत, निवेश, अनुशासन और समझदारी से कोई भी इंसान अमीर बन सकता है।

बेबीलोन का सबसे अमीर आदमी (The Richest Man in Babylon)

Unable to load script from assets index.android.bundle

Sometimes when we open a React Native app, this issue appears: "Unable to load script from assets 'index.android.bundle'". I faced this issue when I installed a new React Native project to replace my old complete project. Without making any changes, I copied the entire content of the old project's AndroidManifest.xml file and pasted it into the new project's Androidmanifest.xml file.

 Unable to load script from assets index.android.bundle

What does “App must support 16 KB memory page sizes” mean?

What does “App must support 16 KB memory page sizes” mean? Modern Android devices (especially those with ARM-based CPUs) may use 16 KB memory pages instead of the older 4 KB pages.

What does “App must support 16 KB memory page sizes” mean?

मखाना खाने के फायदे मखाने खाने से होने वाले फायदे

मखाने खाने से होने वाले फायदे मखाना, जिसे फॉक्स नट्स या कमल के बीज भी कहते हैं, सेहत के लिए बेहद फायदेमंद होता है। इसे रोज़ाना खाने से कई स्वास्थ्य लाभ मिलते हैं।

मखाना खाने के फायदे मखाने खाने से होने वाले फायदे

लोन कैसे लें बिना CIBIL स्कोर के

तो आज हम बात करेंगे बिना CIBIL स्कोर के लोन कैसे लें या अच्छा CIBIL स्कोर कैसे बनाएँ

लोन कैसे लें बिना CIBIL स्कोर के

PAN कार्ड कैसे बनवाएं

PAN (Permanent Account Number) एक स्थायी खाता संख्या है जो भारत में वित्तीय लेन-देन और टैक्स संबंधी कामों के लिए जरूरी होती है। PAN कार्ड आप ऑनलाइन या ऑफलाइन दोनों तरीके से बनवा सकते हैं।

PAN कार्ड कैसे बनवाएं

Maruti Swift EV लॉन्च हो गया है

अभी तक कोई आधिकारिक खबर नहीं मिली है कि Maruti Swift EV लॉन्च हो गया है या उसमें पूरी स्पेसिफिकेशन क्या होंगे। लेकिन कुछ अनुमान और रिपोर्ट्स हैं जो बता रही हैं कि Maruti Suzuki आने वाले समय में EV मॉडल्स ला रही है, जैसे कि eVX / e Vitara।

Maruti Swift EV लॉन्च हो गया है

samsung z-fold 7

"To aaj hum baat karne wale hain ek aise phone ki, jo duniya ke slimmest phones me count hota hai. Aur believe me guys, phone sirf dekhne me hi classy nahi lagta, balki haath me lene ke baad ek alag hi premium feel deta hai… bas puchho mat! or phone ka name hai Samsung ka Z-Fold series ka 7..

samsung z-fold 7

kissht ऐप से लोन कैसे लें बिना किसी इनकम प्रूफ के

बिलकुल — मैं सीधे और आसान हिंदी में बता देता हूँ कि Kissht (Kissht app) से लोन कैसे लेना है, कौन-कौन से documents चाहिए, eligibility क्या होती है, और किन चीज़ों का ध्यान रखना है।

kissht ऐप से लोन कैसे लें बिना किसी इनकम प्रूफ के
Category
View All