next/image Un-configured Host

next/image rejected a src hostname? Next.js says that host is missing from images.remotePatterns, and every part of the URL has to match.

Reviewed October 21, 2026

What it means in plain English

Next.js raises this when a next/image src uses a hostname that is not defined in images.remotePatterns in next.config.js. Matching is exact and case-sensitive. For a URL, the protocol, hostname, port, pathname, and search each have to match the pattern. A mismatch in any one part is rejected.

example.org is a different hostname from www.example.org and from assets.example.org. https does not match a pattern that only allows http. A port such as :3000 has to be in the pattern when the src has it.

Likely causes

  • The live image URL is a subdomain, and remotePatterns only lists the apex host.
  • The pattern pathname is /images/ and the file sits under a deeper path. Next.js says the path has to be covered by a glob such as /** or /images/**.
  • A pattern built with new URL(...) omitted search, so the search property is '' and query strings are not allowed.

How to fix it, step by step

  1. Copy the src that failed. Note its protocol, hostname, port, pathname, and query string.
  2. Add a remotePatterns entry that matches those parts. Next.js shows this shape, with its own example host:
module.exports = {
  images: {
    remotePatterns: [new URL('https://assets.example.com/account123/**')],
  },
}
  1. To allow any search parameter, omit the search key and use the object form Next.js shows:
module.exports = {
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'assets.example.com',
        port: '',
        pathname: '/account123/**',
      },
    ],
  },
}
  1. On Next.js before 15.3.0, the same page says to use the object form, including search: '' when search params are not part of the URL. On Next.js before 12.3.0, it says to set images.domains to the hostname list instead.
  2. Redeploy so the host builds with the new next.config.js.

How to check it worked

  • The page renders the image, and the un-configured host error is gone for that src.
  • A URL that still differs by one part, such as www, still fails. That is the exact match Next.js describes.

Sources

More Next.js errors fixes

Keep going on your own.

The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.

See products