Setting up a Linux-based development site on a Windows machine
In this guide, we'll walk you through the process of setting up a local Linux web server within Windows using the Windows Subsystem for Linux (WSL) and Virtualmin. This setup allows you to develop and test your Linux-hosted website on Windows, mirroring a typical Linux production environment.
Installing WSL and a Linux Distribution
- First, enable Windows Subsystem for Linux and Virtual Machine Platform in "Windows Features." Restart your Windows machine, then open PowerShell as Administrator and run . Install a Linux distribution (Ubuntu 20.04 LTS is common) from the Microsoft Store.
- Launch the Linux distro, create your Linux username and password.
This sets up a Linux environment running natively inside Windows with near full Linux kernel compatibility.
Installing a Web Server and Virtualmin
- Update your package lists and install a web server stack, for example Apache, PHP, and MariaDB or MySQL:
Start Apache to check it works:
You can access the local server at from your Windows browser.
- Install Virtualmin, a web hosting control panel that simplifies managing multiple websites on a Linux server. Ensure you have a compatible OS—Ubuntu is supported. Follow Virtualmin’s installation script:
Once installed, Virtualmin can be accessed through a web browser using .
Using Virtualmin for Development
Virtualmin allows you to create virtual hosts (websites) easily. Upload website files to or use the Virtualmin interface to manage site directories. Configure databases, DNS, SSL certificates from the Virtualmin UI.
Additional Tips and Context
- Using WSL 2 provides a real Linux kernel environment that is better for web server compatibility and performance than WSL 1.
- AlmaLinux or CentOS-based distros can be installed in WSL if you want a closer match to typical web hosting Linux distributions.
- Make sure firewall and Windows Defender allow traffic to the ports Virtualmin uses (usually 10000 TCP).
- Integrate filesystem access between Windows and WSL for editing files in your favorite Windows editor while running Linux server commands.
- Network access to WSL servers works at by default in WSL 2; cross-system network setup might be required for external access.
With this setup, you can run a full-featured Linux web hosting environment inside Windows seamlessly for development and testing, minimizing the gap between your dev and production environments.
For detailed command sequences or instructions for setting up Virtualmin specifically, feel free to ask!
In this detailed setup, you can also install AI software within your Linux environment running on Windows, further enhancing your development experience. Additionally, you might find it beneficial to configure home-and-garden AI solutions, such as smart lighting systems or home security, using the Linux platform and associated software for improved lifestyle integration and technology control.