Umbraco + SQL Server in Docker: Connection Fails in Installer (Works in DBeaver) 🔍

Context:

  • Fedora Linux host, SQL Server in Docker (mcr.microsoft.com/mssql/server:2022-latest).
  • Works: DBeaver connects to localhost,1433 with SA credentials.
  • Fails: Umbraco installer (same credentials) throws connection errors.

Tried:

  • Connection strings: localhost,1433 / container_name,1433 / host.docker.internal.
  • TrustServerCertificate=True.

Question:
What’s the correct host value for Umbraco’s installer when SQL runs in Docker? Is there a hidden Umbraco-specific gotcha?

You will need to give some more context, how is your docker setup, is SQL server in it’s own container, how is the docker networking set up etc. :slight_smile:

Thanks for your response. Here’s my setup:

  • SQL Server: Running in its own Docker container (mcr.microsoft.com/mssql/server:2022-latest).
  • Umbraco: Currently on my Fedora host (not containerized).
  • Networking: Default Docker bridge.

I resolved it by using 172.17.0.1 (bridge) in Umbraco’s server.

1 Like

As I understand it your can name your running docker containers (docker run --name sqlserver) and then you should be able to connect to Server=sqlserver instead of having to rely on an IP address that might change.

If you were to dockerize your Umbraco install, it needs to be in a docker network (docker network create my-network) and then you specify that network, something like: docker run --network my-network - that way you can connect between containers.

1 Like

connect to Server=sqlserver instead of having to rely on an IP address that might change.

Correct I should consider that when using docker because it is more reliable.

Thanks