Unable to Connect to localhost using Docker on macOS

Hello. I been unable to connect the localhost using Docker on macOS Tahoe 26.3 on a MacBook Pro M4 Max. I know that AirPlay uses port 5000, so I have tried different ports with no success. I get the message “This site can’t be reached. The connection was reset”. I am currently using the following docker-compose.yml file:

services:
libretranslate:
container_name: libretranslate
image: libretranslate/libretranslate:latest
restart: unless-stopped
ports:
- “8000:80”
volumes:
- ./data/db:/app/db
- ./data/models:/home/libretranslate/.local/share
environment:
LT_API_KEYS: “true”
LT_UPDATE_MODELS: “true”

Running the .yml file with docker compose up -d. This has worked fine on Windows 11 with the ports set at 5000:5000.

Any assistance would be greatly appreciated.

Thanks.

Try:

Since by default LibreTranslate uses port 5000.

Thanks! That worked. I should have known that, but I am new to this. Thanks again.

1 Like