OpenSSL is a widely used open-source toolkit for SSL/TLS. On Ubuntu it lets you manage SSL certificates, generate keys and CSRs, and enable encrypted communication. This guide shows you how to install OpenSSL on Ubuntu (via the package manager, from source, or in Docker) and how to fix common issues.
Quick answer
OpenSSL is pre-installed on most Ubuntu systems.
Check with:
openssl version
To install or update it, run:
sudo apt update
followed by:
sudo apt install openssl
Before you start
- Sudo access: a user with sudo (or root) privileges to install software.
- An internet connection: to download packages from the Ubuntu repositories.
- Build tools: only if you plan to compile from source (covered in Method 2).
First, check whether OpenSSL is already installed:
openssl version
If it is installed, you will see output similar to OpenSSL 3.0.13 30 Jan 2024 (the exact version depends on your Ubuntu release; for example, Ubuntu 24.04 LTS ships OpenSSL 3.0.x).
Method 1: Install with apt (recommended)
This is the easiest method and gives you the version maintained in the official Ubuntu repositories (with backported security fixes).
- Open the Terminal (Ctrl + Alt + T, or search for “Terminal”).
- Update the package list and install OpenSSL:
sudo apt update
sudo apt install openssl
The apt-get equivalents, sudo apt-get update and sudo apt-get install openssl, work too.
To upgrade an existing installation to the latest packaged version, run:
sudo apt upgrade openssl
Confirm the result with openssl version.
Method 2: Compile from source (specific version)
Compile from source when you need a specific version or custom build options. First install the build tools:
sudo apt install build-essential
Next, download a stable OpenSSL release (use a numbered release, not the development branch). Then extract and build it. Replace 3.5.6 with the current version:
tar -xzvf openssl-3.5.6.tar.gz
cd openssl-3.5.6
./config
make
make test
sudo make install
By default the files install under /usr/local (for example /usr/local/bin and /usr/local/lib). Use the –prefix option with ./config to choose a different location.
Two cautions: if you clone from GitHub (git clone https://github.com/openssl/openssl.git) you get the development branch. Check out a release tag such as openssl-3.5.6 for a stable build. And sudo make install can shadow the system OpenSSL, so prefer Method 1 unless you specifically need a source build.
Method 3: Use Docker (isolated)
To keep OpenSSL isolated in a container, start an Ubuntu container on your host:
docker run --rm -it ubuntu bash
Then, inside the container shell, install OpenSSL:
apt update
apt install -y openssl
Common issues and troubleshooting
- Package not found: confirm the package name and refresh the list. You can search with
apt-cache search openssl, then run sudo apt update and try again. - Dependency errors: apt normally resolves these; if not, install the named dependency with
sudo apt install <package_name>. - Permission errors: make sure you prefix install commands with sudo.
- Corrupted package cache: clear it and reinstall:
sudo apt clean
- Firewall or proxy: if downloads stall, check that your network settings allow apt to reach the repositories.
Frequently Asked Questions
Yes, in almost all cases. OpenSSL ships as part of the base Ubuntu system, so it is usually already present. Run openssl version to confirm; if it is missing, install it with sudo apt install openssl.
Run sudo apt update and then sudo apt upgrade openssl. This installs the latest version available in your Ubuntu release’s repositories, including backported security patches.
It depends on the Ubuntu release. Recent LTS versions (such as 22.04 and 24.04) ship the OpenSSL 3.0 series. Run openssl version to see exactly what your system has.
The repositories only carry the version packaged for your release, so to get a specific version you compile from source (Method 2): download that version’s release tarball, then run ./config, make, make test, and sudo make install.
Bottom line
For most users, sudo apt install openssl is all it takes to install OpenSSL on Ubuntu, while compiling from source or using Docker covers version-specific and isolated setups. Whichever method you choose, keep OpenSSL updated and verify it with openssl version. To go further, see common OpenSSL commands or how to check your OpenSSL version.
Save 10% on SSL Certificates when ordering from SSL Dragon today!
Fast issuance, strong encryption, 99.99% browser trust, dedicated support, and 25-day money-back guarantee. Coupon code: SAVE10

