Install Memgraph on Linux

Install Memgraph natively on Linux from a DEB or RPM package and run it as a systemd service. Since Memgraph 3.13, there is one DEB package and one RPM package per architecture (x86_64 and ARM64), not one per distribution. They run on any Linux distribution with glibc 2.31 or newer.

Distribution familyPackage
Debian, Ubuntu and other distributions that use aptDEB
Red Hat Enterprise Linux, CentOS, Rocky Linux, Fedora and other distributions that use dnfRPM

To check your glibc version, run:

ldd --version

The packages also need Python 3.10 or newer on the host. On distributions whose default python3 is older, such as CentOS 9, the package installs and uses a newer Python interpreter.

To install on Windows, see Install Memgraph on Windows with WSL. To run Memgraph in a container, see Docker.

⚠️

Storage snapshots from one Memgraph version might not load in another. Before you install a newer version over an existing one, follow Upgrades.

Install the DEB package on Debian or Ubuntu

Download the DEB package, then install it with apt.

Download the DEB package

Download the package from the Memgraph Download Hub or with a link from direct download links. For example, the x86_64 package:

wget https://download.memgraph.com/memgraph/v3.14.0/x86_64-deb/memgraph_3.14.0-1_amd64.deb

For the ARM64 package, the system allocator build or a newer version, take the link from direct download links and use its file name in the next step.

Install the DEB package

Install the package with apt, which also installs its dependencies:

sudo apt install ./memgraph_3.14.0-1_amd64.deb

If sudo isn’t installed, see sudo is not installed on Debian.

When the package is installed, configure the system.

Install the RPM package on CentOS, Fedora, Rocky Linux or Red Hat

Download the RPM package, then install it with dnf.

Download the RPM package

Download the package from the Memgraph Download Hub or with a link from direct download links. For example, the x86_64 package:

wget https://download.memgraph.com/memgraph/v3.14.0/x86_64-rpm/memgraph-3.14.0_1-1.x86_64.rpm

For the ARM64 (aarch64) package, the system allocator build or a newer version, take the link from direct download links and use its file name in the next step.

Install the RPM package

Install the package with dnf:

sudo dnf install -y ./memgraph-3.14.0_1-1.x86_64.rpm

On Red Hat Enterprise Linux, SELinux can block Memgraph’s access to system resources. See SELinux blocks Memgraph.

When the package is installed, configure the system.

Configure the system

The default limits on most Linux distributions are too low for Memgraph. Check two of them before you load data:

  • Open files (nofile): Memgraph uses a file descriptor for each client connection and for its storage files. The packaged systemd service sets LimitNOFILE=1048576. If you run Memgraph without systemd, raise the limit yourself, as Handle numerous open files simultaneously describes.
  • Memory map areas (vm.max_map_count): large workloads can run out of them. Increase the vm.max_map_count parameter to the recommended value for your machine’s memory.

For the other settings, see System configuration.

Start Memgraph

Start Memgraph as a service. If it’s already running, the command does nothing:

sudo systemctl start memgraph

To check that Memgraph is running, read its log:

sudo journalctl --unit memgraph

The log contains a line like this:

You are running Memgraph vX.X.X

To check the state of the service:

sudo systemctl status memgraph

To start Memgraph automatically when the machine boots:

sudo systemctl enable memgraph

On a system without systemd, run Memgraph as the memgraph user:

sudo -u memgraph /usr/lib/memgraph/memgraph

Connect to Memgraph

To run queries from the terminal, install mgconsole. You can also connect with one of the client libraries or with Memgraph Lab, the visual user interface.

Configure Memgraph

The configuration file is /etc/memgraph/memgraph.conf. For all options, see Configuration. Memgraph reads the file on startup, so restart it after you change the file:

sudo systemctl restart memgraph

Stop Memgraph

sudo systemctl stop memgraph

Troubleshooting

The problems below can come up during or after installation. If yours isn’t listed, ask on Discord.

sudo is not installed on Debian

If Debian reports the following error:

-bash: sudo: command not found

install sudo as the root user:

apt update -y
apt install sudo -y

Python libraries for query modules are missing

Since Memgraph 3.13, the package installs the Python libraries that the bundled query modules use, including NumPy, SciPy and NetworkX, during installation. The machine needs network access at install time.

If that step was skipped (MG_SKIP_PYTHON_DEPS=1) or failed, Memgraph prints a note like this on startup:

You are running Memgraph v3.14.0
To get started with Memgraph, visit https://memgr.ph/start
NOTE: Please install networkx, numpy, scipy to be able to use proxied NetworkX algorithms. E.g., CALL nxalg.pagerank(...).

Install the libraries as the memgraph user, because Memgraph’s embedded Python interpreter runs as that user and only sees its environment:

sudo runuser -l memgraph -c 'python3 -m pip install --user networkx numpy scipy'

If you don’t use the query modules that need these libraries, you can ignore the note.

SELinux blocks Memgraph

Red Hat Enterprise Linux uses SELinux (Security-Enhanced Linux) to enforce mandatory access control: each program can reach only the resources its policy allows. In a high availability deployment, check the SELinux policies if the instances can’t see each other. Even with the firewall open, you might need to disable SELinux, as the networking configuration best practices describe.