New Version Update
Follow these steps to update to a new version of the web app.
-
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 File: Locate and open the .env file in your code editor. Fill all required details in it.
-
Configure Firebase: Add the Firebase details to the public/firebase-messaging-sw.js file of your web project.
Skip the 5th step if already made edits on server. -
Upload file to server: Make a zip of the web files and upload to your server.
Automated Deployment (Recommended)
To update the application on the VPS using the automated script:
- SSH into the server and navigate to the project directory.
- Run the deployment script:
./update.sh
If you encounter the error:
update.sh: command not found
Run the following command once to make the script executable:
chmod +x update.sh
After that, run the deployment script again:
./update.sh
Manual Deployment
-
Install Dependencies: Run the following command to install the necessary dependencies:
npm install -
Cbuild on server:
-
Upload your updated source code to the server.
-
On your VPS, install dependencies and build on the server (this keeps SEO behavior intact):
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