You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An app's private loopback port is picked without checking it is free, so it can collide with another app's public port #526
placeApp() in omarchyd/apps.mjs (~lines 1483-1486) picks the loopback port that Compose will publish for an app's web service:
constused=takenLoopbacks(app.id)// loopback ports of OTHER apps only...letp=20_000+(parseInt(createHash('sha256').update(app.id).digest('hex').slice(0,4),16)%9000)while(used.has(p))p++
The starting port is a hash of the app id, and the only thing it avoids is another app's loopback port. It does not avoid:
the public port of any installed app (the gateway listens on 0.0.0.0:<port>),
a port that something else on the server already listens on (portFree() is used for public ports in install() but not here).
The public-port check in install() rejects only ports < 1024, > 65535 and the reserved range 40000-49999, so a listing may legitimately use a port inside 20000-28999. If it equals the loopback port that another app's id hashes to, docker-compose up for the second app fails with "address already in use" and the install ends in an error. Because the port is a hash of the id, it fails the same way on every retry and on every update, until the other app is removed.
How to reproduce
The loopback port for the app id foo is 22302. I installed an app bar whose listing says port: 22302, then foo (web service, web: {service: web, port: 80}), through createApps() with a fake run:
apps.list -> bar port 22302 ; foo port 9001, internalPort 22302
compose.omarchy.yml of foo: ports: ["127.0.0.1:22302:80"]
bar's gateway would be bound to 0.0.0.0:22302 at that point (it has a web page in a real install), so Compose cannot publish 127.0.0.1:22302 for foo. Expected: foo gets the next free loopback port.
Suggested fix
In the allocation loops (placeApp, systemPortFor) also skip state.apps public/view ports and any port for which portFree() is false.
Activity
calledtoconstruct commentedon Nov 22, 2026
Working to resolve this.
No open pull request references this issue, and no one has commented that they are working on it.
#342, #525, #524, #527, #133, #102, #777, #129, #239, #243, #236, #233, #232, #142, #242, and #443 share the app store with this and will land in one pull request.
🤖 Generated with Grok 4.7
calledtoconstruct commentedon Nov 22, 2026
Thanks @nixfred. A private loopback port skips another app’s public port and a port that is already in use. This ships in #876.
🤖 Generated with Grok 4.7