Can't fully access website from LAN with WSL2


I’m using Sage 10 (6.15.2) in WSL2 with Ubuntu 22.04.2 LTS in Windows 10 Pro 22H2.

I cannot seem to make the dev server work properly from another device connected to my LAN. It works perfectly from Windows (at https://localhost:3000/). I tried port forwarding methods or using expose-wsl with my firewall disabled but all I can reach is the unstyled content of my home page.

From my phone, with either of these setups, if I access, the page doesn’t load the images nor the stylesheets, and if I click on any link it tries to load the url https://localhost:3000/page rather than I assume it has to do with my bud or apache config but I can’t seem to solve the issue.

Here are the paths in my bud.config.js

   * Set public path

   * Development server settings
      url: new URL('https://localhost:3000'),
      cert: '/etc/ssl/certs/apache-selfsigned.crt',
      key: '/etc/ssl/private/apache-selfsigned.key',
    .watch(['resources/views', 'app']);


<VirtualHost *:443>

  DirectoryIndex index.html index.php
  DocumentRoot /home/name/public_html/

  <Directory /home/name/public_html/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

  SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

  LogLevel warn
  ErrorLog /var/log/apache2/
  CustomLog /var/log/apache2/ combined


<VirtualHost *:80>
    Redirect /

I have read pretty much anything I could find about this issue, and I’m no running out of ideas, anyone has an idea of how I could make it work ?


Hi @Pierrealex,

Sounds really frustrating. I think you’re close though.

If you specify app.setPublicUrl('') does that fix the styles?

.setPublicUrl() sets the string that the HMR proxy uses to rewrite URLs. By default, it’s trying to keep you ‘inside’ the HMR server, hence rewriting your .setProxyUrl() to https://localhost:3000. As you’re accessing from the LAN, this needs to be updated to point to your LAN accessible address.

Exposing WSL to the LAN is the right move here (and your Apache config looks like it’ll respond on the LAN), but I think you just need this last step. I could be wrong…



Hi Tom,

That did it thank you so much ! I now have to use’ instead of localhost from Windows too but that’s not an issue.

I hope this helps other people too because information is quite scarce on this specific subject !

Thanks again,