Building & Distribution
Compile your desktop app into a native executable and distribute it to users.
Compile
Build a production-ready native executable with a single command:
This auto-detects your desktop project and runs wails build. The output binary is placed in build/bin/.
You can also run wails build directly for more control over build flags.
Build Output
| Platform | Output |
|---|---|
| Windows | build/bin/myapp.exe |
| macOS | build/bin/myapp.app |
| Linux | build/bin/myapp |
Cross-Platform Builds
Build for a specific platform using the -platform flag:
Windows Installer (NSIS)
Create a Windows installer with NSIS (requires NSIS installed):
This produces a .exe installer that handles installation, Start Menu shortcuts, and uninstallation.
Production Tips
App Icon
Place your icon at build/appicon.png (1024x1024). Wails automatically converts it for each platform during build.
Environment Config
The .env file is read at runtime from the working directory. For production, either bundle it alongside the executable or use OS environment variables.
Embedded Assets
The React frontend is embedded into the Go binary via //go:embed all:frontend/dist. No separate files need to be distributed — everything is in one executable.
Database Location
SQLite creates app.db in the working directory. For a better user experience, consider using os.UserConfigDir() to store the database in the user's config folder.
Wails Configuration
The wails.json file controls build settings:
{"name": "myapp","outputfilename": "myapp","frontend:install": "npm install","frontend:build": "npm run build","frontend:dev:watcher": "npm run dev","frontend:dev:serverUrl": "auto","author": {"name": "Your Name"}}