WordPress is one of the most widely used Content Management Systems. It offers a template and plugin system that allows you to freely edit your WordPress site. You can try out various features available and customize your blog or website or online store according to your wish. Additionally, it is a smart decision to install WordPress in Windows 11. This will provide you with a more convenient and efficient way to manage all your resources related to WordPress in Windows 11.
In Windows 11, WordPress is installed using WSL or an app that has an embedded Linux server.
INSTALL WINDOWS SUBSYSTEM FOR LINUX
The first step on your journey to install WordPress on Windows 11 is to install WSL. It is a very simple process. Tap the magnifying glass you spot in the taskbar and type cmd. This will provide you with the option to Run As an Administrator. Select that.
This will open up the console where you should enter the following command:
(Yes, there is a space after wsl)
Now patiently wait till WSL gets installed.
Once the installation process ends and WSL gets safely installed on your device, you will be notified via a message. At this moment, restart your system. This will complete the installation process for WSL. Now, in case you wish to update WSL, follow the above steps, run the command, wsl –update, instead of wsl –install.
Additionally, after WSL installs you will need to install a Linux Distro. To check the list of available Distro’s, run the command, wsl –list –online. After seeing the list of available Distro’s, decide which one you think would be best for you.
Following the same steps of running a command, run the command:
wsl –install –d name of Distro you want to install
After the Linux Distro is installed, we move on and install a web server like Nginx. The following steps will show how to install Nginx in Ubuntu (a Linux Distro).
Also read: How To Stop Automatic Updates In Windows 11
Since WordPress needs a webserver to function, it is necessary to download one like Nginx.
When you open your Linux Distro like Ubuntu, there are two commands you need to run.
sudo apt update
sudo apt install nginx
After Nginx is installed, you will need to run two more commands for the start and stop services to function.
sudo service nginx start
sudo service nginx stop
Now, you will need to check whether the installed Nginx is functional or not. Open any browser and enter:
If this opens to a page Welcome to Nginx, your server is very well functional.
INSTALL A DATABASE SERVER
WordPress content will get stored in a database server, hence you must install one. In this section, we will discuss the steps to download the Maria DB server. It is the default server in most Linux servers, is fast and very convenient to use with WordPress.
Firstly, run the installation command:
sudo apt install mariadb-server
Now to secure the database with a root password, run the command:
Following this you will be prompted to answer a few questions:
- Enter current password for root (enter for none): here you have to press ENTER
- Set root password (Y/N): press Y here
- New password: here add a password of your choice
- Re-enter new password
- Remove anonymous users? (Y/N): press Y here
- Disallow root login? (Y/N): press Y here
- Remove test database and access to it? (Y/N): press Y here
- Reload privilege tables now? (Y/N): press Y here
You cannot skip this step. Since WordPress is a PHP-based application, it is beyond necessary to install PHP to run it on Windows 11.
It’s a very simple process. To install PHP, run the following command to install it and its components:
sudo apt install php-fpm php-common php-mysql php-gmp php-curl php-intl php-mbstring php-xmlrpc php-gd php-xml php-cli php-zip
For context, this command will install PHP 7.4. To verify the version is 7.4 run this command:
sudo nano /etc/php/7.4/fpm/PHP.
TIME TO INSTALL WORDPRESS
It’s a very simple process like the ones above, to install and start WordPress after the installation of servers and PHP.
Firstly, to install WordPress run the following commands:
tar -xvzf latest.tar.gz
sudo mv wordpress /var/www/wordpress
Do remember you would also need the www-data to own the WordPress directory. For this run the following commands:
sudo chown -R www-data:www-data /var/www/WordPress/
sudo chmod -R 755 /var/www/wordpress/
Now to make WordPress work, configure Nginx VirtualHost. Following this, start a browser and enter the hostname of the server. Following this, complete the WordPress setup process. Now login and customize and manage the site as you see fit.
Hopefully, this guide was able to provide you with the necessary steps to install WordPress on Windows 11.