Distributing NativePHP Apps with Auto-Update Support


When building desktop applications with NativePHP, distribution and maintenance become critical components of the development lifecycle. Just like mobile apps need streamlined publishing and updates, desktop apps should also offer seamless installation and automatic updates to ensure a great user experience.

In this article, we’ll explore how to distribute your NativePHP app for different platforms and how to enable auto-update functionality, ensuring your users are always running the latest version with minimal effort.


🧳 Why Distribution Matters

Once you've developed your app using Laravel + NativePHP, the next step is packaging it for the desktop environments your users are on: Windows, macOS, and Linux.

Distributing the app effectively allows:

  • A smooth first-install experience

  • Controlled version management

  • Easier bug fixes and feature delivery


📦 Packaging Your NativePHP App

NativePHP builds on top of Electron, which allows packaging the app as a binary for multiple OSes. Here’s how you can get started:

🔧 1. Set Up the Build Tools

Make sure you have the Electron builder or NativePHP CLI installed. NativePHP typically comes with tooling for this.

composer require nativephp/electron

For building, use:

php artisan native:build

🏗️ 2. Choose Your Targets

You can specify which OS you'd like to build for:

php artisan native:build --platform=windows
php artisan native:build --platform=mac
php artisan native:build --platform=linux

The output will be ready-to-distribute binaries or installers.


🔁 Adding Auto-Update Support

Users don’t want to manually check for updates or re-download installers every time there's a new version. With auto-update, your app can notify users of updates and apply them automatically.

🛠️ Tools You Can Use

  • Electron-updater (most common)

  • NativePHP update hooks

  • Squirrel (for Windows)

  • AppImageUpdate (for Linux)

⚙️ Setup Example with Electron-Updater

  1. Install the updater in your Electron layer:

npm install electron-updater --save
  1. Configure Update Server: Host your updates using services like:

  • GitHub Releases

  • Private S3 buckets

  • Custom server

  1. Add Update Check in Your Main File:

import { autoUpdater } from 'electron-updater';

autoUpdater.checkForUpdatesAndNotify();
  1. Configure App Version in NativePHP: Make sure your versioning matches between Laravel and the Electron shell. Set version details in nativephp.config.php.


📡 Hosting Updates

A simple update server needs to:

  • Serve latest version metadata

  • Provide download links per platform

  • Respond to auto-updater requests

Popular options:

  • GitHub Releases (easy and free)

  • Laravel backend with JSON API

  • Self-hosted update servers like Nuts


🧪 Best Practices

  • ✅ Always test update flow locally before pushing live.

  • ✅ Inform users before restarting the app post-update.

  • ✅ Sign your apps for macOS and Windows to avoid OS security warnings.

  • ✅ Version your builds using semantic versioning (e.g., 1.2.0 → 1.2.1).



Distributing and auto-updating your NativePHP desktop app is a game-changer for providing modern software experiences. With the right tools and practices, you can ensure your Laravel-powered apps are easy to install and stay up-to-date—just like the best desktop software in the world.