New Version Update
Follow these steps to update to a new version of the web app. Choose deployment based on whether your site is configured with SEO or without SEO.
-
Extract the ZIP File: Extract the ZIP file containing the web code that you received from Codecanyon.
-
Open the Code in VS Code: Open the extracted web code in Visual Studio Code (VS Code).
-
Edit the
.env.localFile: Copy.env.exampleto.env.local(if you haven't already) and setNEXT_PUBLIC_API_URLto your admin API URL. See Website Setup Locally for the full list of variables and where each one comes from. -
Configure Firebase: Open the Firebase Console. Follow the steps outlined in the Firebase Setup documentation. Add the Firebase details to the
.env.localfile of your web project. -
Install Dependencies: Run the following command to install the necessary dependencies:
npm install -
Choose your deployment option:
Option A: Without SEO (static export)
-
Make sure
.env.localdoes not setNEXT_PUBLIC_SEO=true(unset, orfalse), then build the project locally (generates theoutfolder —next.config.tsswitches to static export automatically when SEO is off):npm run build -
Upload the contents of the
outfolder to your domain's public directory (e.g.,public_html). The.htaccessfor this mode is generated automatically as part of the build — no manual step needed.
Option B: With SEO (build on server)
-
Upload your updated source code to the server.
-
On your VPS, install dependencies and build on the server with
NEXT_PUBLIC_SEO=trueset (in.env.localor your shell) — this keeps SEO/standalone behavior intact:export NEXT_PUBLIC_SEO="true"
npm run build -
If you're already using PM2, you do not need to create a new PM2 app. Simply restart the existing PM2 process after the build so the update takes effect:
pm2 restart <your-existing-process-name> -
Or restart by process ID:
-
List processes and note the ID:
pm2 ls -
Restart using the ID (example uses ID 0):
pm2 restart 0
-
-
-
Need more details?
- For the full SEO (VPS) deployment flow, see: Next.js Deployment
- For static hosting without SEO, see: Deployment Without SEO