2.9 KiB
Building WLED Controller for Windows
This guide explains how to build a standalone Windows executable for WLED Controller.
Prerequisites
- Node.js 20 or higher
- npm
Build Steps
1. Install Dependencies
First, install dependencies for both frontend and backend:
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install
2. Run Database Migrations
Ensure your database is set up:
cd backend
npm run prisma:migrate
npm run prisma:generate
3. Build the Executable
From the backend directory, run:
cd backend
npm run package
This command will:
- Build the frontend and copy it to
backend/public - Build the backend TypeScript code to JavaScript
- Package everything into a single Windows executable
The executable will be created at: release/wled-controller.exe
Running the Executable
First Time Setup
- Copy the
wled-controller.exefile to your desired location - In the same directory, create a
prismafolder - Copy the
backend/prisma/dev.dbfile (your database) to the same directory as the exe
Your directory structure should look like:
your-install-folder/
├── wled-controller.exe
└── prisma/
└── dev.db
Running
Simply double-click wled-controller.exe or run from command line:
.\wled-controller.exe
The application will start on port 3000 (configurable via PORT environment variable).
Access the web interface at: http://localhost:3000
Configuration
You can set environment variables before running:
# Set custom port
$env:PORT=8080
.\wled-controller.exe
# Set custom database path
$env:DATABASE_URL="file:./custom-path/wled.db"
.\wled-controller.exe
Troubleshooting
Database Not Found
If you see database errors, ensure:
- The
prismafolder exists in the same directory as the exe - The
dev.dbfile is in theprismafolder - File permissions allow reading/writing
Port Already in Use
If port 3000 is already in use, set a different port:
$env:PORT=3001
.\wled-controller.exe
Missing Dependencies
The executable includes all Node.js dependencies, but requires:
- Windows 10 or higher (64-bit)
- No additional runtime needed
Development vs Production
- Development: Use
npm run devin both frontend and backend directories - Production Build: Use
npm run packageto create the executable
File Sizes
The packaged executable will be approximately 80-100 MB due to:
- Node.js runtime
- All npm dependencies
- Frontend static files
- Prisma binaries
Notes
- The executable is self-contained and includes the Node.js runtime
- All frontend files are served from the built-in web server
- Database file can be backed up by copying the
dev.dbfile - Scheduler tasks will run automatically when the executable starts