How To Install Openssl In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

How To Install Openssl In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

openssl

OpenSSL cryptographic toolkit.

Maintainer: Debian OpenSSL Team



Section: utils

Install openssl

  • Debian apt-get install openssl Click to copy
  • Ubuntu apt-get install openssl Click to copy
  • Alpine OS apk add openssl Click to copy
  • Arch Linux pacman -S openssl Click to copy
  • Kali Linux apt-get install openssl Click to copy
  • CentOS yum install openssl Click to copy
  • Fedora dnf install openssl Click to copy
  • Raspbian apt-get install openssl Click to copy
  • macOS brew install openssl Click to copy

OpenSSL cryptographic toolkit.

How to use openssl?

Below are few example commands for openssl that you can use in the terminal.

Generate a 2048bit RSA private key and save it to a file:
openssl genrsa -out filename.key 2048Click to copy
Generate a certificate signing request to be sent to a certificate authority:
openssl req -new -sha256 -key filename.key -out filename.csrClick to copy
Generate a self-signed certificate from a certificate signing request valid for some number of days:
openssl x509 -req -days days -in filename.csr -signkey filename.key -out filename.crtClick to copy
Display certificate information:
openssl x509 -in filename.crt -noout -textClick to copy
Display the start and expiry dates for a domain's certificate:
openssl s_client -connect host:port 2>/dev/null | openssl x509 -noout -datesClick to copy
Display the certificate presented by an SSL/TLS server:
openssl s_client -connect host:port </dev/nullClick to copy
Display the complete certificate chain of an HTTPS server:
openssl s_client -connect host:443 -showcerts </dev/nullClick to copy
Installation of latest openssl command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS. You can copy the command for your OS from above and paste it into your terminal. Once you run the command it will download the 2026 latest package from the repository and install it in your computer/server.