You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 51422d8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: public/wsl2.md
+49-19Lines changed: 49 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Development Environment | AlmaLinux 10 on WSL 2"
3
-
description: "AlmaLinux 10 on WSL 2 for a RHEL-compatible local stack. One Ansible playbook installs PHP, Apache, MariaDB, Composer, Node.js and phpMyAdmin, and provisions a virtualhost for every project you add."
3
+
description: "AlmaLinux 10 on WSL 2 for a RHEL-compatible local stack. One Ansible playbook installs PHP, Apache, MariaDB, Composer, Node.js and phpMyAdmin, and a second provisions a virtualhost for every project you add."
AlmaLinux is a RHEL-compatible distribution, so the packages, package manager and service conventions you use locally - `dnf`, `systemd` and the rest - are the ones you will see again in staging and production.
31
31
WSL 2 puts that distro on a Windows machine without a second computer or a Windows-native rebuild of every tool.
32
32
33
-
Everything here also runs the same way without WSL, directly on a bare AlmaLinux 10 host - the Ansible playbooks do not know or care which one they are provisioning.
33
+
Everything from Setup Packages onwards also runs on a bare AlmaLinux 10 host without WSL - the Ansible playbooks do not know or care which one they are provisioning.
34
+
Connect over SSH, and use the server's IP address instead of `localhost` when you test it.
34
35
35
36
- RHEL-compatible, matches production
36
37
- One playbook, the whole stack
@@ -39,15 +40,16 @@ Everything here also runs the same way without WSL, directly on a bare AlmaLinux
39
40
40
41
## Three steps to a running shell
41
42
42
-
Each step runs in a different place - Windows Terminal for the first two, the AlmaLinux 10 shell for the third.
43
+
Steps 1 and 2 run in Windows Terminal and step 3 in the AlmaLinux 10 shell; step 2 ends inside the new distro with a quick systemd check.
43
44
The full walkthrough, prompts and all, is in the docs.
44
45
45
46
### 1 . Terminal & requirements
46
47
47
-
Install Windows Terminal, then confirm WSL 2 is enabled - Hyper-V, Virtual Machine Platform and Windows Subsystem for Linux, all turned on in Windows features.
48
+
On Windows 11, install Windows Terminal, then check for a modern WSL 2 install.
49
+
If `wsl --version` isn't recognized, install WSL 2 with `wsl --install --no-distribution` and restart when prompted.
48
50
49
51
```shell
50
-
wsl -v
52
+
wsl --version
51
53
```
52
54
53
55
### 2 . Install AlmaLinux 10
@@ -58,15 +60,25 @@ Stop any other running distro, then install AlmaLinux 10 and create your Unix us
58
60
wsl --install -d AlmaLinux-10
59
61
```
60
62
63
+
Before moving on, confirm systemd is active inside AlmaLinux 10 - the playbook needs it.
64
+
If the check below prints an error instead of a status, add `systemd=true` under `[boot]` in `/etc/wsl.conf`, run `wsl --shutdown` from Windows Terminal and reopen the distro.
65
+
66
+
```shell
67
+
systemctl is-system-running
68
+
```
69
+
61
70
### 3 . Setup packages
62
71
63
-
Clone `dotkernel/development`, fill in `config.yml` with your Git identity and MariaDB root password, and let Ansible provision the rest.
72
+
Inside AlmaLinux 10, update the system, add the EPEL and Remi repositories, and install `ansible-core` with the `community.general` and `community.mysql` collections.
73
+
Then clone the `alma-linux-10` branch of `dotkernel/development`, copy `wsl/config.yml.dist` to `config.yml`, fill in your Git identity and MariaDB root password, and run the playbook from `development/wsl`.
Not using WSL? Skip straight to Setup Packages on a bare AlmaLinux 10 host - the same playbook runs there unchanged.
79
+
Not using WSL? Skip straight to Setup Packages on a bare AlmaLinux 10 host - the same playbook runs there unchanged; test it with the server's IP address instead of `localhost`.
80
+
81
+
After setup, [Editor Integration](https://docs.dotkernel.org/development/v2/editor-integration/) connects VS Code or PhpStorm, and [WSL Configuration](https://docs.dotkernel.org/development/v2/wsl-configuration/) covers where to keep projects and how to cap WSL's memory and CPU.
70
82
71
83
## What one playbook installs
72
84
@@ -75,27 +87,28 @@ Not using WSL? Skip straight to Setup Packages on a bare AlmaLinux 10 host - the
75
87
| Component | What you get |
76
88
| --- | --- |
77
89
| Web server | Apache, with virtualhosts routed automatically under `*.localhost`. |
78
-
| Database | MariaDB 11.4 LTS, plus phpMyAdmin for browsing it. |
79
-
| PHP | 8.4 by default via the Remi repository; `php81` … `php85` aliases switch versions. |
90
+
| Database | MariaDB 12.3 from the MariaDB repository, plus phpMyAdmin for browsing it. |
91
+
| PHP | 8.5 by default via the Remi repository; `php81` … `php85` aliases switch versions. |
80
92
| Node.js | 22 by default via NodeSource; `node18` … `node24` aliases switch versions. |
81
-
| Git & Composer | Your Git identity from `config.yml`, and the latest Composer, kept current with `composer self-update`. |
82
-
| Ansible |`community.general` and `community.mysql` collections - the same tool that just installed itself. |
93
+
| Git & Composer | Your Git identity from `config.yml`, and the latest Composer at install time; update it later with `composer self-update`. |
83
94
84
95
## Every project, its own subdomain
85
96
86
97
`api.dotkernel.localhost` and `frontend.dotkernel.localhost` can point at two different projects on the same machine, and Apache routes both without a single edit to the Windows hosts file - any `*.localhost` domain is routed automatically.
87
98
88
-
List the domains you want under `config.yml`'s `virtualhosts` key and run the playbook.
99
+
List the domains you want under `config.yml`'s `virtualhosts` key and run `create-virtualhost.yml` - a separate playbook you re-run for every new project, without repeating `install.yml`.
89
100
Existing entries are left untouched, so you keep adding to the same file as your project grows.
90
101
91
102
-[Read the virtualhosts docs](https://docs.dotkernel.org/development/v2/virtualhosts/overview/)
92
103
93
104
### One playbook, every domain
94
105
95
-
In `development/wsl/config.yml`, under `virtualhosts`:
106
+
In `development/wsl/config.yml`, under `config.virtualhosts`:
Files go under `/var/www/api.dotkernel.localhost/html`, with the document root at `html/public`.
121
+
`html/public` doesn't exist until you place a project there, so the URL shows an error until then.
108
122
109
123
## Common questions
110
124
@@ -121,10 +135,11 @@ Use one of the predefined aliases - `node18`, `node20`, `node22` or `node24` - w
121
135
### How do I fix permission issues?
122
136
123
137
Local development only: `chmod -R 777 data`, `log` or `public/uploads`, whichever directory the error names.
138
+
Don't carry this into staging or production.
124
139
125
140
### Where are the error logs?
126
141
127
-
Apache: `/var/log/httpd/error_log`. PHP-FPM: `/var/log/php-fpm/error.log` and `www-error.log`.
142
+
Apache: `/var/log/httpd/error_log`, plus `/var/www/<virtualhost>/log/error.log` for each virtualhost. PHP-FPM: `/var/log/php-fpm/error.log` and `www-error.log`.
128
143
129
144
### How do I update Composer?
130
145
@@ -138,14 +153,29 @@ Add `alias name="command"` to `.bash_profile` in your home directory, then run i
138
153
139
154
Remove its folder under `/var/www/`, its Apache config and enabled-site symlink, then `sudo systemctl restart httpd`.
140
155
156
+
### Why does the playbook fail with a systemd error?
157
+
158
+
systemd isn't active in the distro yet.
159
+
Add `systemd=true` under `[boot]` in `/etc/wsl.conf`, run `wsl --shutdown` from Windows Terminal, reopen AlmaLinux 10 and re-run `install.yml`.
160
+
161
+
### What if port 80 is already in use?
162
+
163
+
Find the Windows service holding it with `netstat -ano | findstr :80` and stop it, or change Apache's `Listen` port in `/etc/httpd/conf/httpd.conf` and restart httpd.
164
+
165
+
### Is this environment safe to expose beyond localhost?
166
+
167
+
No. It is for local development only: the MariaDB root password is stored in plaintext, phpMyAdmin allows root login and the firewall is off by default.
168
+
141
169
### Can I run this without WSL?
142
170
143
-
Yes - every instruction here works the same way on a bare AlmaLinux 10 host.
171
+
Yes - from Setup Packages onwards the steps are the same on a bare AlmaLinux 10 host.
172
+
Skip the WSL steps, connect over SSH, and use the server's IP address instead of `localhost`.
144
173
145
-
## Provision once, match production everywhere.
174
+
## Provision once, match your production OS
146
175
147
176
Built for how the platform ships.
148
177
149
-
The WSL 2 + AlmaLinux 10 setup is maintained by the same team behind the rest of the Headless Platform, so the local environment stays in step with what actually runs in production - not a Docker approximation of it.
178
+
The WSL 2 + AlmaLinux 10 setup is maintained by the same team behind the rest of the Headless Platform, so the local environment stays on the same OS family as production - not a Docker approximation of it.
179
+
It is a local development environment only: security is relaxed by default, so never expose it to a network.
150
180
151
181
[Talk to us ->](https://www.dotkernel.com/contact/)
0 commit comments