Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

On Ubuntu 24.04 (Noble), a source installation of Redis consists of installing the compiler toolchain, downloading a specific Redis release archive, compiling it, checking the resulting binaries, and then choosing whether to run them from the build directory or install them under /usr/local/bin. The core build needs only a C compiler and libc; TLS, bundled modules, and systemd integration add their own development dependencies and build options.

The commands below follow Redis’s Noble workflow and keep the release, configuration file, data directory, and service definition explicit. That matters because a source build is independent of Ubuntu’s package-managed Redis service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decide whether a source build is the right installation

Compiling from source is useful when you need a particular Redis release, a compile-time option, TLS support, or bundled modules that are not available in the distribution package you would otherwise use. You also control where the binaries are installed and can keep the exact source tree used for an upgrade or rollback.

A package or container is usually less work when your priority is routine security updates and an already-integrated service. A source build makes you responsible for tracking releases, rebuilding when security fixes arrive, maintaining the configuration and data paths, and writing or adapting the systemd unit.

Decision point Source build Ubuntu package or container
Release selection Choose the exact upstream tag and compile flags. Usually constrained by the package repository or image tag.
Security updates You must monitor Redis releases, rebuild, and redeploy. Package or image maintenance can be incorporated into the normal update process.
Reproducibility High when you retain the archive, checksum, compiler choices, and build notes. Depends on repository metadata or the image digest you pin.
Service integration You create the account, directories, permissions, unit, and restart policy. Often supplied by the package or image tooling.
TLS and modules Build the required options deliberately. Use whatever options the package or image maintainer enabled.
Operational ownership Your team owns paths under /usr/local, configuration, logs, and data. Paths and lifecycle are defined by the packaging or image convention.

Prepare Ubuntu 24.04

Confirm the machine and release plan

  • Use an Ubuntu 24.04 Noble system with administrative access through sudo.
  • Choose the Redis release before compiling. Record its tag, archive checksum, compiler options, installation prefix, configuration path, and data directory.
  • Provide enough disk space for the archive, extracted source, compiler intermediates, and the Redis data you intend to retain. Keep the source directory after installation if you need a traceable rollback.
  • Make sure outbound access to the Redis source host is available, or transfer the archive through an approved internal process.

Install the dependencies used by the Noble workflow

Redis’s Ubuntu 24.04 instructions use the following broad dependency set. It covers the compiler, C library headers, OpenSSL development files, build systems, Python tooling, and utilities used by the full build:

sudo apt-get update
sudo apt-get install -y --no-install-recommends 
  ca-certificates wget dpkg-dev gcc g++ libc6-dev libssl-dev make git cmake 
  python3 python3-pip python3-venv python3-dev unzip rsync clang automake autoconf libtool

For a plain core build, Redis documents that there are no dependencies beyond a C compiler and libc. Installing the complete Noble list is the repeatable choice when you may enable TLS, modules, or the other targets used by the Ubuntu guide. The --no-install-recommends option avoids pulling in optional packages that are not required by that command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Select, download, and verify a Redis release

Choose the archive

Redis publishes source releases as Git tags. Select the release from the upstream Redis GitHub project, then use the matching .tar.gz archive. The documented URL pattern is:

https://github.com/redis/redis/archive/refs/tags/<version>.tar.gz

Replace <version> with the exact tag you selected; do not type the angle brackets. Work in /usr/src so the source is kept separate from the eventual runtime data:

cd /usr/src
wget -O redis-<version>.tar.gz https://github.com/redis/redis/archive/refs/tags/<version>.tar.gz
tar xvf redis-<version>.tar.gz
rm redis-<version>.tar.gz
cd /usr/src/redis-<version>

If you prefer a shell variable, quote the archive filename and URL after substituting a real tag. Quoting prevents a tag or path from being split by the shell.

Check the archive digest

When possible, compare the downloaded archive with the digest published in Redis’s redis-hashes repository. Calculate the local value before extraction with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sha256sum redis-<version>.tar.gz

Compare that output with the entry for the same release and filename. A mismatch means the archive should not be built; download it again or investigate the transfer path. Record the verified digest with your build notes so a later rebuild uses the same source.

Compile Redis

Core build

From the extracted release directory, the simplest build is:

make

This produces the Redis server and command-line client in the source tree, normally under src. A successful build is not yet an installation: no system-wide binary or systemd unit is created until you deliberately perform those steps.

TLS support

TLS is a compile-time capability. The Ubuntu dependency command installs libssl-dev, the Debian/Ubuntu OpenSSL development package Redis names for this purpose. Build with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
make BUILD_TLS=yes

Building TLS support does not automatically secure a running server. At runtime, the configuration must specify the certificate, key, trust material, and client-authentication policy appropriate for your deployment. Test the resulting binaries and configuration together rather than assuming that a successful compile means TLS is enabled for every connection.

Bundled modules and the full Noble build

For the all-data-structures build shown in Redis’s Ubuntu 24.04 procedure, set the build variables and compile all targets in parallel:

