Can't access local Ghost install on Windows WSL2

Hello!

I’m trying to set up Ghost on WSL2 on Windows using this guide: How to install Ghost locally on Mac, PC or Linux

I have Node 10.x installed and I’m not getting any errors when I install and start Ghost, but I can’t get it to pull up on localhost using the port it gives me. The service is definitely running and I checked my firewall rules to make sure the port is allowed through.

image

Is there something I’m missing? Thanks in advance for any insight.

Hey @cactus :wave:

That’s because WSL runs on a different IP. You have to do a couple things to get it set up.

  1. Allow connections from any host ghost config set server.host 0.0.0.0
  2. Get the IP address of your instance ifconfig | grep 172 | tr -s ' ' | cut -d ' ' -f3
  3. Update the url of your instance ghost config set url http://{IP_ADDRESS}:2369
  4. Restart ghost ghost restart
  5. Navigate to the URL you set

Note: the IP address of wsl changes every time it restarts. I have a host override such that ghost.local points to the current IP. Right now, I manually update the IP but I’ll probably eventually write a script to automatically do it

1 Like

Beautiful, that worked! Thank you