# Install Memgraph on Red Hat from RPM package

Install and run Memgraph from a RPM package on: 
  - **Red Hat 9**
  - **Red Hat 10**

> **Warning**
>
> Newer versions of Memgraph might not be backward
> compatible with older versions and you might not be able to load storage
> snapshots between different versions. In that case, please contact the Memgraph
> team and we'll help with the migration as much as possible.

> **Warning**
>
> Red Hat uses SELinux to enforce security policies.
> SELinux (Security-Enhanced Linux) is a security mechanism for implementing mandatory access control (MAC) in the Linux kernel.
> It restricts programs, users, and processes to only the resources they require, following a least-privilege model.
> When deploying Memgraph with high availability (HA), consider checking out this attribute for instance visibility.

## Installation guide

### Download Memgraph RPM Red Hat (CentOS) package

Memgraph ships a single distro-agnostic RPM package per architecture that
installs on any RHEL-family distribution — there are no specifically built
Red Hat packages.

Download the latest Memgraph RPM package from the [Memgraph Download
Hub](https://memgraph.com/download/).

You can also use [direct download
links](https://memgraph.com/docs/getting-started/install-memgraph/direct-download-links) to get the
latest Memgraph packages. 

For example:

```bash
sudo wget https://download.memgraph.com/memgraph/v3.13.0/x86_64-rpm/memgraph-3.13.0_1-1.x86_64.rpm
```

 

> **Note**
>
> For the latest version of Memgraph, replace the version in the download command
> with the one from the [direct download
> links](https://memgraph.com/docs/getting-started/install-memgraph/direct-download-links) page.

### Install Memgraph

After downloading the Memgraph RPM package, you can install it by issuing the
following command:

``` console
sudo dnf install -y ./memgraph-3.13.0_1-1.x86_64.rpm
```

If you run into any troubles while installing Memgraph, contact us on
[Discord](https://discord.gg/memgraph).

### Start Memgraph

After successful installation, Memgraph can be started as a service using the
following command:

```
sudo systemctl start memgraph
```
To verify that Memgraph is running, run the following command:

```
journalctl --unit memgraph
```

If successful, you should receive an output similar to the following:

```
You are running Memgraph vX.X.X
```

If you want the Memgraph database instance to start automatically on each startup, run the
following command:

```
systemctl enable memgraph
```

You can also check the status of the Memgraph database instance by running:
```
systemctl status memgraph
```

#### Troubleshooting

As of Memgraph 3.13, the package installs the Python libraries used by the
bundled query modules — including [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/) and [NetworkX](https://networkx.org/) — automatically
during package installation (the machine needs network access at install
time). If that automatic installation was skipped (`MG_SKIP_PYTHON_DEPS=1`) or
failed, Memgraph reports it with a note like this on startup:

```
You are running Memgraph v3.13.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(...).
```

In that case, install the missing libraries manually as the `memgraph` user
(they must land in the `memgraph` user's environment, since the embedded
interpreter runs as `memgraph`):

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

If you are not interested in working with query modules that depend on these
libraries, you can ignore the warnings.

### Connect to the database

To [query](https://memgraph.com/docs/querying) the database from the console, you need to install
[`mgconsole`](https://memgraph.com/docs/getting-started/cli). 

You can also connect to the database using one of the [client
libraries](https://memgraph.com/docs/client-libraries) or visual-user interface [Memgraph
Lab](https://memgraph.com/docs/data-visualization).

## Stop Memgraph

To shut down the Memgraph server, issue the following command:

```
systemctl stop memgraph
```

## Start Memgraph

Memgraph can be started as a service using the following command:

```
systemctl start memgraph
```

## Configuration

> **Info**
>
> If you're experiencing issues related to the maximum number of memory map areas,
> you can resolve them by [adjusting the `vm.max_map_count`
> parameter](https://memgraph.com/docs/configuration/system-configuration#increasing-memory-map-areas). Keep in
> mind that the linked configuration guide is not written for Red Hat, steps will be
> different, but the goal is the same.

The Memgraph configuration is available in `/etc/memgraph/memgraph.conf`. If the
configuration file is altered, Memgraph needs to be restarted. Check all the
configuration options in the [configuration
settings](https://memgraph.com/docs/database-management/configuration).
