Skip to content

OSRepo

  • Windows & PC
  • Apple & Android
  • Linux & Server
  • Coding & Dev
  • Apps & Software
  • General Tech
  • About Us
Troubleshooting Docker login x509 certificate expired error workflow.

Docker Login X509 Certificate Expired [Solved]

May 31, 2026 by osrepo
Issue Common Cause Primary Fix
Docker Login Failure System clock desynchronization Sync system time with NTP
x509: certificate expired Outdated CA certificates Update ca-certificates package
Registry Connection Error Registry SSL certificate expired Renew SSL on registry server

Troubleshooting Docker login x509 certificate expired error workflow.

Table of Contents

Toggle
  • What is the Docker Login x509 Certificate Expired Error?
  • Step-by-Step Solutions
    • 1. Synchronize System Time
    • 2. Update Local CA Certificates
    • 3. Restart the Docker Daemon
    • 4. Verify Registry Certificate Status
    • 5. Troubleshooting WSL2 (Windows Users)
    • Related posts:

What is the Docker Login x509 Certificate Expired Error?

The “x509: certificate has expired or is not yet valid” error occurs when the Docker client fails to establish a secure TLS connection with a container registry.

This error typically happens during the docker login command. It indicates that the security certificate presented by the registry (like Docker Hub or a private Harbor instance) is being rejected by your local machine.

The root cause is usually one of two things: your local system time is incorrect, making a valid certificate appear expired, or the registry’s certificate has actually reached its end-of-life.

Step-by-Step Solutions

1. Synchronize System Time

The most frequent cause of x509 errors is a drifted system clock. If your computer thinks it is 2020, every modern certificate will appear “not yet valid” or “expired.”

On Ubuntu/Debian, use the following commands to sync your time:

sudo apt-get install ntpdate
sudo ntpdate pool.ntp.org

For systems using timedatectl:

sudo timedatectl set-ntp on
timedatectl status

2. Update Local CA Certificates

If your system’s trust store is outdated, it may not recognize the root authorities used by the registry. Updating the ca-certificates package often resolves this.

sudo apt-get update
sudo apt-get install --reinstall ca-certificates
sudo update-ca-certificates

3. Restart the Docker Daemon

Docker caches certain certificate information. After updating your system time or CA store, a restart of the Docker service is required to pick up the changes.

sudo systemctl restart docker

4. Verify Registry Certificate Status

If the steps above do not work, the issue might be on the server side. You can check the expiration date of the registry’s certificate using openssl:

openssl s_client -showcerts -connect your-registry-domain.com:443

Look for the “Not After” date in the output. If the date has passed, the administrator of the registry must renew the SSL certificate.

5. Troubleshooting WSL2 (Windows Users)

WSL2 often suffers from time desync after a laptop wakes up from sleep. If you are using Docker Desktop with WSL2, run this inside your WSL terminal:

sudo hwclock -s

Related posts:

  1. Mysql Server Gone Away Login Failed [Solved]
  2. How To Fix Docker Dns Resolution Slow [Solved]
  3. Increase Innodb_Buffer_Pool_Size To Prevent Crash [Solved]
  4. How To Fix Kubernetes Scheduler Performance Issues [Solved]
Categories Linux & Server Tags docker login x509 certificate expired
Aws Ec2 Nvidia Driver Screen Flickering [Solved]
OSRepo
About Contact Privacy
© 2026 OSRepo. All rights reserved.
  • Privacy Policy
  • Disclaimer
  • Contact
© 2026 OSRepo • Built with GeneratePress