How To Install OpenSSL 3 on Ubuntu

By Chandrashekhar Fakirpure

Updated on Feb 02, 2024

In this article, we’ll explain how to install OpenSSL 3 on Ubuntu 22.04. We'll install OpenSSL 3.0.8 version, we will keep updating the tutorial as new version get launched.

OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. OpenSSL is a software library for applications that secure communications over computer networks against eavesdropping or need to identify the party at the other end.

OpenSSL is licensed under an Apache-style license, which means that you are free to get and use it for commercial and non-commercial purposes subject to some simple license conditions. For a list of vulnerabilities, and the releases in which they were found and fixes, see our Vulnerabilities page.

We have covered installation OpenSSL 3.0.8.


  • A Ubuntu 22.04 installed dedicated server or KVM VPS.
  • A root user access or normal user with sudo privileges.

Step 1 – Keep the server up to date

Always keep the server up to date the security purpose.

dnf update -y

Step 2 - Install Dependencies

We need to install a development tool and few dependencies to install OpenSSL.

apt install build-essential zlib1g-dev -y

Step 3 - Download and Extract Source File

We will download the latest stable version is the 3.0 series. This is also our Long Term Support (LTS) version, supported until 7th September 2026. Here is the official source link.

Change current working directory to /usr/local/src/ using follow command:

cd /usr/local/src/

Download OpenSSL 3.0.8 using wget command. If wget command is unavailable in your server, install it using this command dnf install wget -y.


Now, extract the tar file.

tar xzvf openssl-3.0.8.tar.gz

Step 4 - Configure and Build

Navigate to the extracted directory and configure, build, test and install OpenSSL in the default location /usr/local/ssl.

cd openssl-3.0.8

Configure it with PATH.

./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib


Configuring OpenSSL version 3.0.8 for target linux-x86_64
Using os-specific seed configuration
Created Makefile
Created include/openssl/configuration.h

***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub   ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the file first)      ***
***                                                                ***

Now, build

make test
make install

Step 5 - Configure it shared libraries.

Once we have successfully installed OpenSSL, configure it shared libraries.

Naviagate to the /etc/ directory and create a configuration file.

cd /etc/
vi openssl-3.0.8.conf

Add the following path in the config file.


Save and exit. Reload the dynamic link

ldconfig -v

Step 6 - Configure OpenSSL Binary

Now, we are going to insert the binary of our new version of OpenSSL /usr/local/ssl/bin/openssl and replace the default openssl file.

First, take a backup of existed openssl file.

mv /bin/openssl /bin/openssl.backup

Create new environment files for OpenSSL.

vi /etc/profile.d/

Add the following lines.

export PATH

Save & exit. Make the newly created file executable.

chmod +x /etc/profile.d/

Reload the new OpenSSL environment file and check the default PATH

source /etc/profile.d/
echo $PATH

Now, let’s verify the installation and version of the OpenSSL.

which openssl
openssl version -a

Output will be similar like:

OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)
built on: Sat Mar  4 18:28:32 2023 UTC
platform: linux-x86_64
options:  bn(64,64)
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/ssl/lib64/engines-3"
MODULESDIR: "/usr/local/ssl/lib64/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_ia32cap=0xdefa220b478bffff:0x842421

We have seen, how to install OpenSSL 3 on Ubuntu 22.04. Here is the OpenSSL official manual guide.