π Local Development Stack Alternative for PHP
After much frustration with XAMPP and other dev stacks, I decided to try a better approach β one that feels closer to a real server environment without the Composer bloat or the limits of outdated tools.
I'm now using Debian Linux 12 (Bookworm) inside VirtualBox, running a full ISPConfig 3 server.
π Why This Stack Rocks
- β
Secure Boot-compatible VirtualBox VM
- β
ISPConfig 3 with PHP versions 5.6 through 8.4
- β
HTTPS, DNS, MySQL, Mail, Letβs Encrypt β real-world server behavior
- β
No Composer dependency β ideal for classic or custom PHP apps
π οΈ Getting Started
This guide assumes youβre using a computer that supports VirtualBox. Iβm using Debian 12 as my host OS, but it works on Windows, macOS, and Linux.
β οΈ Note: These are general install instructions. You're responsible for anything that may go wrong on your system by following them.
Step 1: Download & Install VirtualBox
π https://www.virtualbox.org/
On Windows and macOS, this should be straightforward.
π§ On Debian Linux, you may need extra steps. See my post here:
π Installing VirtualBox on Debian 12 with MOK
Step 2: Download Debian ISO
π https://www.debian.org
Get the debian-12.x.x-amd64-netinst.iso
file.
Step 3: Create Your Virtual Appliance in VirtualBox
Follow these steps in VirtualBox:
- Machine β New
- Name your VM and choose a folder to store it.
- Select the downloaded Debian ISO.
- β
Check "Skip Unattended Installation" to avoid Gnome getting installed.
- Allocate at least 2048 MB RAM and 2 CPUs
- Create a virtual hard disk β 20 GB minimum
- Click Finish and start the VM.
Now follow this guide in a browser tab:
π Minimal Debian Server Install
Step 4: Configure Networking & Export Your Appliance
After Debian is installed:
- Open VirtualBox β Settings β Network
- Set "Attached to" β
Bridged Adapter
- Click OK
- Right-click your appliance β ACPI Shutdown
- Go to File β Export Appliance (create a backup to save time later)
Step 5: ISPConfig 3 Installation
Restart your appliance.
You can install ISPConfig 3 from the terminal window or over SSH (e.g., using Remmina or PuTTY). Log in as your non-root user, then:
su -
Install ISPConfig 3 by following:
π Perfect Server Auto-Installer for Debian/Ubuntu
Once installed, open your browser and go to:
https://YOUR_VM_IP:8080
π‘οΈ Youβll get a self-signed certificate warning β accept it.
Step 6: Set Up a Local Development Site
In ISPConfig:
- Go to Sites β Add new Website
- Enter a dev domain like
dev1.local
or any fake domain.
- Note your Document Root for development.
- Set:
- Auto-Subdomain:
None
- SSL: β
(check the box)
- Letβs Encrypt SSL: β (uncheck, this only works with a public IP, and port forwarding, with a real domain)
- PHP Mode:
PHP-FPM
- PHP Version: your choice
- Scroll back to the top and click the SSL tab
- Enter your info, leave the other fields blank (self-signed certs are generated) at the bottom click Save
Step 7: Set Up MySQL, FTP, SSH
- Create Database Users and Databases under the "Sites" panel
- Create optional FTP users
- For secure access, set up a Jailkit SSH/SFTP user and assign an SSH key(Optional)
Step 8: Set Up Local Email Testing
- Go to Email β Add Domain β enter your dev domain
- Go to Email Mailbox β Add new Mailbox
- Enter email & password β click Save
Use this to test mail functionality in local apps.
Step 9: Edit Hosts File on Your Host Machine
You need to map your fake domains to the VirtualBox appliance.
π§ Linux or π macOS
Edit /etc/hosts
:
sudo nano /etc/hosts
Add:
YOUR_VM_IP dev1.local dev2.local
Then:
CTRL+O β Save | CTRL+X β Exit
(Optional DNS flush on macOS):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
πͺ Windows 10 / 11
- Run Notepad as Administrator
- Open:
C:\Windows\System32\drivers\etc\hosts
- Add:
YOUR_VM_IP dev1.local
YOUR_VM_IP dev2.local
- Save the file
(Optional DNS flush):
ipconfig /flushdns
β
Test Your Setup
Open a terminal and run:
ping dev1.local
If it resolves to your VMβs IP, you're set!
Try opening:
https://dev1.local/
https://dev1.local/phpmyadmin
https://dev1.local/webmail
https://dev1.local/stats
Youβll likely get SSL warnings β accept and continue.
π Deploy Your Code
Use your IDE or code editor to upload files via:
- FTP
- SFTP/SSH
- Or work directly in your VMβs Document Root
You now have a real server environment to build and test modern PHP apps β no XAMPP required.
π Done! Enjoy Developing
Thatβs it. You've now built a powerful, flexible local dev environment using open-source tools, full LAMP stack features, and no Composer nonsense.
Happy coding!
πDonate to the Developers:
βοΈ Written by:
- Vector-Meister β vector-meister.com
- π€ Co-authored by ChatGPT (OpenAI) β Assistant for polishing, structure, and formatting.