This is how I installed and configured WordPress on a local machine. The below instructions are for Windows 11 Pro or Enterprise
Install/enable Hyper-V with Powershell command: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Create/configure Hyper-V virtual switch (NAT, DHCP w/port forwards)
Create: NAT Switch: New-VMSwitch -Name "NAT_Switch" -SwitchType Internal
Configure: New-NetIPAddress -IPAddress 10.1.1.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT_Switch)"
Create NAT: New-NetNat -Name "NAT_Switch" -InternalIPInterfaceAddressPrefix 10.1.1.0/24
Download Ubuntu ISO https://ubuntu.com/download/server#manual-install-tab
Create New VM with specific settings (gen2, memory, cpu cores, network switch)
Steps: Name: WP
Generation: 2
Startup Memory: Minimum: 1024 MB, Recommend at least 2048 MB. Un-check “Use Dynamic Memory for this virtual machine”
Connection: NAT_Switch
Virtual HD: Create a virtual hard disk. Name, Location, and Size defaults are OK.
Installation Options: “Install an operating system from a bootable image file” Media: Browse to the Ubuntu ISO downloaded earlier
Open VM Settings.
Security: Enable Secure Boot: Checked, Template: “Microsoft UEFI Certificate Authority”, Enable Trusted Platform Module: Checked
Processor: 2 Virtual processors
Automatic Start Action: Configure based on requirements. Set to “Always start” if you want website to always be up when the computer is on.
Install Ubuntu
“Try or Install Ubuntu Server”
Choose Language
Choose Keyboard config
Choose the base for the installation: “Ubuntu Server (minimized)”
Network configuration: Choose eth0 – Edit IPV4 – Manual
Edit eth0 IPv4 configuration: Subnet: 10.1.1.0/24, Address: 10.1.1.2, Gateway: 10.1.1.1, Name servers: 1.1.1.1
Ubuntu archive mirror configuration: Wait for test to run and show “This mirror location passed tests”
Guided storage configuration: Check “Use an entire disk”, Leave defaults.
Storage configuration: Under “USED DEVICES – DEVICE – ubuntu-lv – Edit – Size – Set to “max” (123.945G in this example)
Profile configuration: Your name: Can be left blank, Your servers name: wp, Pick a username: wp_user, Enter a secure password you can remember.
Upgrade to Ubuntu Pro: Skip for now (Can be configured later)
SSH configuration: Install SSH server: Checked
Installation will now occur to the VM internal drive.
Reboot Now
Please remove the installation medium, then press ENTER: This should happen automatically but if it doesn’t, in the Hyper-V Media menu, click on Eject.
Press ENTER and wait for the VM to boot
Ubuntu Installation is now complete.
Create port forwards through PowerShell on Host:Add-NetNatStaticMapping -NatName "NAT_Switch" -Protocol TCP -ExternalIPAddress "0.0.0.0/24" -ExternalPort 22 -InternalIPAddress "10.1.1.2" -InternalPort 22
Add-NetNatStaticMapping -NatName "NAT_Switch" -Protocol TCP -ExternalIPAddress "0.0.0.0/24" -ExternalPort 80 -InternalIPAddress "10.1.1.2" -InternalPort 80
Add-NetNatStaticMapping -NatName "NAT_Switch" -Protocol TCP -ExternalIPAddress "0.0.0.0/24" -ExternalPort 443 -InternalIPAddress "10.1.1.2" -InternalPort 443Add-NetNatStaticMapping -NatName "NAT_Switch" -Protocol TCP -ExternalIPAddress "0.0.0.0/24" -ExternalPort 8443 -InternalIPAddress "10.1.1.2" -InternalPort 8443
SSH from host to 127.0.0.1 (the port forward will re-direct to the virtual machine)
Login with user: wp_user and the password configured earlier.
Run: sudo apt update
sudo apt -y upgrade
sudo shutdown -r now
Reconnect to SSH:
Install CloudPanel: curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "8146dbe0a488e7088b04071b0c34d59aa0ab1fe9dcec382d395fd155c9e6c476 install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_12.3 bash install.sh
Create Site in CloudPanel
Go here: https://127.0.0.1:8443/
Create Admin account
Login with newly created admin account
Click Add Site
Click Create a WordPress Site
Enter site info
Edit Settings. Change PHP version to latest (8.5 when this was created). Enable Varnish Cache
Update DNS
Port forward on router TCP 80 (required for CloudPanel to generate and install a Lets Encrypt SSL cert),443 (and 8443 if remote access to CloudPanel is required – not recommended)
Create/install SSL cert
In CloudPanel Admin, open Site, go to SSL/TLS
Action – New Lets Encrypt Certificate