Windows WSL2 is great for web development

For the last 15 years i’ve used Ubuntu / Kubuntu and Fedora for web development. It’s great because of all the tools you have out of the box to do web development like Python with Django. However I always keep running into various issues with the desktop environments. Things like the system crashing after standby, Nvidia driver issues, media buttons and keyboard backlighting of the laptop not working properly, updates bricking the system, the UI stuttering etc.

But what are the alternatives? There is a variety of linux distros and desktop environments, but all of them seem to have different issues. There is also MacOS which I used for 7 years on the MBP 2011 and MBP 2015 models, but 1) it’s limited to a macbook 2) it’s not very customisable and the experience is not native. So you need special ARM Docker containers and Brew for package management. It’s very popular so Iknow it works, but it just did not like it.

I’ll get crucified by my fellow developers for saying this, but I like Windows 🙃

Using Windows for web development is not very popular as far as I know. In my last 15 years of professional development I have only seen colleagues working on either Linux or MacOS. I think this is mainly because most applications are deployed on linux servers and there is a mismatch with developing locally and things like paths and environment variables which work differently on Windows. There are solutions like Docker and virtual machines to make it workable though.

But what I like about Windows, is that despite jokes about Windows sucking, is that the general desktop experience is really stable (yes really!) and smooth. There is good driver support for all hardware. It also just feels good because the font rendering, mouse acceleration and touchpad support is just way better than in Ubuntu in my experience. So for me it’s a smooth trouble free experience for general desktop usage.

Windows with WSL2

WSL according to Microsoft:

Developers can access the power of both Windows and Linux at the same time on a Windows machine. The Windows Subsystem for Linux (WSL) lets developers install a Linux distribution (such as Ubuntu, OpenSUSE, Kali, Debian, Arch Linux, etc) and use Linux applications, utilities, and Bash command-line tools directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.

Installing it is a easy as wsl --install after which you have a working Ubuntu 24.04 (the default option) running in the background. Now it’s just a application on your system that opens into a terminal!

Docker is also integrated with WSL meaning you can run and manage it from either the container or Windows itself. Any ports it opens, like 3000 in the screenshot are automatically forwarded to your host machine. That also applies for anything you run in the container as well.

The file system is also shared both ways. This is useful, but also very slow (5-10 times as slow?). So it’s recommended to keep the files you work on in the Ubuntu container itself:

I use vscode with Microsoft’s extension that allows you start vscode in Windows, but work on the code inside the container natively:

The only issue I encountered was connecting DBeaver to the SQLite database inside the container using a \\wsl file path. It did not like that. There is a fix for this using a symlink appareantly, but you can also install DBeaver in the container and run it from there. This is a feature I did not mention yet:

DBeaver running inside WSL2 Ubuntu
The SQLite database is from a tutorial i’m following

However this doesn’t work all that great and i wouldn’t advise running your main software like an editor like that.

In conclusion

I ended being suprised and happy with how well it works.

  • It’s so fast that I don’t notice a difference with native Ubuntu.
  • It’s seamless because ports are forwarded automatically
  • You can open the Ubuntu terminal with a single click and don’t need to start anything. It boots in seconds.
  • The file system is mounted both ways, which is very convenient. Too bad that it is very slow, but you can work around that.
  • The VM does use about 4-6GB of memory, but with 32GB system memory this is not a problem.

So with all this I can use the good parts of Linux for (web) development, while having a trouble free desktop experience. I’ll have to test drive it for a bit longer, but I might even remove my Ubuntu dual boot!