Check this post if your bolt.diy installation is not working on mobile devices

Hey everyone! :wave:
I was facing this issue where I was not able to use bolt.diy on my mobile or ipad over TailScale. I asked ChatGPT for help and then I asked “It” to write this post to help anyone who might come across the same issue :wink:

I was briefly seeing the landing page but as soon as I wanted to do something it was giving me an error with several lines in red.

If you’ve been struggling to get Bolt.diy working on your mobile or tablet, I found a fix that worked perfectly for me, and I wanted to share it with you all!

The issue happens because the development server in Bolt.diy (using Vite) is configured to only work on localhost by default. This limits access to the machine where it’s running and blocks other devices on the network from connecting.

The solution? Just a few tweaks to allow the development server to listen on all network interfaces. Here’s how I fixed it:

Steps to Fix Mobile/Tablet Access

1 - Update the docker-compose.yaml: Open the docker-compose.yaml file in your project and make sure the app-dev service has this configuration:

  • Set VITE_HMR_HOST=0.0.0.0 in the environment section.
  • Add --host 0.0.0.0 to the command for the development server.

Example Snippet:
app-dev:

environment:
- VITE_HMR_HOST=0.0.0.0
- VITE_HMR_PORT=5173
command: pnpm run dev --host 0.0.0.0

2 - Then restart the container:

Restart the container with the development profile: Run this command to apply the changes:

docker compose --profile development up --build

(I am using the development profile so this should be the profile you are using).

3 - Access Bolt.diy from your mobile or tablet using:

http://<your-computer's-IP>:5173

Replace <your-computer's-IP> with the IP address of the machine running Bolt.diy.


:face_with_monocle: Why Does This Happen?

By default, Vite binds the development server to localhost, which only allows access from the same machine. When we update it to use 0.0.0.0, it tells the server to listen on all network interfaces, allowing other devices on the same Wi-Fi network to connect.

2 Likes

Woah I really appreciate you not just fixing an error for yourself but sharing with us how to do it! Thanks a ton for posting this @Fer!

1 Like

:heart: now I am trying to fix another error related to https apparently when trying to use Gemini model.

Failed to execute ‘postMessage’ on ‘Worker’: SharedArrayBuffer transfer requires self.crossOriginIsolated.

Apparently seems to be related to needing https so trying with a self signed cert but ChatGPT is having some troubles with this one :sweat_smile:

1 Like

It a pain in the a** :smiley: I tried some time out doing this with different reverse proxies (caddy and nginx) and self signed certificates. It was some weeks ago, so maybe its working better with current releases with more fix.
Didnt test it out again. I also just tried to get it done together with Ollama.
Think without its easier.