Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

Podman cannot push to a private registry because the certificate is not trusted

Your error

x509: certificate signed by unknown authority1 more line it can show

Fix it fast

Most common cause, 1 of 4

The registry's CA is not installed for Podman at all

Create a directory named after the registry host and port, and copy the CA certificate into it as ca.crt.

Fix
sudo mkdir -p /etc/containers/certs.d/registry.example.com:5000
sudo cp internal-ca.pem /etc/containers/certs.d/registry.example.com:5000/ca.crt
podman push registry.example.com:5000/team/app:1.0
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

x509: certificate signed by unknown authority on podman push means Podman found no trusted CA for the registry's certificate. Save the CA as ca.crt in /etc/containers/certs.d/<host>:<port>/, named exactly as in the image reference. On macOS and Windows the file must live inside the Podman machine VM, or use podman machine init --import-native-ca. Applies to Podman 6.x.

  • Applies to Podman 6.2, containers-certs.d(5) from container-libs, Podman machine on macOS and Windows
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Find out where Podman's engine runs and whether it is rootless. A remote service means a Podman machine VM (cause 3); a local engine means the certificate files on this host decide it (causes 1 and 2).

Run this first
podman info --format json | grep -E '"serviceIsRemote"|"rootless"'

Then find the line you see in this list and open its fix:

  1. 1The registry's CA is not installed for Podman at allserviceIsRemote is false and no directory for the registry exists under /etc/containers/certs.d or ~/.config/containers/certs.d
  2. 2The CA is there, but under a name Podman never looks upA certs.d folder exists, yet it is called registry.example.com:443 while the image is tagged registry.example.com/..., or the CA file ends in .pem
  3. 3Podman runs in a machine VM that does not have the CAserviceIsRemote is true because podman on macOS or Windows talks to a Podman machine, and the CA is trusted only on the host, for example in the macOS keychain
  4. 4A lab registry serves plain HTTP or has no certificate you can trustThe error changes to http: server gave HTTP response to HTTPS client, or nobody can hand you the CA

What does the error look like?

  • x509: certificate signed by unknown authority
  • http: server gave HTTP response to HTTPS client

Cause 1 of 4

The registry's CA is not installed for Podman at all

You seeserviceIsRemote is false and no directory for the registry exists under /etc/containers/certs.d or ~/.config/containers/certs.d

Check

Pushing to a registry whose certificate comes from an internal or self-signed CA fails with x509: certificate signed by unknown authority until Podman is given that CA. Podman reads per-registry TLS settings from certs.d directories, and any file ending in .crt there is treated as a CA certificate.

Check
ls /etc/containers/certs.d/ ~/.config/containers/certs.d/ 2>/dev/null

Fix

Create a directory named after the registry host and port, and copy the CA certificate into it as ca.crt. The /etc path serves both rootful and rootless runs; the ~/.config path affects only your user.

Fix
sudo mkdir -p /etc/containers/certs.d/registry.example.com:5000
sudo cp internal-ca.pem /etc/containers/certs.d/registry.example.com:5000/ca.crt
podman push registry.example.com:5000/team/app:1.0

Verify

The push copies its blobs and ends with Writing manifest to image destination, with no x509 line.

Verify
podman push registry.example.com:5000/team/app:1.0

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 4

The CA is there, but under a name Podman never looks up

You seeA certs.d folder exists, yet it is called registry.example.com:443 while the image is tagged registry.example.com/..., or the CA file ends in .pem

Check

The directory name has to match the host and port as written in the image reference. registry.example.com:443 only applies to images tagged with :443, and a reference without a port needs a folder without one. Files without the .crt extension are not read as CAs.

Check
ls -R /etc/containers/certs.d/ ~/.config/containers/certs.d/ 2>/dev/null

Fix

Rename the folder so it equals the host[:port] part of the tag, and give the CA file a .crt extension.

Fix
sudo mv /etc/containers/certs.d/registry.example.com:443 /etc/containers/certs.d/registry.example.com
sudo mv /etc/containers/certs.d/registry.example.com/ca.pem /etc/containers/certs.d/registry.example.com/ca.crt

Verify

ls shows a folder whose name matches the image tag, holding ca.crt, and the push succeeds.

Verify
ls /etc/containers/certs.d/registry.example.com/

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 4

Podman runs in a machine VM that does not have the CA

You seeserviceIsRemote is true because podman on macOS or Windows talks to a Podman machine, and the CA is trusted only on the host, for example in the macOS keychain

Check

With a Podman machine, the podman command you type is a remote client, and the engine that contacts the registry runs inside the VM. Certificates trusted by the host system are not imported unless you ask for it, and the remote client does not offer --cert-dir.

Check
podman info --format json | grep '"serviceIsRemote"'

Fix

For a new machine, create it with --import-native-ca so the host's trusted CAs are imported when it starts. For an existing machine, open a shell in the VM and put the CA into certs.d there. The macOS home folder is mounted into the VM under the same path by default.

Fix
# new machine
podman machine init --import-native-ca --now

# existing machine
podman machine ssh
sudo mkdir -p /etc/containers/certs.d/registry.example.com:5000
sudo cp /Users/<you>/internal-ca.crt /etc/containers/certs.d/registry.example.com:5000/ca.crt
exit

Verify

Running the push again from the host terminal now completes.

Verify
podman push registry.example.com:5000/team/app:1.0

Confirmed by docs.podman.io

Did this fix it?

Cause 4 of 4

A lab registry serves plain HTTP or has no certificate you can trust

You seeThe error changes to http: server gave HTTP response to HTTPS client, or nobody can hand you the CA

Check

TLS verification is on by default for push, pull and build. A registry without encryption therefore fails before any certificate is checked.

Check
podman push --tls-verify=false registry.example.com:5000/team/app:1.0

Fix

Prefer real TLS on the registry. For a test box only, turn verification off for one command, or mark that one registry insecure in a drop-in file. On a Podman machine, create the file inside the VM.

Fix
# /etc/containers/registries.conf.d/registry-lab.conf
[[registry]]
location = "registry.example.com:5000"
insecure = true

Verify

podman push works without --tls-verify=false, which confirms the drop-in file is read.

Verify
podman push registry.example.com:5000/team/app:1.0

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Ship the internal CA to every build host and Podman machine with the same provisioning script, under /etc/containers/certs.d/<host>:<port>/ca.crt.
  • Tag images with one fixed form of the registry name (with or without the port) and name the certs.d folder to match it.
  • Create new Podman machines with --import-native-ca when your company CA is already trusted on the laptop.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.