mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5240] [MERGED] feat(docker): support XUI_PORT runtime override #5824
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5824
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5240
Author: @surfdps
Created: 6/12/2026
Status: ✅ Merged
Merged: 6/14/2026
Merged by: @MHSanaei
Base:
main← Head:feat/xui-port-docker-override📝 Commits (3)
888beb3feat(docker): support XUI_PORT runtime override5a545efdocs: describe XUI_PORT deployment usage67d0fdeMerge branch 'main' into feat/xui-port-docker-override📊 Changes
6 files changed (+99 additions, -1 deletions)
View changed files
📝
.env.example(+1 -0)📝
CONTRIBUTING.md(+8 -0)📝
docker-compose.yml(+3 -1)📝
internal/config/config.go(+18 -0)➕
internal/config/config_test.go(+61 -0)📝
internal/web/web.go(+8 -0)📄 Description
Summary
Adds an optional
XUI_PORTenvironment variable that overrides the web panel's database-backed port at runtime without modifying the persisted setting. It also documents local and Docker Compose usage.Why
Container deployments currently require mutating the database to change the panel's internal listening port. This enables configuring it through Docker, Compose, systemd, or other deployment environments.
Closes #4846
Type of change
Areas affected
How was this tested?
go test ./....go build ./....XUI_PORT=38080changes the listener while persistedwebPortremains2053.XUI_PORTrestores port2053.2053and logs a warning.docker compose config --quiet.Screenshots / recordings
None.
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.