diff --git a/content/install-guides/memgraph-on-arm.md b/content/install-guides/memgraph-on-arm.md index ba1a723fcb..46974382c3 100644 --- a/content/install-guides/memgraph-on-arm.md +++ b/content/install-guides/memgraph-on-arm.md @@ -1,41 +1,40 @@ --- additional_search_terms: - - graph database - - database - - cypher - - graph analytics - - graph algorithms - - docker - - arm64 - - aarch64 - +- graph database +- database +- cypher +- graph analytics +- graph algorithms +- docker +- arm64 +- aarch64 layout: installtoolsall minutes_to_complete: 20 -multi_install: true +multi_install: false multitool_install_part: false official_docs: https://memgraph.com/docs/getting-started/install-memgraph +description: Install Memgraph on Arm Linux using Docker or native aarch64 packages, then verify installation by running Cypher queries with mgconsole. title: Memgraph on Arm tool_install: true weight: 1 -draft: true author: Sabika Tasneem --- -[Memgraph](https://memgraph.com/) is an open-source, in-memory graph database built for real-time streaming and analytical workloads. It is compatible with the [Cypher](https://memgraph.com/docs/querying) query language and the Bolt protocol used by Neo4j drivers, so existing Cypher/Bolt applications can connect without changes. +[Memgraph](https://memgraph.com/) is an open-source, in-memory graph database built for real-time streaming and analytical workloads. It's compatible with the [Cypher](https://memgraph.com/docs/querying) query language and the Bolt protocol used by Neo4j drivers, so existing Cypher/Bolt applications can connect without changes. Memgraph publishes native `aarch64` Linux packages and multi-architecture Docker images, so it runs unmodified on Arm-based hardware. Graph algorithms parallelize well and scale with core count. Arm server instances can offer a lower cost per query than equivalent x86 instances for memory-intensive graph workloads. -This guide covers two installation paths: +In this install guide, you'll learn two installation paths: -- **Docker**: the quickest way to try Memgraph, and the portable option for macOS, Windows, and any Linux distribution. -- **Native Linux packages**: a good choice when Docker is unavailable or not preferred, or when you want to benchmark Memgraph directly on the host. +- Docker: the quickest way to try Memgraph, and the portable option for macOS, Windows, and any Linux distribution. +- Native Linux packages: a good choice when Docker is unavailable or not preferred, or when you want to benchmark Memgraph directly on the host. -At the end of each path, you will run a few Cypher queries with `mgconsole`, then optionally add [MAGE](https://memgraph.com/docs/advanced-algorithms), Memgraph’s graph-algorithm and query-module extension library. +At the end of each path, you'll run a few Cypher queries with `mgconsole`, then optionally add [MAGE](https://memgraph.com/docs/advanced-algorithms), Memgraph’s graph-algorithm and query-module extension library. -## What should I do before installing Memgraph? +## Before you begin Confirm you are using an Arm computer with 64-bit Linux by running: @@ -43,25 +42,25 @@ Confirm you are using an Arm computer with 64-bit Linux by running: uname -m ``` -The output should be: +The output is similar to: ```output aarch64 ``` -If you see a different result, you are not using an Arm computer running 64-bit Linux. +If you see a different result, you aren't using an Arm computer running 64-bit Linux. -## How do I install Memgraph with Docker? +## Install Memgraph with Docker -Docker is the simplest way to run Memgraph on any operating system. The official images on [Docker Hub](https://hub.docker.com/u/memgraph) are multi-arch manifests, so `docker pull` automatically selects the `arm64` variant on Arm hosts. +You can use Docker to run Memgraph on any operating system. The official images on [Docker Hub](https://hub.docker.com/u/memgraph) are multi-arch manifests, so `docker pull` automatically selects the `arm64` variant on Arm hosts. -If Docker is not already installed, follow the [Docker install guide](/install-guides/docker/). +If you've not already installed Docker, follow the steps in the [Docker install guide](/install-guides/docker/) to do so. -### How do I start the Memgraph container? +### Start the Memgraph container {{% notice Note %}} -The following commands use Memgraph version 3.10.1. The same steps work with other versions. Replace the version number in image tags, package filenames, and download URLs with your chosen version. To find the latest release, see the [Memgraph GitHub releases page](https://github.com/memgraph/memgraph/releases). +The commands in this install guide use Memgraph version 3.10.1. The same steps work with other versions. Replace the version number in image tags, package filenames, and download URLs with your chosen version. To find the latest release, see the [Memgraph GitHub releases page](https://github.com/memgraph/memgraph/releases). {{% /notice %}} The core image is `memgraph/memgraph`, which includes the Memgraph database plus the bundled `mgconsole` CLI. Start it with: @@ -81,32 +80,34 @@ To confirm that the Arm image was pulled, inspect it: docker inspect memgraph/memgraph:3.10.1 --format '{{.Architecture}}' ``` -The expected output is: +The output is similar to: ```output arm64 ``` -### Which Docker image should I choose? +### Choose a Docker image + +The following are Docker images that you can choose depending on the Memgraph features that you want to use: | Image | Includes | | --- | --- | -| `memgraph/memgraph` | Memgraph database + `mgconsole` CLI. Start here! | +| `memgraph/memgraph` | Memgraph database + `mgconsole` CLI. | | `memgraph/memgraph-mage` | Memgraph database + `mgconsole` + [MAGE](https://memgraph.com/docs/advanced-algorithms), a library of advanced graph algorithms and query modules. | | `memgraph/mgconsole` | Standalone CLI client. | | `memgraph/lab` | Memgraph Lab web UI. | -Start with `memgraph/memgraph` to get the database itself. If you later want PageRank, community detection, node embeddings, NetworkX integration, or other advanced query modules, see the [MAGE section](#how-do-i-install-the-mage-graph-algorithm-library) below. +Start with `memgraph/memgraph` to get the Memgraph database. If you later want PageRank, community detection, node embeddings, NetworkX integration, or other advanced query modules, see the [MAGE section](#install-the-mage-graph-algorithm-library). -### How do I connect with mgconsole inside the container? +### Connect with mgconsole inside the container -The `memgraph/memgraph:3.10.1` image ships with `mgconsole` already inside the container: +The `memgraph/memgraph:3.10.1` image ships with `mgconsole` already inside the container. Run `mgconsole` in the container: ```bash { target="ubuntu:latest" } docker exec -it memgraph mgconsole ``` -You should see a prompt similar to: +The output is similar to: ```output mgconsole 1.5.2 @@ -116,9 +117,9 @@ Quit the shell by typing Ctrl-D(eof) or :quit memgraph> ``` -Skip to the [example queries](#how-do-i-run-example-cypher-queries) section to try it out. +For example `mgconsole` queries, see the [example queries](#how-do-i-run-example-cypher-queries) section. -## How do I install Memgraph natively on Linux? +## Install Memgraph natively on Linux Memgraph provides native `aarch64` packages for the following distributions: @@ -126,18 +127,18 @@ Memgraph provides native `aarch64` packages for the following distributions: - Debian 12 and Debian 13 - Fedora 42 -Choose the package that matches your distribution from the [Memgraph Download Hub](https://memgraph.com/download). For convenience, direct download URLs for every supported platform are listed in the [direct download links](https://memgraph.com/docs/getting-started/install-memgraph/direct-download-links) page. +Choose the package that matches your distribution from the [Memgraph Download Hub](https://memgraph.com/download). For convenience, you can find direct download URLs for every supported platform on the [direct download links](https://memgraph.com/docs/getting-started/install-memgraph/direct-download-links) page in the Memgraph documentation. {{< tabpane-normal >}} {{< tab header="Ubuntu / Debian" >}} -Download the `arm64` `.deb` package. For Ubuntu 24.04 on Arm: +Download the `arm64` `.deb` package for Ubuntu 24.04 on Arm: ```bash { target="ubuntu:latest" } wget https://download.memgraph.com/memgraph/v3.10.1/ubuntu-24.04-aarch64/memgraph_3.10.1-1_arm64.deb ``` -Before installing, update the package index and install the required dependency: +Before installing Memgraph, update the package index and install the required dependency: ```bash { target="ubuntu:latest" } sudo apt update @@ -165,7 +166,7 @@ Download the Fedora `aarch64` `.rpm`: wget https://download.memgraph.com/memgraph/v3.10.1/fedora-42-aarch64/memgraph-3.10.1_1-1.aarch64.rpm ``` -Install it: +Install the package: ```bash sudo dnf install ./memgraph-3.10.1_1-1.aarch64.rpm @@ -174,15 +175,15 @@ sudo dnf install ./memgraph-3.10.1_1-1.aarch64.rpm {{< /tab >}} {{< /tabpane-normal >}} -### How do I verify Memgraph is running? +### Check that Memgraph is running -The package installs a `systemd` service. Check its status: +The package installs a `systemd` service. Check the status of the service: ```bash { target="ubuntu:latest" } sudo systemctl status memgraph ``` -If it is not already running, start it and enable it on boot: +If it's not already running, start it and enable it on boot: ```bash { target="ubuntu:latest" } sudo systemctl start memgraph @@ -195,17 +196,23 @@ Inspect the startup log to confirm the version: sudo journalctl --unit memgraph --no-pager | head ``` -You should see output similar to: +The output is similar to: ```output You are running Memgraph v3.10.1 ``` -The configuration file lives at `/etc/memgraph/memgraph.conf`. After editing it, restart the service with `sudo systemctl restart memgraph`. The full configuration reference is in the [Memgraph configuration docs](https://memgraph.com/docs/database-management/configuration). +You can find the configuration file at `/etc/memgraph/memgraph.conf`. To fine-tune Memgraph, edit the configuration file. For a full configuration reference, see the [Memgraph configuration docs](https://memgraph.com/docs/database-management/configuration). + +After editing the configuration file, restart the service: -## How do I increase the memory map area limit? +```bash +sudo systemctl restart memgraph +``` -Memgraph allocates many small memory mappings, and on larger graphs the default Linux limit (`vm.max_map_count = 65530`) can be hit. This typically surfaces as a hung transaction, `munmap` errors, or `bad_alloc` crashes. Memgraph recommends roughly one memory map area per 64 KB of system RAM. The full table and background are in the [system configuration docs](https://memgraph.com/docs/database-management/system-configuration#increasing-memory-map-areas). +## Increase the memory map area limit + +Memgraph allocates many small memory mappings. On larger graphs, you can hit the default Linux limit (`vm.max_map_count = 65530`). Hitting the limit usually surfaces as a hung transaction, `munmap` errors, or `bad_alloc` crashes. Memgraph recommends roughly one memory map area per 64 KB of system RAM. For more information, including a list of recommended map count values, see the [system configuration docs](https://memgraph.com/docs/database-management/system-configuration#increasing-memory-map-areas). For an 8–32 GB host, `524288` is the recommended starting value. Set it for the current session: @@ -228,13 +235,13 @@ sysctl vm.max_map_count This setting is applied on the Linux host, so it is relevant for both the native and Docker installs. Docker containers inherit the host's `vm.max_map_count`. -## How do I install mgconsole? +## (Optional) Install mgconsole separately -`mgconsole` is Memgraph’s command-line client for executing Cypher queries. It is already included in the Memgraph Linux packages and in the `memgraph/memgraph:3.10.1` and `memgraph/memgraph-mage:3.10.1` Docker images, so you only need a separate install if you want to run it from a different machine. +`mgconsole` is Memgraph’s command-line client for executing Cypher queries. It is already included in the Memgraph Linux packages, and in the `memgraph/memgraph:3.10.1` and `memgraph/memgraph-mage:3.10.1` Docker images. You need a separate install only if you want to run it from a different machine. To install it standalone, download the binary for your platform from the [Memgraph Download Hub](https://memgraph.com/download#individual), or pull the Docker image. -If Memgraph is installed directly on the host machine, use host networking so the container can reach it on `localhost`: +If you've got Memgraph installed directly on the host machine, use host networking so the container can reach it on `localhost`: ```bash { target="ubuntu:latest" } docker run -it --network host memgraph/mgconsole:latest --host localhost --port 7687 @@ -246,11 +253,11 @@ If Memgraph is running in another container or on a remote host, replace `localh docker run -it memgraph/mgconsole:latest --host --port 7687 ``` -Full `mgconsole` documentation, including all command-line flags, is available in the [CLI docs](https://memgraph.com/docs/getting-started/cli). +For `mgconsole` documentation, including all command-line flags, see the [mgconsole CLI docs](https://memgraph.com/docs/getting-started/cli). -## How do I run example Cypher queries? +## Run example Cypher queries through mgconsole -With Memgraph running either in Docker or as a native service, you can send queries non-interactively through `mgconsole`. +With Memgraph running either in Docker or as a native service, you can verify the installation by sending queries non-interactively through `mgconsole`. {{% notice Note %}} If you installed Memgraph with Docker, replace `mgconsole --host localhost --port 7687` with `sudo docker exec -i memgraph mgconsole` in piped commands, or run `docker exec -it memgraph mgconsole` for an interactive session. @@ -287,7 +294,7 @@ echo "MATCH (n) RETURN count(n) AS node_count;" \ | mgconsole --host localhost --port 7687 ``` -Expected output: +The output is similar to: ```output +------------+ @@ -303,13 +310,13 @@ Clear the graph: echo "MATCH (n) DETACH DELETE n;" | mgconsole --host localhost --port 7687 ``` -Re-running the count confirms the graph is empty: +To confirm the graph is empty, re-run the count: ```bash { target="ubuntu:latest" } echo "MATCH (n) RETURN count(n) AS node_count;" | mgconsole --host localhost --port 7687 ``` -Expected output: +The output is similar to: ```output +------------+ @@ -325,7 +332,7 @@ If you prefer an interactive session, run `mgconsole` without piping input: mgconsole --host localhost --port 7687 ``` -### A quick pattern-matching example +### Pattern-matching example Memgraph’s strength is pattern matching. Try a slightly richer graph: @@ -339,11 +346,11 @@ RETURN DISTINCT friend.name AS friend_of_alice; EOF ``` -This returns everyone reachable from Alice via one or two `KNOWS` hops. +This query returns everyone reachable from Alice in one or two `KNOWS` hops. -## How do I install the MAGE graph-algorithm library? +## (Optional) Install the MAGE graph-algorithm library -[MAGE](https://memgraph.com/docs/advanced-algorithms) is an open-source library that extends Memgraph with advanced graph algorithms and query modules, such as PageRank, community detection, shortest paths, node embeddings, NetworkX integration, and more, all callable from Cypher. MAGE is a separate add-on. If you want these capabilities, install the MAGE variant described below. +[MAGE](https://memgraph.com/docs/advanced-algorithms) is an open-source library that extends Memgraph with advanced graph algorithms and query modules such as PageRank, community detection, shortest paths, node embeddings, NetworkX integration, and more. These algorithms and modules are all callable from Cypher. MAGE is a separate add-on. If you want these capabilities, install the MAGE variant described as follows. ### MAGE with Docker @@ -361,11 +368,11 @@ echo "CALL mg.procedures() YIELD name WITH name WHERE name STARTS WITH 'pagerank | docker exec -i memgraph mgconsole ``` -You should see entries such as `pagerank.get`. +The output includes entries such as `pagerank.get`. ### MAGE with native Linux packages -Memgraph provides a prebuilt MAGE `arm64` `.deb` package for Ubuntu 24.04. It is installed on top of an existing Memgraph package install: +Memgraph provides a prebuilt MAGE `arm64` `.deb` package for Ubuntu 24.04. It's installed on top of an existing Memgraph package install: ```bash { target="ubuntu:latest" } wget https://download.memgraph.com/memgraph-mage/v3.10.1/ubuntu-24.04/memgraph-mage_3.10.1-1_arm64.deb @@ -373,24 +380,22 @@ sudo dpkg -i memgraph-mage_3.10.1-1_arm64.deb sudo systemctl restart memgraph ``` -For other distributions, or to build MAGE from source with custom algorithms, follow the [MAGE install guide](https://memgraph.com/docs/advanced-algorithms/install-mage). +For other distributions, or to build MAGE from source with custom algorithms, see [Install MAGE graph algorithm library](https://memgraph.com/docs/advanced-algorithms/install-mage) in the Memgraph documentation. -### Run a MAGE algorithm +### Verify installation by running a MAGE algorithm -With MAGE loaded, you can call any of its algorithms from Cypher. For example, compute PageRank on the small graph created earlier: +With MAGE loaded, you can call any of its algorithms from Cypher. For example, compute PageRank on the small graph that you created earlier: ```bash { target="ubuntu:latest" } echo "CALL pagerank.get() YIELD node, rank RETURN node, rank ORDER BY rank DESC;" \ | mgconsole --host localhost --port 7687 ``` -The complete algorithm catalog is documented at [Available algorithms](https://memgraph.com/docs/advanced-algorithms/available-algorithms). - -## Where do I go next? +For the complete algorithm catalog, see [Available algorithms](https://memgraph.com/docs/advanced-algorithms/available-algorithms) in the Memgraph documentation. -- Explore the [Cypher query language](https://memgraph.com/docs/querying) and the [Memgraph data model](https://memgraph.com/docs/fundamentals). -- Install the visual [Memgraph Lab](https://memgraph.com/docs/memgraph-lab) for browsing and visualizing graphs. -- Pick a [client library](https://memgraph.com/docs/client-libraries) for Python, Go, Rust, Java, JavaScript, or C#. -- Join the Memgraph community on [Discord](https://discord.gg/memgraph). +## Next steps You are now ready to build and query graphs with Memgraph on Arm. + +Next, you can explore the [Cypher query language](https://memgraph.com/docs/querying) and the [Memgraph data model](https://memgraph.com/docs/fundamentals). You can install the visual [Memgraph Lab](https://memgraph.com/docs/memgraph-lab) for browsing and visualizing graphs, and pick a [client library](https://memgraph.com/docs/client-libraries) for Python, Go, Rust, Java, JavaScript, or C#. You can also join the Memgraph community on [Discord](https://discord.gg/memgraph). +