export BUILD_TLS=yes
export BUILD_WITH_MODULES=yes
export INSTALL_RUST_TOOLCHAIN=yes
make -j "$(nproc)" all

BUILD_WITH_MODULES=yes asks the build to include the modules supplied by that Redis release. INSTALL_RUST_TOOLCHAIN=yes permits the build to install the Rust toolchain needed by targets that require it. The first full build can therefore take longer and consume more disk space than the core path.

If you need only modules, only TLS, or neither, set just the relevant option and use the target documented by the selected release. Keep the flags in your build record; compiling once with one set of options and later installing a different set from the same directory can leave you unsure which features the binaries contain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Systemd-aware compilation

Compiling Redis does not create a service, and a normal build does not necessarily include systemd notification support. Redis’s build documentation states that systemd support requires a systemd development library such as libsystemd-dev on Debian or Ubuntu plus the corresponding build flag.

If you need native systemd supervision, install the development library before rebuilding:

sudo apt-get install -y libsystemd-dev

The exact option name is release-dependent. Redis Makefiles commonly expose a USE_SYSTEMD option, but you should confirm the selected release’s README or Makefile before using it. Do not assume that installing libsystemd-dev alone changes an already-built binary.

Verify the build before installing it

Run the binaries directly from the source tree so you test the files you just compiled, not an older package or an earlier installation in your PATH:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
./src/redis-server --version
./src/redis-cli --version

Check that both commands report the release you selected and that the expected feature flags are present where the release displays them. If either executable is missing, return to the build output and correct the failed target before installing anything.

Start Redis from the source tree

Use the configuration shipped with the exact release

Redis’s configuration filename changes across releases. The Ubuntu 24.04 guide states: before Redis 8.10, specify redis-full.conf instead of redis.conf for the full build. Redis 8.10 and later use the filename documented by that release. Always inspect the files in the source tree and use the one shipped with the exact tag you compiled; do not copy a configuration from another release without reviewing its directives.

Launch and test a foreground server

From the source directory, start the server with the appropriate configuration filename:

./src/redis-server redis.conf

For a release before Redis 8.10, substitute redis-full.conf:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
./src/redis-server redis-full.conf

These commands keep the process attached to the terminal. In a second terminal, use the matching client from the same source tree:

./src/redis-cli ping

A reachable local server returns PONG. This confirms that the client can connect to the server’s configured local endpoint. Stop the foreground process with the normal interrupt signal after testing; a production service should use a deliberate service account and lifecycle policy instead of an interactive shell.

Check common runtime prerequisites

  • Make sure the configured port is free. A package-managed Redis instance or another application can already be listening on the same port.
  • Use a configuration whose data directory exists and is writable by the account that will run Redis.
  • Do not expose a newly compiled instance beyond the intended network boundary until authentication, protected mode, bind addresses, and TLS policy have been reviewed.
  • Use the client built from the same release while diagnosing a source build; this avoids accidentally testing a different protocol or feature set from another installation.

Install the compiled binaries

When the source-tree test is successful, install the binaries with:

sudo make install

The documented default prefix places executables in /usr/local/bin. The Redis repository also documents an explicit prefix form:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo make install PREFIX=/usr/local

Use one prefix consistently. Installing with a different prefix from the one your service unit references is a common cause of a service that starts an older binary or fails with “file not found.” After installation, inspect the resolved command and version:

command -v redis-server
/usr/local/bin/redis-server --version
/usr/local/bin/redis-cli --version

If command -v returns another path, your shell’s PATH order is hiding the source-built executable. Use the absolute path while configuring the service, or adjust the account’s environment deliberately.

The installation step copies binaries and built modules; it does not automatically move your configuration, create a data directory, create a service account, or register a systemd unit. Keep the source directory and release notes so you can reproduce the installation. To remove files placed by an explicit /usr/local installation, the repository documents:

sudo make uninstall PREFIX=/usr/local

That removal command does not erase configuration, data, logs, or a unit file that you created separately. Handle those items only after confirming they belong to the source installation you intend to remove.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the source build as a systemd service

Starting redis-server from a shell is not service integration. A source build is separate from Ubuntu’s package-managed unit, so do not copy assumptions from /lib/systemd/system/redis-server.service without checking every path and option.

Choose the service contract

Before writing a unit, decide:

  • the unprivileged service account and group;
  • the absolute path to the installed server, normally /usr/local/bin/redis-server;
  • the configuration file that belongs to the compiled release;
  • the data, log, and runtime directories;
  • ownership and mode bits for those directories and for any TLS keys;
  • the restart behavior and the stop procedure;
  • whether the binary was compiled with systemd support or should run as a simple foreground process.

Use paths that match your own filesystem policy. For example, a deployment might keep configuration under /etc/redis-src and data under /var/lib/redis-src; those are choices, not defaults imposed by the source build.

Create ownership and permissions deliberately

