[Feature]: Make bind address configurable for local servers
What area(s) will this request affect?
Running your code locally
What type of change do you want to see?
Substantial change to existing feature
Overview
Context:
Recent changes in the CLI enforce binding local development servers to localhost for security reasons. While this is a sensible default, it causes issues in containerized environments like Docker.
Problem:
When running the CLI inside a Docker container, forwarded ports from the host machine are only accessible if the server binds to 0.0.0.0. Binding to localhost makes the server unreachable from outside the container, breaking the development workflow.
Proposal:
Introduce a configuration option (e.g. environment variable or CLI flag) that allows developers to override the default bind address. For example:
SHOPIFY_CLI_BIND_ADDRESS=0.0.0.0 yarn dev
This would preserve the secure default (localhost) while enabling flexibility for containerized setups.
Benefits:
Supports Docker and other container environments
Avoids the need for custom patches or forks
Maintains security for most users while offering configurability
Thank you for your work on improving the CLI! Happy to help test or contribute if needed.
Motivation
I’m running the app inside a Docker container. When forwarding ports from the host to the container, Docker only allows binding to 0.0.0.0, not localhost. This means the development server becomes inaccessible unless it listens on all interfaces.
Would it be possible to make the bind address configurable—perhaps via an environment variable or CLI flag—so developers can choose between localhost and 0.0.0.0 depending on their setup?
I need to be able to run it in Docker as well. + 1
Last working version 3.83.3
Need this as well, can't currently work on an app app since it uses docker and it's forced me to use the latest cli version
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
Bump. Will someone review the PR?