Using Nativefier to create a standalone WhatsApp application on Ubuntu is a straightforward process. Nativefier allows you to turn any web app into a desktop application.
-
Install Node.js and npm
Nativefier requires Node.js and npm (Node Package Manager). Install them using the following commands:
sudo apt update sudo apt install nodejs npm
Verify the installation with:
node -v npm -v
-
Install Nativefier
Use npm to install Nativefier globally:
sudo npm install -g nativefier
Verify the installation with:
nativefier --version
-
Create the WhatsApp App
Use Nativefier to create a standalone app for WhatsApp Web. Open a terminal and run:
nativefier --name "WhatsApp" "https://web.whatsapp.com/"
This command does the following:
--name "WhatsApp": Specifies the name of the application."https://web.whatsapp.com/": URL of the web app you want to package.
-
Locate the Application
Nativefier will create a directory with the application files in your current working directory. You can navigate to this directory using:
cd WhatsApp-linux-x64 -
Run the Application
Inside the directory, you’ll find an executable file. Run it with:
./WhatsApp
If you encounter permission issues, you may need to make the file executable:
chmod +x WhatsApp
If the
chrome-sandboxbinary doesn’t have the correct permissions or ownership you can do the following: navigate to the foldercd /path/to/your/WhatsApp/WhatsApp-linux-x64You need to change the ownership of the
chrome-sandboxfile to root:sudo chown root:root chrome-sandbox
Set the
chrome-sandboxbinary to have the SUID bit set (this is required for sandboxing to work correctly):sudo chmod 4755 chrome-sandbox
Try running the application again:
./WhatsApp
-
Create a Desktop Shortcut (Optional)
To make it easier to access the WhatsApp app, you can create a desktop shortcut:
-
Create a
.desktopfile in~/.local/share/applications/:nano ~/.local/share/applications/whatsapp.desktop -
Add the following content to the file:
[Desktop Entry] Name=WhatsApp Comment=WhatsApp Web as a standalone app Exec=/path/to/your/WhatsApp-linux-x64/WhatsApp Icon=/path/to/your/WhatsApp-linux-x64/resources/app/icon.png Terminal=false Type=Application Categories=Utility;
Replace
/path/to/your/WhatsApp-linux-x64/WhatsAppwith the actual path to the executable, and update theIconpath if needed. -
Save the file and exit the editor (
Ctrl+X, thenY, thenEnter). -
You should now see WhatsApp in your applications menu, and you can drag it to your dock or launcher for easy access.
-