Chapter 3. Secure communication for containerized applications


You can add certificates from your local certificate authority (CA) or from a third-party vendor into a Podman machine. After adding these certificates, you can use them in your images to:

  • Secure the communication channel between the running applications in your container and the external host system.
  • Validate the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) certificates provided by external services for authentication.

Podman stores certificates in the machine at /etc/pki/ca-trust/source/anchors/, and you can obtain them in various formats:

  • Privacy-Enhanced Mail format (.pem)
  • Certificate file format (.crt)
  • Certificate file format (.cer)
Note

On Windows, the Podman commands use the CAs from the certificate store. For example, if you are unable to log in to an internal registry because the added certificate was not trusted by Podman, you can add it to the Windows certificate store. This will enable Podman commands to trust the certificate and help you log in to that registry.

3.1. Add certificates to a Podman machine

You can add certificates from a local CA or third-party vendor directly to a running Podman machine. After adding a certificate, a reboot of the Podman machine is required to ensure the changes take effect.

Prerequisites

  • You have a running Podman machine.
  • You have obtained the required certificates for installation, such as certificate.pem or certificate.crt.

Procedure

  1. Start an interactive session with the default Podman machine:

    $ podman machine ssh <machine_name>
  2. Optional: If Podman runs in the default rootless mode, switch to a root shell:

    $ sudo su -
  3. Change to the directory where the certificates must be placed:

    $ cd /etc/pki/ca-trust/source/anchors
  4. Perform one of the following steps to obtain the certificate:

    • Use the curl command to download a certificate:

      $ curl [-k] -o <my-certificate> https://<my-server.com/my-certificate>
    • Use any editor, such as Notepad or Vim to create a certificate file with .crt, .cer, or .pem extension.

      Note

      You can convert a certificate file to a text file and copy its content to the editor.

  5. Add the certificate to the list of trusted certificates:

    $ update-ca-trust
  6. Optional: To exit the root shell, run the following command:

    $ exit
  7. Run the exit command to exit the Podman machine.
  8. To apply your changes, reboot the Podman machine:

    $ podman machine stop <machine_name>
    $ podman machine start <machine_name>
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top