In this article we will demonstrate how we install AlmaLinux 9 using Windows Subsystem for Windows (WSL2).

First, you need to check if your machine is ready for using WSL2. Open Windows Terminal and execute the following command:

wsl -v

The output should look similar to this:

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.3737

If instead of the above output, you get an error, it means that WSL is not (completely) installed on your machine. In this case, please follow the instructions found in this guide, then return to this page and continue with the next step.

Download and install AlmaLinux 9

Open Microsoft Store and search for AlmaLinux. From the results, select AlmaLinux 9 and install it. Once installed, clicking on Open will open it in Windows Terminal.

The installer will prompt you for your username, your password and password confirmation.

Setup AlmaLinux 9

While still in the AlmaLinux 9 terminal, start executing the following commands.

Install required packages:

sudo dnf install epel-release dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm -y

Update installed packages:

sudo dnf upgrade -y

Install Ansible:

sudo dnf install ansible -y

Clone our development environment setup package:

git clone https://github.com/dotkernel/development.git

Navigate to the directory with the Ansible recipes:

cd ~/development/wsl/

Using your preferred text editor, open config.yml where you must fill in the empty fields. Save and close the file.

Run Step 1 of the installer script (it will prompt you for the password you entered during the installation process):

ansible-playbook -i hosts install.yml --ask-become-pass

Restart AlmaLinux 9:

  • press Control + d
  • Open Windows Terminal
  • stop AlmaLinux 9 by executing wsl -t AlmaLinux9
  • start AlmaLinux 9 by executing wsl -d AlmaLinux9

Navigate back to the directory with the Ansible recipes:

cd ~/development/wsl/

Run Step 2 of the installer script (once again, it will prompt you for the password you entered during the installation process):

ansible-playbook -i hosts install.yml --ask-become-pass

Once finished, the installation is complete, your AlmaLinux 9 development environment is ready to use.

Test AlmaLinux 9

Check if everything works by opening in your browser:

  • http://localhost/ – Apache’s default home page
  • http://localhost/info.php – PHP info page
  • http://localhost/phpmyadmin/ – PhpMyAdmin (login with username root + the root password you configured in config.yml under mariadb -> root_password)

The complete guide with additional features is available here.


Looking for PHP, Laminas or Mezzio Support?

As part of the Laminas Commercial Vendor Program, Apidemia offers expert technical support and services for:

  • Modernising Legacy Applications
  • Migration from any version of Zend Framework to Laminas
  • Migration from legacy Laminas API Tools (formerly Apigility) to Dotkernel API
  • Mezzio and Laminas Consulting and Technical Audit
  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>