Create a dedicated account rather than running a network-facing database as root. Create the selected configuration and data directories, assign them to that account, and make private key files readable only by the account and administrators. The account must be able to read the configuration and write the directories required by the persistence settings you enable.

Write a unit that points at the source installation

A minimal foreground-service pattern looks like this; replace the account, paths, and configuration filename with the values you selected:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[Unit]
Description=Redis built from source
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=redis-src
Group=redis-src
ExecStart=/usr/local/bin/redis-server /etc/redis-src/redis.conf
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Keep daemonization disabled in the Redis configuration when using Type=simple; systemd must remain the parent supervisor. If you compiled systemd support and your release documents notification mode, you can instead use the release’s prescribed supervision option and matching unit type. Do not add --supervised systemd to a binary that was not built and configured for it.

Load, start, and inspect the unit

sudo systemctl daemon-reload
sudo systemctl enable --now redis-src.service
sudo systemctl status redis-src.service
sudo journalctl -u redis-src.service -e

Use systemctl status for the immediate exit reason and journalctl for the complete startup log. If the unit starts an unexpected version, check the absolute ExecStart path. If it exits with a permission error, check every parent directory, the data path, and the permissions on TLS material. If it fails because the port is occupied, stop the other listener or choose a deliberate alternate port in the configuration.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Enable TLS and modules at runtime

TLS

BUILD_TLS=yes makes TLS-capable code available in the executable; it does not select certificates or force clients to use encrypted connections. Configure the certificate and key paths in the release’s configuration file, protect the key with restrictive permissions, and test with a client invocation appropriate to the TLS settings. Keep the OpenSSL development package installed for any future rebuild of the same feature set.

Modules

BUILD_WITH_MODULES=yes builds the modules included by the selected Redis release. A module still has to be loaded according to that release’s configuration syntax, commonly by a loadmodule directive pointing to the installed module file. Record which module files were built and where they were installed; a service running under a different account or prefix will fail if it cannot read them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Upgrade, rollback, and maintenance practices

  1. Monitor the Redis release notes and select a new tag deliberately.
  2. Download and verify the new archive, retaining the old archive or source tree until the upgrade is accepted.
  3. Reproduce the original compiler flags, including TLS, modules, Rust, and systemd choices.
  4. Build and run the new tree’s version checks before stopping the current service.
  5. Schedule a controlled stop, install the new binaries, and confirm that the unit’s absolute paths still point to the intended files.
  6. Start the service and test connectivity, persistence behavior, TLS, and each required module.
  7. If validation fails, stop the service, restore the previous binaries or prefix, and use the retained source tree and configuration to roll back.

Because make install writes into the chosen prefix, installing a new release over the same path changes what future service starts will execute. Keep a record of the installed version and checksum rather than relying on a directory name that may later be deleted.

Troubleshoot the most common failures

Symptom Likely cause Action
gcc, header, or linker errors during make The compiler, libc headers, or another development package is missing. Run the Noble dependency command again, read the first missing-header or missing-library message, and rebuild.
TLS targets fail to compile or link libssl-dev is absent or the build was not invoked with TLS enabled. Install libssl-dev and rebuild with BUILD_TLS=yes.
Module targets fail, especially Rust-related targets The module build was not requested or the required toolchain was not installed. Use BUILD_WITH_MODULES=yes and, for the full Noble workflow, INSTALL_RUST_TOOLCHAIN=yes; inspect the release’s build output for any additional requirement.
The server cannot find the configuration file The filename differs by release or the command is running from another directory. Use the configuration shipped with the exact source tree; before Redis 8.10, the full-build file is redis-full.conf rather than redis.conf.
redis-cli ping reports connection refused The server did not start, is listening on another address or port, or the client is using the wrong endpoint. Read the server terminal or journal, check the configured bind and port, and run the matching client with the same endpoint.
The service starts an old Redis version The unit or shell resolves a package binary instead of the /usr/local installation. Use an absolute ExecStart path and verify it with /usr/local/bin/redis-server --version.
systemd reports permission denied The service account cannot read the configuration, keys, modules, or write the data directory. Correct ownership and mode bits on every path; do not solve a data-directory permission problem by running Redis as root.
The unit exits immediately after launch The configuration daemonizes, the supervision mode does not match the unit, or the port is already occupied. Use foreground operation with Type=simple, or configure the release’s documented systemd supervision mode, then inspect journalctl.

Final installation checklist

  • Ubuntu 24.04 dependencies were installed and the source archive was verified against the matching digest when available.
  • The source release tag, compiler flags, and installation prefix are recorded.
  • redis-server --version and redis-cli --version report the intended build.
  • The configuration filename matches the release, including the pre-8.10 redis-full.conf distinction.
  • A local ping test returned PONG before service integration.
  • TLS and module requirements were enabled at compile time and configured at runtime where needed.
  • The service account, data directory, permissions, unit file, restart policy, and absolute binary path are explicit.
  • The source tree, checksum, configuration, and rollback version are retained for future maintenance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.