Install OpenSSL 3 on Rocky Linux 8 with Easy Steps
This guide is designed to walk you through the process of installing Install OpenSSL 3 on Rocky Linux 8. OpenSSL is a crucial open-source software library, providing cryptographic protocols and security algorithms essential for establishing secure communication channels across computer networks. It plays a vital role in protecting data from unauthorized access, encrypting email communications, securing payment transactions, and safeguarding other sensitive information. OpenSSL offers a broad spectrum of cryptographic functionalities, encompassing digital signatures, key exchange mechanisms, and public-key encryption schemes. It’s a cornerstone for web-based applications and can be seamlessly integrated into various software programs.
The OpenSSL library’s availability across Linux, macOS, and Windows platforms makes it a preferred choice for developers seeking robust and reliable secure communication protocols.
The default OpenSSL version included with Rocky Linux 8 might be outdated. This can lead to compilation errors when building applications that require a newer OpenSSL release. Therefore, this guide on the Install OpenSSL 3 on Rocky Linux 8 will demonstrate how to install the most recent OpenSSL version on Rocky Linux 8.
Before proceeding with this Install OpenSSL 3 on Rocky Linux 8 guide, ensure you have a non-root user with sudo privileges on your Rocky Linux 8 server. If you haven’t already set this up, refer to our guide on Initial Server Setup with Rocky Linux 8.
Set up OpenSSL 3 on Rocky Linux 8
First, refresh your local package index by running the following command:
sudo dnf update -y
Next, install the necessary Development Tools using the following command:
sudo dnf groupinstall "Development Tools" -y
Install also these packages:
sudo dnf install perl-IPC-Cmd perl-Test-Simple -y
Download OpenSSL From Source
Visit the GitHub OpenSSL Releases page to find the latest OpenSSL release. Use the wget command to download the source code:
sudo wget https://github.com/openssl/openssl/releases/download/openssl-3.1.0/openssl-3.1.0.tar.gz
Note: The specific version number in the URL may need to be adjusted to reflect the newest release.
Extract the downloaded file:
sudo tar xvf openssl-3.1.0.tar.gz
Navigate into the extracted OpenSSL directory:
cd openssl-3.1*/
Build and Install OpenSSL 3 on Rocky Linux 8
Configure OpenSSL using the following command:
./config

Build and install OpenSSL 3.1 with these commands:
# make
# make test
# make install
Update the system’s dynamic linker run-time bindings:
sudo ldconfig
Update the system-wide OpenSSL configuration:
sudo tee /etc/profile.d/openssl.sh<<EOF
export PATH=/usr/local/openssl/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/openssl/lib:$LD_LIBRARY_PATH
EOF
Reload your shell environment to apply the changes:
source /etc/profile.d/openssl.sh
Verify the OpenSSL installation by checking the version:
openssl version

Conclusion
You have now successfully learned how to Install OpenSSL 3 on Rocky Linux 8. OpenSSL provides essential security features such as data protection, email encryption, secure transactions, and safeguarding sensitive information.
Alternative Solutions to Installing OpenSSL 3 on Rocky Linux 8
While compiling from source, as demonstrated above, is a valid approach, it can be somewhat complex and requires careful management of dependencies and updates. Here are two alternative methods to achieve the same goal, offering potentially simpler or more automated solutions:
1. Using Software Collections (SCL)
Software Collections (SCL) enable you to install multiple versions of the same software on a single system without conflicts. You can install OpenSSL 3 alongside the system’s default OpenSSL version.
-
Explanation: SCL packages are installed in
/opt/rh/
directory, and thescl
command allows you to enable the environment for a specific software collection. This isolates the newer OpenSSL version and avoids breaking system dependencies. -
Steps:
-
Enable the SCL repository:
sudo dnf install centos-release-scl
-
Search for available OpenSSL SCL packages (Note: The exact package name may vary depending on availability and repository configuration):
sudo dnf search openssl scl
If an OpenSSL 3 package is available, it might be named similar to
openssl30-openssl-devel
. If a pre-built OpenSSL 3 SCL isn’t available, this method won’t work directly. Consider requesting such a package be built from the maintainers of SCL. We’ll continue assuming for demonstration that a suitable package is found. -
Install the OpenSSL 3 SCL package and the development package:
sudo dnf install openssl30-openssl openssl30-openssl-devel
-
To use the OpenSSL 3 version in a shell, enable the SCL environment:
scl enable openssl30 bash
This will start a new shell session with OpenSSL 3 configured in its environment. Within this shell,
openssl version
will report the newer version.
-
-
Code Example: The key here isn’t code, but the
scl enable
command that modifies the shell environment.Example Usage (within the SCL-enabled shell):
openssl version # Expected output (or similar): OpenSSL 3.0.x ...
Example usage to compile an application using the SCL-provided OpenSSL (within the SCL-enabled shell):
./configure --with-openssl=/opt/rh/openssl30/root/usr make make install
2. Using a Container (Docker/Podman)
This method leverages containerization to isolate the OpenSSL 3 environment completely.
-
Explanation: Containers provide a sandboxed environment, meaning you can install OpenSSL 3 without affecting the host system. This ensures compatibility and avoids potential conflicts.
-
Steps:
-
Install Docker or Podman (if not already installed). For Docker:
sudo dnf install docker sudo systemctl start docker sudo systemctl enable docker
-
Create a
Dockerfile
:FROM rockylinux:8 RUN dnf update -y RUN dnf install -y wget tar gcc make perl-IPC-Cmd perl-Test-Simple # Download, extract, build, and install OpenSSL 3 RUN wget https://github.com/openssl/openssl/releases/download/openssl-3.1.0/openssl-3.1.0.tar.gz RUN tar xvf openssl-3.1.0.tar.gz WORKDIR openssl-3.1.0 RUN ./config --prefix=/usr/local/openssl3 RUN make RUN make install ENV PATH="/usr/local/openssl3/bin:${PATH}" ENV LD_LIBRARY_PATH="/usr/local/openssl3/lib:${LD_LIBRARY_PATH}" RUN ldconfig CMD ["/bin/bash"] # Start a bash shell inside the container
-
Build the Docker image:
docker build -t rockylinux-openssl3 .
-
Run a container from the image:
docker run -it rockylinux-openssl3
This will drop you into a bash shell inside the container, where OpenSSL 3 is installed and configured.
-
-
Code Example: The
Dockerfile
above acts as the code example, defining the steps for creating the isolated environment.Example Usage (within the container):
openssl version # Expected output: OpenSSL 3.1.0 ...
These alternative methods offer different advantages. SCL provides a relatively lightweight way to use multiple versions of software, while containers provide complete isolation and reproducibility. The best approach depends on your specific needs and environment. The initial article’s Install OpenSSL 3 on Rocky Linux 8 from source will always be a solid option, but now you have 2 more!