How To Install Openssl In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?
Maintainer: Debian OpenSSL Team
Email: [email protected] .
Website: https://www.openssl.org/
Section: utils
Install openssl
-
Debian
apt-get install opensslClick to copy -
Ubuntu
apt-get install opensslClick to copy -
Alpine OS
apk add opensslClick to copy -
Arch Linux
pacman -S opensslClick to copy -
Kali Linux
apt-get install opensslClick to copy -
CentOS
yum install opensslClick to copy -
Fedora
dnf install opensslClick to copy -
Raspbian
apt-get install opensslClick to copy -
macOS
brew install opensslClick 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 copyGenerate a certificate signing request to be sent to a certificate authority:openssl req -new -sha256 -key filename.key -out filename.csrClick to copyGenerate 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 copyDisplay certificate information:openssl x509 -in filename.crt -noout -textClick to copyDisplay the start and expiry dates for a domain's certificate:openssl s_client -connect host:port 2>/dev/null | openssl x509 -noout -datesClick to copyDisplay the certificate presented by an SSL/TLS server:openssl s_client -connect host:port </dev/nullClick to copyDisplay 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.




