FG
💻 Software☁️ Cloud & DevOpsDocker

ERROR: for db Cannot start service db: driver failed programming external connectivity on endpoint ltg_db_1

Freshover 8 years ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

when i do the following : ± docker-compose up Starting ltg_db_1 ERROR: for db Cannot start service db: driver failed programming external connectivity on endpoint ltg_db_1 (ecc3bf3036508fade24ffa4d6bc3e5fee0180073c5351667c471922a10fad60f): Error starting userland proxy: Bind for 0.0.0.0:27017 failed: port is already allocated ERROR: Encountered errors while bringing up the project. ± sudo docker inspect mongo [ { "Id": "sha256:135883d5d0b960b498e4c6c2009444b243b322d3fcb8fc4aa0cc741542dd6528", "RepoTags": [ "mongo:latest" ], "RepoDigests": [ "mongo@sha256:89ad0ed6321f48107356db1e11984e56614bdee64c3ad8a05484187f276ff705" ], "Parent": "", "Comment": "", "Created": "2016-11-01T23:31:04.120003872Z", "Container": "3e20e01de569b06a9cb43787870428254c585a56c2497835db2a616871db6f09", "ContainerConfig": { "Hostname": "397f80c505a4", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "27017/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOSU_VERSION=1.7", "GPG_KEYS=DFFA3DCF326E302C4787673A01C4E7FAAAB2461C \t42F

Error Output

ERROR: for db  Cannot start service db: driver failed programming external connectivity on endpoint ltg_db_1 (ecc3bf3036508fade24ffa4d6bc3e5fee0180073c5351667c471922a10fad60f): Error starting userland proxy:

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence90% success rate8 verificationsLast verified Mar 14, 2026

Solution: ERROR: for db Cannot start service db: driver failed programming external connectivity on endpoint ltg_db_1

Low Risk

I was getting the same error but was able to successfully continue after: `service mongodb stop` I'm a little confused (and new to docker & compose, to be quite honest) but shouldn't a db service running on the host not have a conflict with a db service running within a container?

76

Trust Score

8 verifications

90% success
  1. 1

    I was getting the same error but was able to successfully continue after:

    `service mongodb stop`

  2. 2

    I'm a little confused (and new to docker & compose, to be quite honest) but shou

    I'm a little confused (and new to docker & compose, to be quite honest) but shouldn't a db service running on the host not have a conflict with a db service running within a container?

Validation

Resolved in docker/compose GitHub issue #4126. Community reactions: 63 upvotes.

Verification Summary

Worked: 8
Partial: 1
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

dockerdocker-composecontainerskind/question