gpg: keyserver receive failed: Connection timed out

By xngo on July 13, 2019

Issue

Got connection timed out when trying to get the gpg key. For example,

gpg --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC

Solution

This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall, you could force gpg to use port 80 instead of 11371. For example,

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 04EE7237B7D453EC 648ACFD622F3D138

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.