We do not recommend installing offline on your computer. However, we understand you may want to test or verify that the script works properly before launching it online using a cloud server.
Extract the main.zip file that you downloaded from PieceX. You will find a documentation folder and a zip file named whatsmail-main.zip.
Extract the whatsmail-main.zip file again into the folder or location of your choice.
Create a database for whatsmail on your localhost using PhpMyAdmin or the Database Manager of your choice.
Open the Terminal on your computer. You can use the terminal built into a text editor, such as Visual Studio Code, or your computer's default terminal. Then, enter the command: php artisan serve
.
Open the URL displayed after running the php artisan serve
command. In the example above, it points to the URL http://127.0.0.1:8000/
.
Follow the installation instructions. We provide more detailed explanations about this process in the Web Installation section of the documentation.
On shared hosting or cloud services like Cpanel, we cannot guarantee that your Node server will remain running continuously. Sometimes, it can stop unexpectedly and must be restarted manually. You can install pm2 to enable auto-reboot if Cpanel provides SSH access to automatically restart the Node server after a server restart.
The final step after completing the installation is to add the following code to your .env file:
WHATSAPP_SERVER_URL='http://0.0.0.0:3000'
WHATSAPP_HOST="0.0.0.0"
WHATSAPP_PORT=3000
RECONNECT_INTERVAL=5000
MAX_RETRIES=5
You can change WHATSAPP_HOST
to 127.0.0.1
and WHATSAPP_SERVER_URL
to http://127.0.0.1:3000
, or adjust it according to the local server available on your localhost. Likewise, you can change the WHATSAPP_PORT
to match an available port on your local server.
After setting up the .env
file, reopen the terminal in the script folder directory and run the command: node app.js
.
Occasionally on localhost, the Node server may stop unexpectedly. You simply need to restart it using the same method.