Skip to content

Fix Streamlit Windows deployment by removing 0.0.0.0 server address#351

Merged
t0mdavid-m merged 2 commits intomainfrom
claude/fix-windows-installer-localhost-x3pma
Mar 14, 2026
Merged

Fix Streamlit Windows deployment by removing 0.0.0.0 server address#351
t0mdavid-m merged 2 commits intomainfrom
claude/fix-windows-installer-localhost-x3pma

Conversation

@t0mdavid-m
Copy link
Member

@t0mdavid-m t0mdavid-m commented Mar 11, 2026

Summary

This PR fixes Streamlit app connectivity issues on Windows by removing the 0.0.0.0 server address from bundled configurations and replacing it with the default localhost address, which is the only address that works reliably for local connections on Windows.

Key Changes

  • Documentation updates (win_exe_with_embed_py.md and win_exe_with_pyinstaller.md): Added instructions for removing the server address configuration from the bundled Streamlit config file using PowerShell
  • CI/CD workflow updates (.github/workflows/build-windows-executable-app.yaml and .github/workflows/test-win-exe-w-embed-py.yaml): Automated the removal of the address configuration line during the build process to ensure all Windows executables use the correct default localhost address

Implementation Details

The fix uses a PowerShell command to filter out lines matching ^address from the .streamlit/config.toml file:

(Get-Content streamlit_exe/.streamlit/config.toml) -notmatch '^address' | Set-Content streamlit_exe/.streamlit/config.toml

This approach:

  • Removes any explicit address = 0.0.0.0 configuration that may have been set
  • Allows Streamlit to use its default localhost binding, which works correctly on Windows
  • Is applied both in documentation (for manual builds) and in automated workflows (for CI/CD builds)

https://claude.ai/code/session_016amsLCZeFogTksmtk1geb5

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added instructions for configuring Windows executable deployments for local environments.
  • Chores

    • Updated Windows build processes to automatically prepare executables for local deployment.

claude added 2 commits March 11, 2026 17:34
On Windows, 0.0.0.0 is not a valid connect address — the browser fails
to open http://0.0.0.0:8501. By removing the address entry from the
bundled .streamlit/config.toml, Streamlit defaults to localhost, which
works correctly for local deployments. Docker deployments are unaffected
as they pass --server.address 0.0.0.0 on the command line.

https://claude.ai/code/session_016amsLCZeFogTksmtk1geb5
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

The pull request adds steps to GitHub Actions workflows that remove server address configurations from Streamlit config files during Windows executable builds, and updates documentation to describe this configuration adjustment. This ensures Windows deployments default to localhost.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/build-windows-executable-app.yaml, .github/workflows/test-win-exe-w-embed-py.yaml
Adds a PowerShell step to each workflow that removes lines starting with "address" from streamlit_exe/.streamlit/config.toml and dist/.streamlit/config.toml respectively, ensuring local deployment without enforced server address.
Documentation
docs/win_exe_with_embed_py.md, docs/win_exe_with_pyinstaller.md
Documents the process of removing server address configuration from bundled Streamlit config files to default to localhost instead of 0.0.0.0, including the specific PowerShell command used.

Possibly related PRs

Suggested reviewers

  • Arslan-Siraj

Poem

🐰 A rabbit hops through config files bright,
Removing addresses left and right,
Now localhost is the default way,
Windows builds run local, hip hooray! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: removing the 0.0.0.0 server address from Streamlit Windows deployment configurations to fix connectivity issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/fix-windows-installer-localhost-x3pma

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/build-windows-executable-app.yaml (1)

314-316: Tighten the filter to the actual TOML assignment.

'^address' is looser than necessary: it misses indented keys and can also strip unrelated keys that merely start with address. Matching the assignment itself is safer here.

Suggested change
-        (Get-Content streamlit_exe/.streamlit/config.toml) -notmatch '^address' | Set-Content streamlit_exe/.streamlit/config.toml
+        (Get-Content streamlit_exe/.streamlit/config.toml) -notmatch '^\s*address\s*=' | Set-Content streamlit_exe/.streamlit/config.toml
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build-windows-executable-app.yaml around lines 314 - 316,
Update the PowerShell filter used with Get-Content/.../Set-Content so it only
removes lines that are actual TOML assignments for the server address (not any
key that merely starts with "address"); replace the loose regex '^address' in
the pipeline with a pattern that matches optional leading whitespace, the exact
key, optional whitespace and an equals sign (e.g. '^\s*address\s*=') so lines
like indented "address = ..." are removed while other keys are preserved; keep
the same Get-Content | -notmatch | Set-Content flow and test with various
indentation cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/win_exe_with_embed_py.md`:
- Around line 99-103: The documented PowerShell command targets the wrong path;
update the command that currently references
"streamlit_exe/.streamlit/config.toml" so it points to the actual bundle
directory created earlier (i.e., the ../streamlit_exe/.streamlit/config.toml
location used in previous steps) so the remove-address pipeline runs against the
file created in the earlier steps and not a non-existent local path.

---

Nitpick comments:
In @.github/workflows/build-windows-executable-app.yaml:
- Around line 314-316: Update the PowerShell filter used with
Get-Content/.../Set-Content so it only removes lines that are actual TOML
assignments for the server address (not any key that merely starts with
"address"); replace the loose regex '^address' in the pipeline with a pattern
that matches optional leading whitespace, the exact key, optional whitespace and
an equals sign (e.g. '^\s*address\s*=') so lines like indented "address = ..."
are removed while other keys are preserved; keep the same Get-Content |
-notmatch | Set-Content flow and test with various indentation cases.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d9d17a9-a2fe-4730-acd9-94a65a03fc20

📥 Commits

Reviewing files that changed from the base of the PR and between c81fee6 and 106b944.

📒 Files selected for processing (4)
  • .github/workflows/build-windows-executable-app.yaml
  • .github/workflows/test-win-exe-w-embed-py.yaml
  • docs/win_exe_with_embed_py.md
  • docs/win_exe_with_pyinstaller.md

Comment on lines +99 to +103
3. Remove the server address from the bundled config to use `localhost` (default) instead of `0.0.0.0`, which doesn't work as a connect address on Windows:

```powershell
(Get-Content streamlit_exe/.streamlit/config.toml) -notmatch '^address' | Set-Content streamlit_exe/.streamlit/config.toml
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n docs/win_exe_with_embed_py.md | sed -n '82,110p'

Repository: OpenMS/streamlit-template

Length of output: 1270


Fix the path in this documented command.

Line 102 uses streamlit_exe/.streamlit/config.toml, but all previous steps (lines 82–97) create and populate ../streamlit_exe. The command targets the wrong path and will fail if the user follows the instructions sequentially from the same working directory.

Suggested change
-   (Get-Content streamlit_exe/.streamlit/config.toml) -notmatch '^address' | Set-Content streamlit_exe/.streamlit/config.toml
+   (Get-Content ../streamlit_exe/.streamlit/config.toml) -notmatch '^address' | Set-Content ../streamlit_exe/.streamlit/config.toml
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/win_exe_with_embed_py.md` around lines 99 - 103, The documented
PowerShell command targets the wrong path; update the command that currently
references "streamlit_exe/.streamlit/config.toml" so it points to the actual
bundle directory created earlier (i.e., the
../streamlit_exe/.streamlit/config.toml location used in previous steps) so the
remove-address pipeline runs against the file created in the earlier steps and
not a non-existent local path.

@t0mdavid-m t0mdavid-m merged commit fb2fe67 into main Mar 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants