diff --git a/next.config.mjs b/next.config.mjs index ed2d148c9..c3060996b 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -209,6 +209,36 @@ export default withNextra({ destination: '/getting-started/coding-with-ai/skills.md', permanent: true }, + { + source: '/getting-started/build-memgraph-from-source', + destination: '/getting-started/install-memgraph/build-from-source', + permanent: true + }, + { + source: '/getting-started/build-memgraph-from-source.md', + destination: '/getting-started/install-memgraph/build-from-source.md', + permanent: true + }, + { + source: '/getting-started/packaging-memgraph', + destination: '/getting-started/install-memgraph/packaging', + permanent: true + }, + { + source: '/getting-started/packaging-memgraph.md', + destination: '/getting-started/install-memgraph/packaging.md', + permanent: true + }, + { + source: '/getting-started/first-steps-with-docker', + destination: '/deployment/environments/docker', + permanent: true + }, + { + source: '/getting-started/first-steps-with-docker.md', + destination: '/deployment/environments/docker.md', + permanent: true + }, { source: '/use-cases', destination: '/ai-ecosystem', @@ -2474,7 +2504,7 @@ export default withNextra({ }, { source: '/memgraph/how-to-guides-overview/work-with-docker', - destination: '/getting-started/first-steps-with-docker', + destination: '/deployment/environments/docker', permanent: true }, { @@ -2484,7 +2514,7 @@ export default withNextra({ }, { source: '/memgraph/how-to-work-with-docker', - destination: '/getting-started/first-steps-with-docker', + destination: '/deployment/environments/docker', permanent: true }, { diff --git a/pages/advanced-algorithms/available-algorithms/export_util.mdx b/pages/advanced-algorithms/available-algorithms/export_util.mdx index bc1dac9d5..f00579169 100644 --- a/pages/advanced-algorithms/available-algorithms/export_util.mdx +++ b/pages/advanced-algorithms/available-algorithms/export_util.mdx @@ -84,8 +84,8 @@ The `path` is the path to the JSON file inside the -You can [**copy the exported JSON file to your local file -system**](/getting-started/first-steps-with-docker#copy-files-from-a-docker-container) +You can [copy the exported JSON file to your local file +system](/deployment/environments/docker#copy-files-with-docker-cp) using the [`docker cp`](https://docs.docker.com/engine/reference/commandline/cp/) command. @@ -203,8 +203,8 @@ The `path` is the path to a CSV file inside the -You can [**copy the exported CSV file to your local file -system**](/getting-started/first-steps-with-docker#copy-files-from-a-docker-container) +You can [copy the exported CSV file to your local file +system](/deployment/environments/docker#copy-files-with-docker-cp) using the [`docker cp`](https://docs.docker.com/engine/reference/commandline/cp/) command. @@ -518,8 +518,8 @@ The `path` is the path to the graphML file inside the -You can [**copy the exported file to your local file -system**](/getting-started/first-steps-with-docker#copy-files-from-a-docker-container) +You can [copy the exported file to your local file +system](/deployment/environments/docker#copy-files-with-docker-cp) using the [`docker cp`](https://docs.docker.com/engine/reference/commandline/cp/) command. diff --git a/pages/advanced-algorithms/install-mage.mdx b/pages/advanced-algorithms/install-mage.mdx index 225cff9a7..a49b45502 100644 --- a/pages/advanced-algorithms/install-mage.mdx +++ b/pages/advanced-algorithms/install-mage.mdx @@ -148,7 +148,7 @@ sudo ./environment/os/install_deps.sh install MEMGRAPH_BUILD_DEPS {

Set up the toolchain

} -Download and install the [Memgraph Toolchain](/getting-started/build-memgraph-from-source#about-the-toolchain): +Download and install the [Memgraph Toolchain](/getting-started/install-memgraph/build-from-source#about-the-toolchain): ```bash curl -L https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v8/toolchain-v8-binaries-x86_64.tar.gz -o toolchain.tar.gz sudo tar xzvfm toolchain.tar.gz -C /opt diff --git a/pages/ai-ecosystem/integrations/mcp.mdx b/pages/ai-ecosystem/integrations/mcp.mdx index bbb1fe3ca..1b9da388a 100644 --- a/pages/ai-ecosystem/integrations/mcp.mdx +++ b/pages/ai-ecosystem/integrations/mcp.mdx @@ -119,7 +119,7 @@ docker build -f integrations/mcp-memgraph/Dockerfile -t memgraph/mcp-memgraph:la Publish port 8000 to make the server available at `http://localhost:8000/mcp/`: ```bash -docker run --rm -p 8000:8000 memgraph/mcp-memgraph:latest +docker run --rm -p 8000:8000 --add-host=host.docker.internal:host-gateway memgraph/mcp-memgraph:latest ``` **Stdio mode, for MCP clients that use stdio** @@ -127,13 +127,15 @@ docker run --rm -p 8000:8000 memgraph/mcp-memgraph:latest Configure your MCP host to run the `docker` command and use stdio: ```bash -docker run --rm -i -e MCP_TRANSPORT=stdio memgraph/mcp-memgraph:latest +docker run --rm -i -e MCP_TRANSPORT=stdio --add-host=host.docker.internal:host-gateway memgraph/mcp-memgraph:latest ``` By default, the server connects to Memgraph on the host at - `bolt://host.docker.internal:7687`. To connect to Memgraph on another host or - port, set the environment variables shown below. + `bolt://host.docker.internal:7687`. Docker on Linux resolves + `host.docker.internal` only with the + `--add-host=host.docker.internal:host-gateway` flag used above. To connect to + Memgraph on another host or port, set the environment variables shown below. **Custom Memgraph connection** @@ -196,6 +198,7 @@ When the settings open, enhance the args as follows: "--rm", "-i", "-e", "MCP_TRANSPORT=stdio", + "--add-host=host.docker.internal:host-gateway", "memgraph/mcp-memgraph:latest" ] } diff --git a/pages/data-migration/best-practices.mdx b/pages/data-migration/best-practices.mdx index ee1b9cd90..241074fe8 100644 --- a/pages/data-migration/best-practices.mdx +++ b/pages/data-migration/best-practices.mdx @@ -180,7 +180,7 @@ Assuming that the files have been correctly split, and [Memgraph is running](/getting-started) in `IN_MEMORY_ANALYTICAL` mode, the import process can start. If you're running Memgraph with Docker, you need to first [copy the CSV -files](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) +files](/deployment/environments/docker#share-files-with-the-container) into the container where Memgraph is running. Based on the paths of the files, you can generate the queries, each using a different file from the total pool of files. diff --git a/pages/data-migration/csv.mdx b/pages/data-migration/csv.mdx index aa087aa1d..77c48ca0a 100644 --- a/pages/data-migration/csv.mdx +++ b/pages/data-migration/csv.mdx @@ -70,7 +70,7 @@ LOAD CSV FROM ( WITH CONFIG configsMap=configMap ) ? ( WITH | NO If you are using Docker to run Memgraph, you will need to [copy the files from your local directory into - Docker](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) + Docker](/deployment/environments/docker#share-files-with-the-container) container where Memgraph can access them.
If using `http://`, `https://`, or `ftp://` the CSV file will be fetched over the network. @@ -385,7 +385,7 @@ There are also two variations of the files: files with a header and files withou {

Check the location of the CSV files

} If you are working with Docker, [copy the files from your local directory into - the Docker container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) + the Docker container](/deployment/environments/docker#share-files-with-the-container) so that Memgraph can access them. {

Import nodes

} @@ -611,7 +611,7 @@ of a single label or relationships of a single type. All files have a header. {

Check the location of the CSV files

} If you are working with Docker, [copy the files from your local directory into - the Docker container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) + the Docker container](/deployment/environments/docker#share-files-with-the-container) so that Memgraph can access them. {

Import nodes

} diff --git a/pages/data-migration/cypherl.mdx b/pages/data-migration/cypherl.mdx index 939e6c9c2..0bb115585 100644 --- a/pages/data-migration/cypherl.mdx +++ b/pages/data-migration/cypherl.mdx @@ -50,7 +50,7 @@ the CYPHERL file. If you installed and started Memgraph using **Docker**, follow these steps: 1. Open a new terminal and check the Docker container ID by running `docker ps`. - 2. Copy the `queries.cypherl` [to your Docker container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container). + 2. Copy the `queries.cypherl` [to your Docker container](/deployment/environments/docker#share-files-with-the-container). 3. Run the following command ``` diff --git a/pages/data-migration/data-streams/manage-streams-query.md b/pages/data-migration/data-streams/manage-streams-query.md index 3fbe6c3c6..4692ac122 100644 --- a/pages/data-migration/data-streams/manage-streams-query.md +++ b/pages/data-migration/data-streams/manage-streams-query.md @@ -30,7 +30,7 @@ To create a transformation module, you need to: 3. Load the file into Memgraph either on startup (automatically) or by running a `CALL mg.load_all();` query. -If you are using Docker to run Memgraph, check [how to transfer the file into the container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container). +If you are using Docker to run Memgraph, check [how to transfer the file into the container](/deployment/environments/docker#share-files-with-the-container). If you are using Memgraph Lab you can [create transformation module within the application](/data-migration/data-streams/transformation-modules#creating-transformation-modules-within-memgraph-lab). diff --git a/pages/data-migration/json.mdx b/pages/data-migration/json.mdx index 6ecbf04b2..984725d08 100644 --- a/pages/data-migration/json.mdx +++ b/pages/data-migration/json.mdx @@ -31,7 +31,7 @@ LOAD JSONL FROM ( WITH CONFIG configsMap=configMap ) ? AS - `` Represents an optional configuration map through which you can specify configuration options: `aws_region`, `aws_access_key`, @@ -483,7 +483,7 @@ Let's import data from a file `data.json` with the following content: If you are using Docker to run Memgraph, you will need to [copy the files from your local directory into the -Docker](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) +Docker](/deployment/environments/docker#share-files-with-the-container) container where Memgraph can access them. To create a node with the label `Person` and `first_name`, `last_name` and `pets` diff --git a/pages/data-migration/migrate-memgraph-platform.mdx b/pages/data-migration/migrate-memgraph-platform.mdx index 5dc734fa6..97143d885 100644 --- a/pages/data-migration/migrate-memgraph-platform.mdx +++ b/pages/data-migration/migrate-memgraph-platform.mdx @@ -15,7 +15,7 @@ Starting with version 2.15, the platform has transitioned to a multi-container application. This upgrade separates the previous single Docker image into individual containers for Memgraph+MAGE and Memgraph Lab. -If you are running an older version of Memgraph Platform (versions up to 2.15), +If you are running an older version of Memgraph Platform (versions up to 2.14), you can migrate your data to the newer version of Memgraph MAGE. ## Using a database dump @@ -51,7 +51,7 @@ Memgraph MAGE instance. If you installed and started Memgraph MAGE using **Docker**, follow these steps: 1. Open a new terminal and check the Docker container ID by running `docker ps`. - 2. Copy the `queries.cypherl` [to your Docker container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container). + 2. Copy the `queries.cypherl` [to your Docker container](/deployment/environments/docker#share-files-with-the-container). 3. Run the following command: ``` diff --git a/pages/data-migration/parquet.mdx b/pages/data-migration/parquet.mdx index d9db5c9bc..a94257190 100644 --- a/pages/data-migration/parquet.mdx +++ b/pages/data-migration/parquet.mdx @@ -39,7 +39,7 @@ LOAD PARQUET FROM ( WITH CONFIG configs=configMap ) ? AS - `` Represents an optional configuration map through which you can diff --git a/pages/data-modeling/modeling-guides/model-a-graph-from-csv-file.mdx b/pages/data-modeling/modeling-guides/model-a-graph-from-csv-file.mdx index 18cdcf6a3..ab825be4a 100644 --- a/pages/data-modeling/modeling-guides/model-a-graph-from-csv-file.mdx +++ b/pages/data-modeling/modeling-guides/model-a-graph-from-csv-file.mdx @@ -28,7 +28,7 @@ This guide is designed for: "https://install.memgraph.com" | sh` and for Windows run `iwr https://install.memgraph.com/windows -useb | iex`. Read detailed instructions in the [getting started guide](/getting-started). -- A CSV file containing your data [stored in a running Memgraph container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container). For this guide, we provide a [dummy file with +- A CSV file containing your data [stored in a running Memgraph container](/deployment/environments/docker#share-files-with-the-container). For this guide, we provide a [dummy file with random data](/data/data-modeling/random_data.csv). - Basic knowledge of databases (helpful but not mandatory). @@ -537,7 +537,7 @@ Results: To create the database in Memgraph from the provided dummy data, run the Cypher queries provided below. The prerequisite is to [copy the CSV file into the -container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) +container](/deployment/environments/docker#share-files-with-the-container) where Memgraph is running in the `usr/lib/memgraph` directory.
diff --git a/pages/database-management/ssl-encryption.mdx b/pages/database-management/ssl-encryption.mdx index 2cde461d6..671dbb817 100644 --- a/pages/database-management/ssl-encryption.mdx +++ b/pages/database-management/ssl-encryption.mdx @@ -29,7 +29,7 @@ Certification Authority. Memgraph contains a self-signed testing certificate If you are using Docker and want to use your own certificates, you need to [copy them into a Docker -container](/getting-started/first-steps-with-docker#copy-files-to-a-docker-container) +container](/deployment/environments/docker#share-files-with-the-container) in order to utilize them. ## Configure the server diff --git a/pages/deployment/environments/docker.mdx b/pages/deployment/environments/docker.mdx index 0252dff15..943f5557d 100644 --- a/pages/deployment/environments/docker.mdx +++ b/pages/deployment/environments/docker.mdx @@ -236,14 +236,46 @@ Additionally, here are some useful facts about Docker volumes: straightforward. Docker volumes can be inspected even when the container is down. - -
- -
-
+## Share files with the container + +Memgraph in Docker reads and writes files inside its container. A file on your +machine has to be in the container before `LOAD CSV`, `LOAD PARQUET`, +`LOAD JSONL` or a CYPHERL import can read it, and a file that +[`export_util`](/advanced-algorithms/available-algorithms/export_util) writes +stays in the container until you copy it out. + +### Mount a host folder + +To share a folder with Memgraph, mount it with `-v` when you start the +container. Run this in the folder that holds your files: + +```bash +docker run -p 7687:7687 -p 7444:7444 -v "$(pwd)":/data memgraph/memgraph-mage +``` + +Memgraph then sees the folder as `/data`. Import a file from it with +`LOAD CSV FROM "/data/people.csv" WITH HEADER AS row ...`, and export to it with +`CALL export_util.json("/data/export.json")`; the exported file appears in the +same folder on your machine. On Linux, exports work only if the container's +`memgraph` user (UID 101) can write to the folder. + +Mount the folder at its own path, such as `/data`, not over +`/usr/lib/memgraph`, which holds Memgraph and its query modules. Keep the +database's own data in [named volumes](#persist-data-with-docker-volumes). + +### Copy files with docker cp + +For a one-off file, copy it into or out of a running container with +`docker cp`: + +```bash +docker cp people.csv CONTAINER:/usr/lib/memgraph/people.csv +docker cp CONTAINER:/usr/lib/memgraph/query_modules/export.json export.json +``` + +`CONTAINER` is the container's name or ID, as listed by `docker ps`. After the +first command, Memgraph can read the file as `/usr/lib/memgraph/people.csv`. + ## Backup data diff --git a/pages/getting-started.mdx b/pages/getting-started.mdx index b285ce882..04df0f1ae 100644 --- a/pages/getting-started.mdx +++ b/pages/getting-started.mdx @@ -1,78 +1,116 @@ --- title: Getting started with Memgraph -description: Just beginning with Memgraph? Access our structured guide to set up your environment, learn basic operations, and start utilizing graph computing to its fullest. +description: Set up Memgraph with your coding agent or by hand in Docker, run a first query and a graph algorithm, and find the guide for what you're building. --- -import { Callout } from 'nextra/components' -import { Steps } from 'nextra/components' -import CSharp from '/components/icons/CSharp' -import Cpp from '/components/icons/Cpp' -import Go from '/components/icons/Go' -import Graphql from '/components/icons/Graphql' -import Haskell from '/components/icons/Haskell' -import Java from '/components/icons/Java' -import JavaScript from '/components/icons/JavaScript' -import NodeJS from '/components/icons/NodeJS' -import PHP from '/components/icons/PHP' -import Python from '/components/icons/Python' -import Ruby from '/components/icons/Ruby' -import Rust from '/components/icons/Rust' -import CodeSnippet from '/components/code-snippet/CodeSnippet' import { Tabs } from 'nextra/components' +import CodeSnippet from '/components/code-snippet/CodeSnippet' import {CommunityLinks} from '/components/social-card/CommunityLinks' # Getting started with Memgraph -Get Memgraph up and running on your data by following these installation steps -for **Docker environment**. If you're new to Memgraph or you're in a developing -stage, we recommend [installing Memgraph -Platform](/getting-started#install-memgraph-platform). Besides the database, -you'll also have all the tools you might need to analyze your data, such as -command-line interface [mgconsole](/getting-started/cli), web interface -[Memgraph Lab](/memgraph-lab) and a complete set of algorithms within a -[MAGE](/advanced-algorithms) library running. - -To query data that stays in other databases, such as PostgreSQL, Snowflake or -Neo4j, as a graph without loading it into Memgraph, start with [Memgraph -Zero](/memgraph-zero) instead. - - -**Using a coding agent?** Connect it to the Memgraph docs MCP server so it -answers from the current docs. In Claude Code: - -```bash -claude mcp add --transport http memgraph-docs https://mcp-docs.memgraph.com +Memgraph is a high-performance, in-memory graph database that powers real-time +AI context. Use it as the graph engine for GraphRAG, AI memory and agentic +applications, and for real-time graph analytics. This page gets Memgraph +running and answering a first query, then points you to the guide for what +you're building. + +## Run Memgraph in one command + +With [Docker](https://docs.docker.com/engine/install/) running, this command +starts Memgraph with the [MAGE](/advanced-algorithms) graph algorithms and +[Memgraph Lab](/memgraph-lab), the visual interface: + + + + + + + + + + +Then open Memgraph Lab at `http://localhost:3000`. The +[Quickstart](#quickstart) explains what the command starts and walks you +through a first query and a graph algorithm. + +## Start with your coding agent + +If you work with a coding agent such as Claude Code, Cursor or Codex, paste +this prompt into it. The agent starts Memgraph in Docker, installs the +Memgraph [Agent Skills](/getting-started/coding-with-ai/skills), connects the +[Docs MCP server](/getting-started/coding-with-ai/docs-mcp) and the [Memgraph +MCP server](/ai-ecosystem/integrations/mcp), and runs a first query. You need +Docker running, and Node.js for `npx`. + +```plaintext +Set up Memgraph for this project. Add .md to any Memgraph docs URL to read +the page as Markdown. If a container name or port below (7687, 7444, 8000) +is already in use, leave that container alone: start new containers with +unique names on free ports, use those in every step, and tell me which. + +1. Start Memgraph with MAGE in Docker, then wait until it accepts queries: + docker run -d -p 7687:7687 -p 7444:7444 --name memgraph memgraph/memgraph-mage --schema-info-enabled=true + until echo 'RETURN 1;' | docker exec -i memgraph mgconsole >/dev/null 2>&1; do sleep 1; done +2. Install the Memgraph Agent Skills without prompts, with AGENT set to your + skills CLI agent name (claude-code, cursor, codex): + npx skills add memgraph/skills --skill '*' --agent AGENT --yes +3. Connect the Memgraph docs MCP server at https://mcp-docs.memgraph.com. + In Claude Code: claude mcp add --transport http memgraph-docs https://mcp-docs.memgraph.com + Other clients: https://memgraph.com/docs/getting-started/coding-with-ai/docs-mcp.md +4. Connect the Memgraph MCP server to this Memgraph. Start it with + docker run -d --rm -p 8000:8000 --add-host=host.docker.internal:host-gateway memgraph/mcp-memgraph:latest + (on another Bolt port, add -e MEMGRAPH_URL=bolt://host.docker.internal:PORT) + and add http://localhost:8000/mcp/ as an HTTP MCP server. + Details: https://memgraph.com/docs/ai-ecosystem/integrations/mcp.md +5. Run this query and show me the result table: + echo "CREATE (:Developer {name: 'Ana'})-[:USES]->(:Database {name: 'Memgraph'}); MATCH (d:Developer)-[:USES]->(db:Database) RETURN d.name AS developer, db.name AS database;" | docker exec -i memgraph mgconsole +6. Tell me what you installed, whether I need to start a new session to load + the skills and MCP servers, and suggest next steps for what I'm building. ``` -For Cursor, VS Code and other clients, see [MCP server for -docs](/getting-started/coding-with-ai/docs-mcp). - +You should see the agent report the skills and the two MCP servers it added, +and this result table: + +```plaintext copy=false ++------------+------------+ +| developer | database | ++------------+------------+ +| "Ana" | "Memgraph" | ++------------+------------+ +``` + +Some agents load new skills and MCP servers only in a new session. To set up +one of these tools on its own, or to install the skills as a Claude Code +plugin, see [AI coding assistants](/getting-started/coding-with-ai). + +## What are you building? - -Memgraph Platform is no longer a single-container application. Before (Memgraph -< 2.14), Memgraph Platform was a separate Docker image released on Docker Hub. -This image is no longer supported, because having database service and client -service in the same container is not a good practice. Still, with Memgraph Lab -being released on Docker Hub, it is possible to run Memgraph MAGE and Lab as two -separate services, and in that way, running Memgraph Platform as a -multi-container application with [Docker -Compose](/getting-started/install-memgraph/docker-compose). - +Pick the row that matches your project. GraphRAG and Agentic AI each have a +one-command example that runs in Docker and needs no API key; AI memory +installs with one command. -## Install Memgraph Platform +| You're building | Start here | +| --- | --- | +| GraphRAG: answers grounded in a knowledge graph, not only in similar text | [GraphRAG](/ai-ecosystem/graph-rag), with a [one-command example](/ai-ecosystem/graph-rag#run-the-example) | +| AI memory: a long-term memory your coding agents share across sessions | [AI memory](/ai-ecosystem/ai-memory), installed with [one command](/ai-ecosystem/ai-memory#get-started) | +| Agentic AI: agents that plan by traversing a graph of states and actions | [Agentic AI](/ai-ecosystem/agentic-ai), with a [one-command example](/ai-ecosystem/agentic-ai#run-the-example) | +| Graph analytics: PageRank, community detection, paths and centrality | [Run algorithms](/advanced-algorithms/run-algorithms) and the [available algorithms](/advanced-algorithms/available-algorithms) | +| Graph queries over data that stays in PostgreSQL, ClickHouse, Snowflake or a data lake | [Memgraph Zero](/memgraph-zero), with the [MemGQL quick start](/memgraph-zero/memgql/quick-start) | +| A migration of your data from Neo4j, a relational database or files | [Migrate from Neo4j](/data-migration/migrate-from-neo4j) or [Data migration](/data-migration) | +| An application that queries Memgraph from Python, JavaScript, Java or another language | [Client libraries](/client-libraries) | +| A production deployment | [Installation](/getting-started/install-memgraph) and [Deployment](/deployment) | -If you want to quickly try out **Memgraph Platform** (Memgraph database + MAGE -library + Memgraph Lab) for the first time, do the following: +## Quickstart - +Run Memgraph and [Memgraph Lab](/memgraph-lab), the visual interface, in +Docker, load a sample dataset, and run a query and a graph algorithm on it. +You need [Docker](https://docs.docker.com/engine/install/) installed and +running. -{

Install Docker

} -Ensure [Docker](https://docs.docker.com/engine/install/) is running in the -background. +### 1. Start Memgraph and Memgraph Lab [#install-memgraph-platform] -{

Run Memgraph Platform

} -Depending on your operating system, execute the appropriate command -in the console: +Run the installer for your operating system: @@ -83,115 +121,90 @@ in the console: -The above command runs a script that downloads a [Docker Compose +The script downloads a [Docker Compose file](https://github.com/memgraph/memgraph-platform/blob/main/docker-compose.yml) -to your system, builds and starts `memgraph-mage` and `memgraph-lab` Docker -services in two separate containers. The Docker Compose file is downloaded into -a folder called `memgraph-platform` usually located inside the user folder, e.g. -`/Users/katelatte/memgraph-platform`. You'll see the message during the download -process, similar to: - - ``` - -e Downloading docker compose file to: /Users/katelatte/memgraph-platform/docker-compose.yml - ``` - -To manage the containers with Docker Compose, position yourself into the -`memgraph-platform` folder. Most commonly used commands are `docker compose -start`, `stop`, `down` and `restart`. The running containers can be managed with -Docker as well. To learn how to do that, follow the [First steps with Docker -guide](/getting-started/first-steps-with-docker). -
- -The above installation process is a quick start, but make sure you explore -[other installation options](/getting-started/install-memgraph) and choose the -preferred way of running Memgraph in your environment. - -## Connect to the database - -You can connect to the Memgraph instance using the command-line interface -mgconsole by running the following command in a new terminal: - -```terminal -docker run -it memgraph/mgconsole:latest [--host HOST_IP] [--port PORT] -``` +into a `memgraph-platform` folder in your home directory and starts two +containers: -The arguments `--host` and `--port` are only required if you're running Memgraph on a -remote server or different port. Otherwise, they can be omitted. +- `memgraph-mage`: Memgraph with [MAGE](/advanced-algorithms), the graph + algorithms library, on port `7687` for queries and `7444` for logs. +- `memgraph-lab`: Memgraph Lab on port `3000`. -Alternatively, you can connect to Memgraph using the [Memgraph Lab web -application](/memgraph-lab#quick-start) available on `localhost:3000` or -as a [Desktop app](https://memgraph.com/download#individual). +To stop both containers, run `docker compose stop` in the `memgraph-platform` +folder, and `docker compose start` to start them again. For other +ways to run Memgraph, see [Installation](/getting-started/install-memgraph). -![](/pages/getting-started/lab.png) +### 2. Open Memgraph Lab +Open `http://localhost:3000` in your browser. Lab opens on the **Quick +connect** screen; click **Connect now** to connect to Memgraph: -## Import and query data +![Memgraph Lab Quick connect screen with the Connect now button](/pages/getting-started/lab.png) -As a new user, you'll want to populate your fresh Memgraph installation with -data. The method you choose will largely depend on the format of your data. -Memgraph supports imports from various formats, such as CSV, JSON and using -queries listed in a CYPHERL file. For detailed instructions on migrating your -data, refer to the [data migration documentation](/data-migration). +To query from the terminal instead, run `docker exec -it memgraph-mage +mgconsole`. For other ways to run mgconsole, see [CLI](/getting-started/cli). -If you're just getting started and want a quick setup, Memgraph offers a range -of pre-made datasets ideal for testing and learning. We have prepared more than -20 datasets you can use for testing and learning. If you wish to use a demo -dataset, go to **Datasets** section, chose a dataset and **Load dataset**. +### 3. Load a dataset -![](/pages/getting-started/first-steps/memgraph-lab-datasets.png) +In the Lab sidebar, open **Datasets**, find **Capital cities and borders** and +click **Load dataset**: -Now that the data is imported it is time to run your first Cypher query. Go to -the **Query Execution** section in the sidebar, and then copy-and-paste the -following code into the **Cypher editor**. +![Datasets section in Memgraph Lab, with the Load dataset button on the Capital cities and borders dataset](/pages/getting-started/first-steps/memgraph-lab-datasets.png) -```cypher +### 4. Run a query +Open **Query execution**, paste this query into the **Cypher editor** and +click **Run query**. It returns every pair of connected nodes and the +relationship between them, 738 rows on this dataset: + +```cypher MATCH (n)-[r]-(m) RETURN n, r, m; - ``` -Click **Run query** to run the above query that will return all the nodes and -relationships in the database and see the result in the **Graph results** tab. - -This an example using one of the preloaded datasets: - -![](/pages/getting-started/first-steps/memgraph-lab-first-cypher-query.png) - -If you're transitioning from Neo4j to Memgraph, adapting your existing Cypher -queries is essential. While both platforms use the Cypher query language, there -might be platform-specific features that require adjustments. To assist you, we -provide a [comprehensive documentation](/querying) to help you adapt and -optimize your queries for Memgraph. +The **Graph results** tab draws the capital cities on a world map, connected +by their borders: -To start using Memgraph in your application, use one of the following [client -libraries](/client-libraries) and follow their getting started guide. +![Capital cities and borders dataset in the Graph results tab of Memgraph Lab, drawn as cities on a world map](/pages/getting-started/first-steps/memgraph-lab-first-cypher-query.png) -## Run advanced algorithms +### 5. Run a graph algorithm -Memgraph offers a range of procedures tailored to address specific graph -problems. Built-in deep path traversal algorithms such as BFS, DFS, Weighted -shortest path, All shortest paths, and K shortest paths can be executed using their specific -clauses. - -Memgraph comes with expanded set of algorithms called [Memgraph Advanced Graph -Extensions (MAGE)](/advanced-algorithms) library. MAGE is an open-source -repository housing graph algorithms, both by the Memgraph team and the -community. These are presented as query modules. - -![](/pages/getting-started/first-steps/query-modules.png) - -One of the advanced algorithms at your disposal is the PageRank algorithm. You -can run it with the following code: +Run [PageRank](/advanced-algorithms/available-algorithms/pagerank) with the +`pagerank.get()` procedure from MAGE and return the five highest-ranked +cities: ```cypher - CALL pagerank.get() -YIELD node, rank; +YIELD node, rank +RETURN node.name AS city, rank +ORDER BY rank DESC +LIMIT 5; +``` +The **Data results** tab shows these rows: + +```plaintext copy=false ++--------------+--------------+ +| city | rank | ++--------------+--------------+ +| "Porto-Novo" | 0.0200067 | +| "Gitega" | 0.0184617 | +| "Thimphu" | 0.0140559 | +| "Nur-Sultan" | 0.0140246 | +| "Dodoma" | 0.0139278 | ++--------------+--------------+ ``` -![](/pages/getting-started/first-steps/pagerank-results.png) +For the other algorithms you can run the same way, see +[available algorithms](/advanced-algorithms/available-algorithms). + +## Next steps + +- **Learn Cypher:** see [Querying](/querying). Memgraph is compatible with + Neo4j for most queries; see the [differences in Cypher + implementations](/querying/differences-in-cypher-implementations). +- **Pick your next guide:** see [What are you building?](#what-are-you-building). +If you get stuck, ask on [Discord](https://discord.gg/memgraph). - \ No newline at end of file + diff --git a/pages/getting-started/_meta.ts b/pages/getting-started/_meta.ts index fbd2601ed..11d67e9b5 100644 --- a/pages/getting-started/_meta.ts +++ b/pages/getting-started/_meta.ts @@ -1,8 +1,5 @@ export default { - "install-memgraph": "Install Memgraph", - "cli": "CLI", - "first-steps-with-docker": "First steps with Docker", - "coding-with-ai": "Use an AI coding assistant", - "build-memgraph-from-source": "Build Memgraph from source", - "packaging-memgraph": "Packaging Memgraph" + "coding-with-ai": "AI coding assistants", + "install-memgraph": "Installation", + "cli": "CLI" } diff --git a/pages/getting-started/cli.mdx b/pages/getting-started/cli.mdx index 78455daab..359fe44b9 100644 --- a/pages/getting-started/cli.mdx +++ b/pages/getting-started/cli.mdx @@ -1,50 +1,63 @@ --- title: Command line interface -description: Understand the intricacies of Memgraph's CLI operations with our documentation. We're all for heightened efficiency in graph computing. +description: Install and run mgconsole, Memgraph's command-line client, to run Cypher queries interactively or from scripts, and configure it with flags. --- -import { Callout } from 'nextra/components' import { Steps } from 'nextra/components' import { Tabs } from 'nextra/components' # Command line interface -The easiest way to execute Cypher queries against Memgraph is by using -Memgraph's command-line tool, **mgconsole**. +mgconsole is Memgraph's command-line client. Use it to run Cypher queries +against Memgraph from a terminal, interactively or from a script. -It is available as [Docker image](https://hub.docker.com/r/memgraph/mgconsole) and as a [binary](https://memgraph.com/download#individual) for macOS, and Windows. +mgconsole is included in the `memgraph/memgraph` and `memgraph/memgraph-mage` +Docker images, and is available as a separate [Docker +image](https://hub.docker.com/r/memgraph/mgconsole), as a +[binary](https://memgraph.com/download#individual) for macOS and Windows, and +as source code for Linux. -## Install mgconsole +## Install mgconsole -To install or start `mgconsole` to query a running Memgraph database instance, -use the following steps: +If Memgraph runs in Docker, the quickest way to start mgconsole is inside the +Memgraph container. For a container named `memgraph`: - +```bash +docker exec -it memgraph mgconsole +``` + +To run mgconsole from its own image or from a binary, follow the steps for your +environment: + + -You can use `mgconsole` on any OS from the Docker container. -To connect to a remote Memgraph instance you need to provide the `--host` flag with the IP address or -DNS name of the Memgraph instance and the `--port` flag with the port number, default `7687`. +The `memgraph/mgconsole` image runs on any operating system. Inside its +container, `localhost` is the container itself, so always tell mgconsole where +Memgraph is. -```terminal -docker run -it memgraph/mgconsole:latest [--host HOST] [--port PORT] +To connect to Memgraph on the same machine on macOS or Windows, use +`host.docker.internal`, which Docker Desktop resolves to the host: + +```bash +docker run -it memgraph/mgconsole:latest --host host.docker.internal ``` -If you want to connect to your local Memgraph instance, you can use the following command on Linux host: +On Linux, share the host's network instead: -```terminal -docker run -it memgraph/mgconsole:latest +```bash +docker run -it --network host memgraph/mgconsole:latest ``` -If you are using MacOS or Windows, you can use the following command to start `mgconsole`: +To connect to a remote Memgraph instance, pass its IP address or DNS name and +its port (default `7687`): -```terminal -docker run -it memgraph/mgconsole:latest --host host.docker.internal +```bash +docker run -it memgraph/mgconsole:latest --host HOST --port PORT ``` -On MacOS and Windows, `host.docker.internal` is a special DNS name that resolves to the host machine from a container. -It is necessary to use it to connect to a Memgraph instance running on the host machine. +`HOST` is the address of the Memgraph instance and `PORT` its Bolt port. @@ -59,14 +72,14 @@ Visit the [Download Hub](https://memgraph.com/download#individual) and download From a terminal, start `mgconsole` with the command: -```terminal +```bash ./mgconsole --host HOST --port PORT ``` If Memgraph is running locally using the default configuration, start `mgconsole` with: -```terminal +```bash ./mgconsole --host 127.0.0.1 --port 7687 ``` @@ -80,11 +93,11 @@ with: Visit the [Download Hub](https://memgraph.com/download#individual) and download `mgconsole`. -{

Provide execute permission

} +{

Provide execute permission

} From the terminal, provide the execution permission to the current user: -```terminal +```bash chmod u+x ./mgconsole ``` @@ -92,14 +105,14 @@ chmod u+x ./mgconsole Start mgconsole with the following command: -```terminal +```bash ./mgconsole --host HOST --port PORT ``` If Memgraph is running locally using the default configuration, start mgconsole with: -```terminal +```bash ./mgconsole --host 127.0.0.1 --port 7687 ``` @@ -120,14 +133,14 @@ mgconsole from source. Start mgconsole with the following command: -```terminal +```bash mgconsole --host HOST --port PORT ``` If Memgraph is running locally using the default configuration, start mgconsole with: -```terminal +```bash mgconsole --host 127.0.0.1 --port 7687 ``` @@ -138,9 +151,9 @@ mgconsole --host 127.0.0.1 --port 7687 ## Execute Cypher queries -After the client has started, it should present a command prompt similar to: +When mgconsole starts, it shows a prompt similar to: -``` +```plaintext copy=false mgconsole X.X Connected to 'memgraph://127.0.0.1:7687' Type :help for shell usage @@ -148,27 +161,17 @@ Quit the shell by typing Ctrl-D(eof) or :quit memgraph> ``` -At this point, it is possible to execute Cypher queries against a running -Memgraph database instance. - - - -You can use the `TAB` key to autocomplete commands in `mgconsole`. - - - -If you are new to Cypher, check out [how to query the database](/querying). +Type a Cypher query, end it with `;` and press Enter to run it. Press `TAB` +to autocomplete commands. If you are new to Cypher, see +[Querying](/querying). ### Query execution time -Upon successful execution of a query, Memgraph will return the execution time. - -To get a breakdown of the execution time, set the `-verbose_execution_info` flag -to `true`. +After a query succeeds, mgconsole prints its execution time. To get a +breakdown, start mgconsole with `-verbose_execution_info=true`. The output then +also shows: -It will extend the information about the execution time with the following data: - -```bash +```plaintext copy=false Query COST estimate: 3066 Query PARSING time: 0.000175982 sec Query PLAN EXECUTION time: 0.0154524 sec @@ -177,14 +180,14 @@ Query PLANNING time: 8.054e-05 sec The values show: -- COST estimate - Internal planner estimation on the cost of the query. When comparing two query executions, an order of magnitude larger COST estimates might indicate the query's longer execution time. +- COST estimate - Internal planner estimation on the cost of the query. When comparing two query executions, an order of magnitude larger COST estimates might indicate the query's longer execution time. - PARSING time - Time spent checking if the query is valid and normalizing it for cache. -- PLAN EXECUTION time - Time executing the plan. +- PLAN EXECUTION time - Time executing the plan. - PLANNING time - Time it takes the query planner to create the optimal plan to execute the query. ## Configure mgconsole -Below are configurational flags you can use with mgconsole: +Start mgconsole with these flags to configure it: ### Main @@ -231,24 +234,24 @@ Below are configurational flags you can use with mgconsole: ## Non-interactive mode - + - If you want to use interactive mode with a `mgconsole` in a docker container, use the following command: + Pipe queries into the `memgraph/mgconsole` image. Add the same `--host` flag or `--network host` option as in [Install mgconsole](#install-mgconsole), for example on macOS or Windows: ```bash - echo "MATCH (n:Person) RETURN n;" | docker run -i memgraph/mgconsole:latest + echo "MATCH (n:Person) RETURN n;" | docker run -i memgraph/mgconsole:latest --host host.docker.internal ``` To save the query results in a file, use the following command: ```bash - echo "MATCH (n:Person) RETURN n;" | docker run -i memgraph/mgconsole:latest > results.txt + echo "MATCH (n:Person) RETURN n;" | docker run -i memgraph/mgconsole:latest --host host.docker.internal > results.txt ``` - To get the query result in bash, use the following command: + To get the query result in bash, use the following command: ```bash mgconsole < <(echo "MATCH (n:Person) RETURN n;") ``` @@ -256,7 +259,7 @@ Below are configurational flags you can use with mgconsole: ```bash echo "MATCH (n:Person) RETURN n;" | mgconsole ``` - To save the query results in a file, use the following command: + To save the query results in a file, use the following command: ```bash mgconsole < <(echo "MATCH (n:Person) RETURN n;") > results.txt ``` diff --git a/pages/getting-started/coding-with-ai.mdx b/pages/getting-started/coding-with-ai.mdx index c6ddf0329..7d2dd0fe7 100644 --- a/pages/getting-started/coding-with-ai.mdx +++ b/pages/getting-started/coding-with-ai.mdx @@ -1,16 +1,20 @@ --- -title: Use an AI coding assistant +title: AI coding assistants description: Help AI coding agents such as Claude Code, Cursor and Codex work with Memgraph using Agent Skills, the Docs MCP server, llms.txt and Markdown versions of every docs page. --- import {CommunityLinks} from '/components/social-card/CommunityLinks' -# Use an AI coding assistant +# AI coding assistants AI coding agents such as Claude Code, Cursor and Codex don't know Memgraph well by default. Give them Memgraph-specific knowledge and access to the current docs, so they write correct Cypher and follow Memgraph's recommended practices. +To set up Memgraph, the Agent Skills and both MCP servers in one step, paste +the prompt from [Start with your coding +agent](/getting-started#start-with-your-coding-agent) into your agent. + ## Choose what to give your agent You can combine these, depending on what the agent needs: @@ -19,33 +23,15 @@ You can combine these, depending on what the agent needs: | --- | --- | | Write Cypher, model data and use MAGE correctly, with knowledge it loads when a task needs it | [Agent Skills](/getting-started/coding-with-ai/skills) | | Look up the current docs and answer with sources | [Docs MCP server](/getting-started/coding-with-ai/docs-mcp) | -| Read the docs without installing anything | [`llms.txt` and Markdown pages](#machine-readable-docs) | +| Read the docs without installing anything | [`llms.txt` and Markdown pages](/getting-started/coding-with-ai/llms-txt) | | Query your own Memgraph database | [Memgraph MCP server](/ai-ecosystem/integrations/mcp) | | Remember what it did in earlier sessions | [AI memory](/ai-ecosystem/ai-memory), which records your agent's sessions in Memgraph | ## Machine-readable docs -Agents can read the docs directly, without rendering the website: - -- **`llms.txt`:** [`https://memgraph.com/docs/llms.txt`](/llms.txt) lists the - main pages of each docs section with a one-line description, in the same - order as the sidebar. Reference material that an agent can skip when its - context is short, such as release notes, is grouped under **Optional**. -- **Section `llms.txt` files:** each section has its own `llms.txt` with all - of its pages, for example `https://memgraph.com/docs/querying/llms.txt`. The - root `llms.txt` links to them. -- **Markdown pages:** add `.md` to any docs URL to get the page as Markdown, - for example `https://memgraph.com/docs/querying.md`. Every link in the - `llms.txt` files points at the Markdown version. - -The rest of the Memgraph website has its own index at -[`https://memgraph.com/llms.txt`](https://memgraph.com/llms.txt). - -To point your agent at the docs, add the `llms.txt` URL to its project -instructions, for example `CLAUDE.md`, `AGENTS.md` or Cursor rules: - -```plaintext -Memgraph documentation: https://memgraph.com/docs/llms.txt -``` +Agents can also read the docs without installing anything: every page has a +Markdown version, and `llms.txt` files list them by section. See [llms.txt and +Markdown pages](/getting-started/coding-with-ai/llms-txt) for the URLs and how +to add them to your agent's instructions. diff --git a/pages/getting-started/coding-with-ai/_meta.ts b/pages/getting-started/coding-with-ai/_meta.ts index 23ae42ce1..84cbff7ea 100644 --- a/pages/getting-started/coding-with-ai/_meta.ts +++ b/pages/getting-started/coding-with-ai/_meta.ts @@ -1,4 +1,5 @@ export default { "skills": "Agent Skills", "docs-mcp": "Docs MCP server", + "llms-txt": "llms.txt", } diff --git a/pages/getting-started/coding-with-ai/llms-txt.mdx b/pages/getting-started/coding-with-ai/llms-txt.mdx new file mode 100644 index 000000000..baca2cd4c --- /dev/null +++ b/pages/getting-started/coding-with-ai/llms-txt.mdx @@ -0,0 +1,40 @@ +--- +title: llms.txt and Markdown pages +description: Point AI coding agents at the Memgraph docs through llms.txt indexes and plain Markdown versions of every page, with nothing to install. +--- + +# llms.txt and Markdown pages + +AI coding agents can read the Memgraph docs directly, without rendering the +website and without installing anything. Every docs page has a plain Markdown +version, and `llms.txt` files list those pages so an agent can find the one it +needs. + +## Docs indexes and Markdown pages + +- **`llms.txt`:** [`https://memgraph.com/docs/llms.txt`](/llms.txt) lists the + main pages of each docs section with a one-line description, in the same + order as the sidebar. Reference material that an agent can skip when its + context is short, such as release notes, is grouped under **Optional**. +- **Section `llms.txt` files:** each section has its own `llms.txt` with all + of its pages, for example `https://memgraph.com/docs/querying/llms.txt`. The + root `llms.txt` links to them. +- **Markdown pages:** add `.md` to any docs URL to get the page as Markdown, + for example `https://memgraph.com/docs/querying.md`. Every link in the + `llms.txt` files points at the Markdown version. + +The rest of the Memgraph website has its own index at +[`https://memgraph.com/llms.txt`](https://memgraph.com/llms.txt). + +## Point your agent at the docs + +Add the `llms.txt` URL to your agent's project instructions, for example +`CLAUDE.md`, `AGENTS.md` or Cursor rules: + +```plaintext +Memgraph documentation: https://memgraph.com/docs/llms.txt +``` + +When a task needs Memgraph, the agent can open the index and the Markdown pages +it lists. To let the agent search the docs instead of reading the index, +connect the [Docs MCP server](/getting-started/coding-with-ai/docs-mcp). diff --git a/pages/getting-started/coding-with-ai/skills.mdx b/pages/getting-started/coding-with-ai/skills.mdx index aec3c24e0..891ca65b2 100644 --- a/pages/getting-started/coding-with-ai/skills.mdx +++ b/pages/getting-started/coding-with-ai/skills.mdx @@ -41,6 +41,17 @@ To install a single skill, pass its name: npx skills add memgraph/skills --skill memgraph-cypher-syntax ``` +The command asks which skills and agents to install. To install without +prompts, for example from a script or from inside a coding agent, name the +skills and the agent and pass `--yes`: + +```bash +npx skills add memgraph/skills --skill '*' --agent claude-code --yes +``` + +`'*'` installs all skills. Replace `claude-code` with your agent's name in the +`skills` CLI, such as `cursor` or `codex`. + ### Manual install Clone the repository and symlink the `skills` directory into the location your diff --git a/pages/getting-started/first-steps-with-docker.mdx b/pages/getting-started/first-steps-with-docker.mdx deleted file mode 100644 index 2e26fa2d7..000000000 --- a/pages/getting-started/first-steps-with-docker.mdx +++ /dev/null @@ -1,300 +0,0 @@ ---- -title: First steps with Docker -description: Starting with Docker? Peruse our detailed guide outlining the first steps towards mastering Docker. ---- - -import { Callout } from 'nextra/components' -import { Steps } from 'nextra/components' -import CodeSnippet from '/components/code-snippet/CodeSnippet' -import {CommunityLinks} from '/components/social-card/CommunityLinks' - -# First steps with Docker - -This guide helps you set up [Docker Desktop](https://docs.docker.com/desktop/) -and run Memgraph using Docker images. - - -**Using a coding agent?** Connect it to the Memgraph docs MCP server so it -answers from the current docs. In Claude Code: - -```bash -claude mcp add --transport http memgraph-docs https://mcp-docs.memgraph.com -``` - -For Cursor, VS Code and other clients, see [MCP server for -docs](/getting-started/coding-with-ai/docs-mcp). - - -## Prerequisites - -Before proceeding, ensure Docker Desktop is installed and running on your -system. You can download it from the [official Docker -website](https://www.docker.com/products/docker-desktop/). - -**System requirements:** -- **Windows**: Windows 10/11 64-bit (version 21H2 or higher), WSL2 enabled, - hardware virtualization turned on. -- **MacOS**: One of the three most recent macOS versions, with at least 4GB of - RAM. -- **Linux**: Docker Engine installed (instructions vary per distribution). - - -### Verify Docker installation - -To verify Docker is installed and running: -1. Open Terminal (or Command Prompt). -2. Run: - -``` -docker --version -docker info -``` - -You should see version details and system information. - -### Troubleshoot - -If you encounter any errors or if Docker does not seem to be running: -- Ensure that the Docker Desktop application (for Mac and Windows) is running. -- On Linux, you might need to start the Docker service manually using a command like `sudo service docker start` or `sudo systemctl start docker`, depending on your Linux distribution. - -## Run Memgraph with Docker - -This is a quickstart example to get Memgraph running in Docker. For a more detailed overview, visit the how to [install Memgraph with Docker](/getting-started/install-memgraph/docker) documentation. - - - {

Download the Memgraph Docker image

} - - Use the following command to download an image: - ``` - docker pull memgraph/memgraph - ``` - - or for Memgraph with MAGE: - - ``` - docker pull memgraph/memgraph-mage - ``` - - All Memgraph Docker images are available at [Memgraph's Docker - Hub](https://hub.docker.com/u/memgraph). There you will find exact Docker - image tags you can download and use to install Memgraph with. - - {

Run a container

} - - Start Memgraph using: - - ``` - docker run -p 7687:7687 --name memgraph memgraph/memgraph - ``` - - Common flags: - - `-p 7687:7687`: Publish Bolt protocol port. - - `--name memgraph`: Give your container a friendly name. - - To run Memgraph MAGE with the port for logs exposed: - ``` - docker run -p 7687:7687 -p 7444:7444 --name memgraph-mage memgraph/memgraph-mage - ``` - - {

Run with configuration

} - - The simplest way to apply [configuration - setting](/database-management/configuration) during a single - run, is to pass the configuration flag within the `docker run` command. - For more options, check detailed instructions on [how to change the configuration](/database-management/configuration#changing-configuration). - - Apply configurations inline, for example: - - ``` - docker run -p 7687:7687 memgraph/memgraph --memory-limit=50 --log-level=TRACE - ``` - -
- -## Manage containers - -### Stop a container - - - Stopping a container does **not** delete it. For removal instructions, see - [Delete container](#delete-a-container). - - -To stop a running database instance, use the docker stop command. You’ll need -the container’s [ID](#get-docker-containers-id) or name: - -You can stop multiple containers at once by listing them all in the command. - -``` -docker stop CONTAINER1_ID CONTAINER2_ID CONTAINER3_NAME -``` - -### Start a container - -To restart a stopped container: - -1. List all containers (including stopped ones): - -``` -docker ps -a -``` - -2. Start the container by ID or name: - -``` -docker start -# or -docker start -``` - -### Delete a container - - - Deleting a container is permanent. Make sure to back up any important data - before proceeding. - - -Before deleting a container, ensure it’s stopped. Then use the docker rm command -with the container’s [ID](#get-docker-containers-id) or name: - -``` -docker rm -# or -docker rm -``` - -To remove multiple containers at once: - -``` -docker rm CONTAINER1_ID CONTAINER2_ID CONTAINER3_NAME -``` - -### `docker run` vs `docker start` - -While they might sound similar, `docker run` and `docker start` serve very -different purposes: - -`docker run` — **create & start a new container** -- Initializes a new container from a specified image. -- Pulls the image from Docker Hub if it’s not available locally. -- Often used with custom settings, environment variables, ports, or volume - mounts. -- Suitable when you're launching a container for the first time. - - - **Note**: If you're using the `latest` tag, `docker run` will not - automatically fetch the newest image unless it’s missing locally. To ensure - you're using the most up-to-date version, run `docker pull ` before - `docker run`. - - -``` -docker run [OPTIONS] IMAGE [COMMAND] -``` - -`docker start` — **restart an existing container** -- Reactivates a previously stopped container without changing its configuration. -- Does not create a new container. -- Useful for quickly resuming work with the same container state. - -``` -docker start -``` - -**Key difference**: `docker run` creates a brand-new container. `docker start` -brings an existing one back to life. - -## Inspect and access - -### Get Docker container's ID - -To list all running containers and get their IDs, use: - -``` -docker ps -``` - -You should get an output similar to this: - -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -d44f049fef87 memgraph/memgraph-mage "/usr/lib/memgraph/m…" 8 seconds ago Up 6 seconds 0.0.0.0:7444->7444/tcp, 0.0.0.0:7687->7687/tcp musing_pasteur -``` - -You can use either the full `CONTAINER ID` or a shortened version (e.g., `d44f`) -if it’s unique. - - -### Get Docker container's IP address - -First, retrieve the container’s ID or name. - -Then run: - -``` -docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' -``` - -Example: - -``` -docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' 9397623cd87e -``` - -### Access the file system inside a container - -To browse files inside a container, you’ll need its ID or name. -Run: - -``` -docker exec -it bash -``` - -Once inside the container, you can use standard Linux commands: -- `ls` – list files and directories -- `cd ` – change to a directory -- `cd ..` – go up one directory -- `cat ` – display file contents - - -## File management - -### Copy files from a Docker container - -To copy files from a container to your local machine: -1. First, ensure you know the container’s ID or name. -2. Navigate to the local directory where you want to save the file. -3. Use the following command: - -``` -docker cp : -``` - -**Example**: Copying a configuration file to the Desktop: - -``` -docker cp bb3de2634afe:/etc/memgraph/memgraph.conf memgraph.conf -``` - -This will save `memgraph.conf` in the current directory. - -### Copy files to a Docker container - -To copy a file from your local system into a container: -1. Know the container’s ID or name. -2. Be in the local directory where the file is located. -3. Use the command: -``` -docker cp : -``` - -**Example**: Replacing the configuration file inside the container: - -``` -docker cp memgraph.conf bb3de2634afe:/etc/memgraph/memgraph.conf -``` - -This will overwrite the file inside the container with your local version. - - diff --git a/pages/getting-started/install-memgraph.mdx b/pages/getting-started/install-memgraph.mdx index 533b0f16f..43b7cd89a 100644 --- a/pages/getting-started/install-memgraph.mdx +++ b/pages/getting-started/install-memgraph.mdx @@ -1,104 +1,61 @@ --- title: Install Memgraph -description: Get your Memgraph Platform up and running with our comprehensive installation guide, ensuring a hassle-free setup and quick initiation. +description: Choose how to install Memgraph, with Docker, Docker Compose, Memgraph Cloud, Kubernetes, Linux packages or from source, and check the system requirements. --- -import { Cards } from 'nextra/components' -import CodeSnippet from '/components/code-snippet/CodeSnippet' -import { Steps } from 'nextra/components' import { Callout } from 'nextra/components' # Install Memgraph -Memgraph can be installed on various systems, but the most common way of running -it is using Docker. If you're new to Memgraph we recommend running [Memgraph -Platform](/getting-started#install-memgraph-platform), a multi-container -application. It includes the database and all the tools you might need to -analyze your data, such as command-line interface -[mgconsole](/getting-started/cli), web interface [Memgraph -Lab](/memgraph-lab) and a complete set of algorithms within a -[MAGE](/advanced-algorithms) library. - - -Memgraph Platform is no longer a single-container application. Before (Memgraph -< 2.14), Memgraph Platform was a separate Docker image released on Docker Hub. -This image is no longer supported, because having database service and client -service in the same container is not a good practice. Still, with Memgraph Lab -being released on Docker Hub, it is possible to run Memgraph MAGE and Lab as two -separate services, and in that way, running Memgraph Platform as a -multi-container application with [Docker -Compose](/getting-started/install-memgraph/docker-compose). - - -For a quick start, please follow the [Getting started guide](/getting-started). +Memgraph runs in Docker, on Kubernetes, in Memgraph Cloud and as a native Linux +package. To try it on your machine first, follow the +[quickstart](/getting-started#quickstart), which starts Memgraph with +[MAGE](/advanced-algorithms) and [Memgraph Lab](/memgraph-lab) in Docker. ## Installation options -The quick start will accelerate your first steps with Memgraph. If you plan on -using Memgraph for your project, it's best to familiarize yourself with the -installation options and pick the preferred one. +Pick the option that matches where Memgraph will run: + +- [Docker](/getting-started/install-memgraph/docker) or [Docker + Compose](/getting-started/install-memgraph/docker-compose): development, and + production on a single machine. Use the `memgraph/memgraph-mage` image unless + you need the slim `memgraph/memgraph` image without graph algorithms. +- [Memgraph Cloud](/getting-started/install-memgraph/memgraph-cloud): a managed + instance. +- [Kubernetes](/getting-started/install-memgraph/kubernetes): standalone or + high-availability deployments with Helm charts. +- [Linux](/getting-started/install-memgraph/linux): a native install from the + DEB or RPM package, or on Windows through + [WSL](/getting-started/install-memgraph/wsl). The package files are also on + [Direct download links](/getting-started/install-memgraph/direct-download-links). +- [Source build](/getting-started/install-memgraph/build-from-source) and + [Packaging](/getting-started/install-memgraph/packaging): compile Memgraph + yourself or build your own `.deb` or `.rpm` package. -As of version 3.13, the native Linux packages are **distro-agnostic**: there is -a single `.deb` package for all Debian-family distributions and a single -`.rpm` package for all RHEL-family distributions, per architecture. Any Linux -with glibc 2.31 or newer is supported. [Install Memgraph on -Linux](/getting-started/install-memgraph/linux) covers both packages and how to -check your glibc version. - -Memgraph requires **Python 3.10 or newer** on the host (used by Python query -modules and the auth/SSO modules). Memgraph binds to the host's Python at -runtime, so any installed version from 3.10 upwards works; on distributions -whose default `python3` is older (e.g. CentOS 9 with 3.9), the package installs -and uses a newer interpreter automatically. Docker images ship a suitable -Python already. +Since Memgraph 3.13, there is one `.deb` package and one `.rpm` package per +architecture. They run on any Linux distribution with glibc 2.31 or newer. +[Install Memgraph on Linux](/getting-started/install-memgraph/linux) covers both +packages and how to check your glibc version. - - - - - - - - - - +Before you run Memgraph, check the [system configuration +guidelines](/database-management/system-configuration), especially the +`vm.max_map_count` parameter. +## System requirements +Native Linux packages run on any Linux with glibc 2.31 or newer: Debian 12+, +Ubuntu 22.04+, RHEL, CentOS and Rocky 9+, and Fedora 42+. -You don't want to bother with installation? Done! - -Register and run a [Memgraph Cloud](https://memgraph.com/cloud) instance with a -2-week trial period. - -### System configuration - -Before running Memgraph, please check the [system configuration guidelines](/database-management/system-configuration), especially the -`vm.max_map_count` parameter setting. - -## System requirements +Memgraph requires **Python 3.10 or newer** on the host, for Python query modules +and the auth and SSO modules. Memgraph uses the host's Python at runtime, so any +version from 3.10 up works. On distributions whose default `python3` is older +(such as CentOS 9 with 3.9), the package installs and uses a newer interpreter. +Docker images already include a suitable Python. -Below are minimum and recommended system requirements for installing Memgraph. +The minimum and recommended hardware: | | Minimum | Recommended | | ------------------ | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | @@ -111,11 +68,12 @@ Below are minimum and recommended system requirements for installing Memgraph. The disk is used for storing database [durability files](/fundamentals/data-durability), including snapshots and write-ahead -logs. By default, Memgraph stores the **three most recent snapshots** in the database (this can be configured using the `--storage-snapshot-retention-count` flag). -Snapshots size is usually less than the amount of RAM that is needed to load the data into memory. +logs. By default, Memgraph keeps the **three most recent snapshots**; set the +`--storage-snapshot-retention-count` flag to change that. A snapshot is +usually smaller than the RAM needed to load the same data into memory. -The number of CPU cores required depends on your specific use case. For horizontal scalability, you can increase the number of -available cores on your system for additional scalability. +The number of CPU cores you need depends on your workload. More cores let +Memgraph run more queries in parallel. -Check out how the [storage memory](/fundamentals/storage-memory-usage) is used, -and calculate memory requirements based on your data. +To size RAM for your data, see [storage memory +usage](/fundamentals/storage-memory-usage). diff --git a/pages/getting-started/install-memgraph/_meta.ts b/pages/getting-started/install-memgraph/_meta.ts index d6a31e3ec..b0c5181ec 100644 --- a/pages/getting-started/install-memgraph/_meta.ts +++ b/pages/getting-started/install-memgraph/_meta.ts @@ -1,9 +1,11 @@ export default { "docker": "Docker", - "linux": "Linux", - "memgraph-cloud": "Memgraph Cloud", "docker-compose": "Docker Compose", + "memgraph-cloud": "Memgraph Cloud", "kubernetes": "Kubernetes", + "linux": "Linux", "wsl": "WSL", - "direct-download-links": "Direct download links" -} \ No newline at end of file + "direct-download-links": "Direct download links", + "build-from-source": "Source build", + "packaging": "Packaging" +} diff --git a/pages/getting-started/build-memgraph-from-source.mdx b/pages/getting-started/install-memgraph/build-from-source.mdx similarity index 65% rename from pages/getting-started/build-memgraph-from-source.mdx rename to pages/getting-started/install-memgraph/build-from-source.mdx index 943e24b7b..0dd38951f 100644 --- a/pages/getting-started/build-memgraph-from-source.mdx +++ b/pages/getting-started/install-memgraph/build-from-source.mdx @@ -1,40 +1,27 @@ --- title: Build Memgraph from source -description: This is a comprehensive guide for compiling Memgraph from source. It includes setting up the necessary toolchain, compiling the code, and running Memgraph. +description: Compile Memgraph from source with Memgraph's toolchain, using the build.sh script, conan and cmake, or a Docker build container. --- import { Callout } from 'nextra/components' -import { Steps } from 'nextra/components' - # Build Memgraph from source -Follow this guide if you want to compile Memgraph from source. There are three -self-contained ways to build — pick one: +Compile Memgraph from source with Memgraph's own toolchain. There are three +self-contained ways to build; pick one: 1. [Using the `build.sh` script](#build-with-buildsh) (recommended) 2. [Manually with `conan` and `cmake`](#build-with-conan-and-cmake) (advanced) -3. [Using Docker](#build-with-docker) (ideal for unsupported systems) - - +3. [Using Docker](#build-with-docker) (for systems the other two methods don't support) -Memgraph uses `git` for source version control. You will need to install `git` -on your machine before you can download the source code. - - - - - -If you are using Mac M1 or above, please check our [MacOS Lima Compilation -Guide](https://www.notion.so/MacOS-Lima-Compilation-Guide-eae1e9dcef5740579c5a41075b8f499b?pvs=21) +On a Mac with Apple silicon, follow the [macOS Lima compilation +guide](https://www.notion.so/MacOS-Lima-Compilation-Guide-eae1e9dcef5740579c5a41075b8f499b) first. - +To build a `.deb` or `.rpm` package after the build, see [Package +Memgraph](/getting-started/install-memgraph/packaging). -Please see the [Packaging Memgraph](/getting-started/packaging-memgraph) guide for -information on how to build a Memgraph package for a Linux distribution. - -In every case, start by cloning the source code: +In every case, install `git` and clone the source code: ```bash git clone git@github.com:memgraph/memgraph.git @@ -43,8 +30,8 @@ cd memgraph ## About the toolchain -Memgraph is compiled with its own toolchain (currently **v8**: GCC 16.2, LLVM -22.1.8, CMake 4.4.1 and supporting tools). As of v8, the toolchain bundles its +Memgraph is compiled with its own toolchain (**v8**: GCC 16.2, LLVM +22.1.8, CMake 4.4.1 and supporting tools). Since v8, the toolchain bundles its own sysroot and is **distro-agnostic** — a single archive per architecture that works on any Linux with glibc 2.31 or newer: @@ -57,7 +44,7 @@ for how the toolchain itself is built. ## Build with `build.sh` -The easiest way to build Memgraph directly on a compatible host system. +Build Memgraph directly on a compatible Linux host. ```bash # Install system packages: toolchain runtime deps + Memgraph build deps @@ -92,13 +79,13 @@ Useful variations: ./build.sh --target memgraph -DMG_ENABLE_TESTING=OFF ``` -The resulting binary will be in the `build/` directory. +The build writes the binary to the `build/` directory. - + -- `build.sh` requires Python 3.10 or newer. On distros whose default `python3` - is older (e.g. CentOS 9), install a newer one (e.g. `python3.12`) — the script - finds it automatically, or set `MG_PYTHON` to point at it. +- `build.sh` requires Python 3.10 or newer. On distributions whose default + `python3` is older (such as CentOS 9), install a newer one (such as + `python3.12`). The script finds it, or you can set `MG_PYTHON` to its path. - If the toolchain lives somewhere other than `/opt/toolchain-v8`, set the `MG_TOOLCHAIN_ROOT` environment variable to its location. @@ -106,7 +93,7 @@ The resulting binary will be in the `build/` directory. ## Build with `conan` and `cmake` -The same operations `build.sh` performs, but with direct control over each +This runs the same steps as `build.sh`, with direct control over each step. Complete the system-package and toolchain steps first: ```bash @@ -148,8 +135,7 @@ cmake --build --preset conan-release --target memgraph -j$(nproc) ## Build with Docker -Builds inside Memgraph's own `mgbuild` images — nothing but Docker is needed on -the host, so this works on any system. +Build inside Memgraph's own `mgbuild` images. The host needs only Docker. ```bash export OS="ubuntu-24.04" @@ -175,19 +161,21 @@ docker exec -i mgbuild_v8_$OS bash -c "cd /home/mg/memgraph && ./build/memgraph" ## Run Memgraph -After the compilation, verify that Memgraph works: +After the build, check that Memgraph runs: ```bash ./build/memgraph --version ``` -The unit tests can be run using: +Run the unit tests: ```bash ctest -R unit -j$(nproc) ``` -Or in Docker: +To run them in Docker, pass your Enterprise license and organization name +from the `MEMGRAPH_ENTERPRISE_LICENSE` and `MEMGRAPH_ORGANIZATION_NAME` +environment variables: ```bash ./release/package/mgbuild.sh \ @@ -201,23 +189,15 @@ Or in Docker: ## Troubleshoot -When build errors occur, there are some common issues that can be resolved by the following steps: +If the build fails, try these steps in order: 1. Remove the `build` directory and run the build again. - -2. Re-run `conan install`: libraries used in the build may have been changed in -`conanfile.py`. Unexpected linking errors can be caused by this. - -3. Reinstall `conan_config`. As the list of supported Linux distributions and -architectures evolves, and the libraries used in the build may change, the -configuration may need to be updated to account for specific build issues on -some platforms. - -4. Reinstall host dependencies, as these may sometimes change. - -5. Renaming or removing the conan cache directory (usually `~/.conan2`) in order -to rebuild the libraries and build tools from scratch can help to resolve build -issues. - -6. Open an issue on our [GitHub -repository](https://github.com/memgraph/memgraph/issues) with the error message. +2. Run `conan install` again. The libraries in `conanfile.py` may have changed, + which causes unexpected linking errors. +3. Reinstall `conan_config`. The build configuration changes as supported + distributions, architectures and libraries change. +4. Reinstall the host dependencies, which also change over time. +5. Rename or remove the conan cache directory (usually `~/.conan2`) to rebuild + the libraries and build tools from scratch. +6. Open an issue on [GitHub](https://github.com/memgraph/memgraph/issues) with + the error message. diff --git a/pages/getting-started/install-memgraph/packaging.mdx b/pages/getting-started/install-memgraph/packaging.mdx new file mode 100644 index 000000000..d6818a769 --- /dev/null +++ b/pages/getting-started/install-memgraph/packaging.mdx @@ -0,0 +1,187 @@ +--- +title: Package Memgraph +description: Build Memgraph .deb and .rpm packages from source with the mgbuild.sh script, the package.sh script or CPack. +--- + +import { Callout } from 'nextra/components' + +# Package Memgraph + +Build a `.deb` or `.rpm` package of Memgraph from source. There are three ways +to do it: + +- [With `mgbuild.sh`](#package-with-mgbuildsh), which builds and packages + Memgraph in a Docker container (recommended). +- [With `package.sh`](#package-with-packagesh), which packages a local build + directory. +- [With CPack](#package-with-cpack), which you run by hand. + + +Since Memgraph 3.13, the packages are **distro-agnostic**: one `.deb` (all +Debian-family distributions) and one `.rpm` (all RHEL-family distributions) per +architecture, running on any Linux with glibc 2.31 or newer. + + +## Package with `mgbuild.sh` + +The `mgbuild.sh` script builds Memgraph in a Docker container. Before you +package Memgraph, [build it with +Docker](/getting-started/install-memgraph/build-from-source#build-with-docker). + +The `OS` variable only selects the Docker build environment, not the target +distribution. The build environments are `centos-9`, `centos-10`, `debian-12`, +`debian-13`, `fedora-42`, `fedora-43`, `rocky-10`, `ubuntu-22.04`, +`ubuntu-24.04` and `ubuntu-26.04`. + +With the same environment variables you exported for the build, build the +package: + +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os "$OS" \ + --arch $ARCH \ + --build-type $BUILD_TYPE \ + package-memgraph +``` + +Copy the package out of the container: + +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os "$OS" \ + --arch $ARCH \ + copy \ + --package \ + --dest-dir output +``` + +Stop the container: + +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os "$OS" \ + --arch $ARCH \ + stop --remove +``` + +The package is in the `output` directory. Install it with `apt` or `dnf`, +depending on the distribution. For example, on Ubuntu 24.04: + +```bash +sudo apt install ./output/PACKAGE_FILE.deb +``` + +`PACKAGE_FILE` is the name of the `.deb` file in the `output` directory, +named `memgraph_VERSION_ARCH.deb`. + +### Build a Docker image from the package + +On Ubuntu 24.04, you can also turn the package into a Docker image. First, +build a custom OpenSSL package: + +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os "$OS" \ + --arch $ARCH \ + build-ssl \ + --version "3.5.4" +``` + +Then create an Ubuntu-based Docker image: + +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os "$OS" \ + --arch $ARCH \ + --build-type $BUILD_TYPE \ + package-docker \ + --src-dir output \ + --dest-dir docker-output +``` + +The command writes a Docker image archive to the `docker-output` directory. +Load it into Docker: + +```bash +docker load -i docker-output/IMAGE_ARCHIVE.tar.gz +``` + +`IMAGE_ARCHIVE` is the name of the archive in `docker-output`. `docker load` +prints the name and tag of the loaded image. Run it: + +```bash +docker run -p 7687:7687 -p 7444:7444 --name memgraph memgraph/memgraph:IMAGE_TAG +``` + +`IMAGE_TAG` is the tag that `docker load` printed. + +## Package with `package.sh` + +After you build Memgraph with +[`build.sh`](/getting-started/install-memgraph/build-from-source#build-with-buildsh) +or with [`conan` and +`cmake`](/getting-started/install-memgraph/build-from-source#build-with-conan-and-cmake), +the `package.sh` script in the repository root packages the build directory on +the host. It takes a target and a package format: + +```bash +source /opt/toolchain-v8/activate +./package.sh memgraph deb +``` + +- The target is `memgraph` (the `memgraph` and `memgraph-debuginfo` packages), + `mage` (the `memgraph-mage` package, plus `memgraph-mage-debuginfo` when the + build used `--split-debug`) or `all` (everything the build was configured + for). +- The format is `deb` or `rpm`. + +For example, to package the MAGE query modules as an RPM from a +`./build.sh --mage only` build: + +```bash +./package.sh mage rpm +``` + +The script checks that the build directory is configured for the requested +target (packaging `mage` requires a build with `--mage on` or `--mage only`), +selects the right CPack components and checks that it produced the expected +number of packages. It writes the packages to `build/output/`. To package from +another build directory, pass `--build-dir DIR`, where `DIR` is the path to +that directory. + +## Package with CPack + +`package.sh` is a wrapper around CPack. For full control, run CPack yourself. + +Create the output directory: + +```bash +mkdir -p build/output && cd build/output +``` + +Activate the toolchain: + +```bash +source /opt/toolchain-v8/activate +``` + +Build the package for your distribution family: + +- RPM-based distributions: + + ```bash + cpack -G RPM --config ../CPackConfig.cmake + ``` + +- DEB-based distributions: + + ```bash + cpack -G DEB --config ../CPackConfig.cmake + ``` + +Install the package with `apt` or `dnf`. diff --git a/pages/getting-started/packaging-memgraph.mdx b/pages/getting-started/packaging-memgraph.mdx deleted file mode 100644 index b66a2fcb0..000000000 --- a/pages/getting-started/packaging-memgraph.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -title: Packaging Memgraph -description: This guide will show you how to package Memgraph for a Linux distribution. ---- - -import { Callout } from 'nextra/components' -import { Steps } from 'nextra/components' - -# Package Memgraph - -This guide will show you how to package Memgraph as a `.deb` or `.rpm` package. -There are three main ways to package Memgraph: - -- [Using the `mgbuild.sh` script](#using-the-mgbuildsh-script), which builds Memgraph in a Docker container. (Recommended) -- [Using the `package.sh` script](#using-the-packagesh-script), which packages a local build directory. -- [Using CPack](#using-cpack), which invokes CPack manually. - - - As of version 3.13 the produced packages are **distro-agnostic**: one `.deb` - (all Debian-family distributions) and one `.rpm` (all RHEL-family - distributions) per architecture, running on any Linux with glibc 2.31 or - newer. The `OS` value below only selects the Docker **build environment**, - not the target distribution. Available build environments: `centos-9`, - `centos-10`, `debian-12`, `debian-13`, `fedora-42`, `fedora-43`, - `rocky-10`, `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-26.04`. - - -## Using the `mgbuild.sh` script - -The `mgbuild.sh` script is a convenience script that builds Memgraph in a Docker container. Prior to -packaging Memgraph, [you need to build it first](/getting-started/build-memgraph-from-source#build-with-docker). - -Using the same export environment variables as in the -[build-memgraph-from-source](/getting-started/build-memgraph-from-source#build-with-docker) guide, run the -`mgbuild.sh` script by running the following command to build the package: - -```bash -./release/package/mgbuild.sh \ - --toolchain $TOOLCHAIN \ - --os "$OS" \ - --arch $ARCH \ - --build-type $BUILD_TYPE \ - package-memgraph -``` - -Then it can be copied out of the container: - -```bash -./release/package/mgbuild.sh \ - --toolchain $TOOLCHAIN \ - --os "$OS" \ - --arch $ARCH \ - copy \ - --package \ - --dest-dir output -``` - -Stop the container: - -```bash -./release/package/mgbuild.sh \ - --toolchain $TOOLCHAIN \ - --os "$OS" \ - --arch $ARCH \ - stop --remove -``` - -Now, the package can be found in the `output` directory and it can be installed using `apt` or -`dnf`, depending on the distribution. For example, for Ubuntu 24.04: - -```bash -sudo apt install ./output/memgraph__.deb -``` - - - For Ubuntu 24.04, the package can also be used to create a Docker image. To do this, we must first - build a custom OpenSSL package: - - ```bash - ./release/package/mgbuild.sh \ - --toolchain $TOOLCHAIN \ - --os "$OS" \ - --arch $ARCH \ - build-ssl \ - --version "3.5.4" - ``` - - The following command will then create an Ubuntu-based Docker image: - - ```bash - ./release/package/mgbuild.sh \ - --toolchain $TOOLCHAIN \ - --os "$OS" \ - --arch $ARCH \ - --build-type $BUILD_TYPE \ - package-docker \ - --src-dir output \ - --dest-dir docker-output - ``` - - resulting in a Docker image tarball in the `docker-output` directory. This can then be loaded - into Docker using the `docker load` command. - - ```bash - docker load -i docker-output/memgraph--docker.tar.gz - ``` - - The image can then be run using the `docker run` command. - - ```bash - docker run -p 7687:7687 -p 7444:7444 --name memgraph memgraph/memgraph: - ``` - - - -## Using the `package.sh` script - -After following the build instructions using -[`build.sh`](/getting-started/build-memgraph-from-source#build-with-buildsh), or -[`conan` and `cmake`](/getting-started/build-memgraph-from-source#build-with-conan-and-cmake), the -`package.sh` script in the repository root packages the build directory directly on the host. -It takes a target and a package format: - -```bash -source /opt/toolchain-v8/activate -./package.sh memgraph deb -``` - -- `TARGET` is one of `memgraph` (the `memgraph` + `memgraph-debuginfo` packages), `mage` - (the `memgraph-mage` package, plus `memgraph-mage-debuginfo` when the build used - `--split-debug`), or `all` (everything the build was configured for). -- `FORMAT` is `deb` or `rpm`. - -For example, to package the MAGE query modules as an RPM from a -`./build.sh --mage only` build: - -```bash -./package.sh mage rpm -``` - -The script checks that the build directory is actually configured for the requested target -(e.g. packaging `mage` requires a build with `--mage on` or `--mage only`), selects the right -CPack components, and verifies the expected number of packages was produced. The packages are -written to `build/output/`. Use `--build-dir DIR` to package from a non-default build -directory. - -## Using CPack - -`package.sh` is a thin wrapper around CPack — if you need full control, you can also invoke -CPack manually. - -Prior to packaging, create the output directory: - -```bash -mkdir -p build/output && cd build/output -``` - -Activate the toolchain: - -```bash -source /opt/toolchain-v8/activate -``` - -Then run the following commands to build the package, depending upon the distibution: - -- For RPM-based distributions: - -```bash -cpack -G RPM --config ../CPackConfig.cmake -``` - -- For DEB-based distributions: - -```bash -cpack -G DEB --config ../CPackConfig.cmake -``` - -Once built, the packages can be installed using `apt` or `dnf`. diff --git a/pages/querying/clauses/load-parquet.mdx b/pages/querying/clauses/load-parquet.mdx index 15c6a3e56..c535823f8 100644 --- a/pages/querying/clauses/load-parquet.mdx +++ b/pages/querying/clauses/load-parquet.mdx @@ -23,7 +23,7 @@ LOAD PARQUET FROM ( WITH CONFIG configs=configMap ) ? AS * `` Represents an optional configuration map through which you can diff --git a/pages/release-notes.mdx b/pages/release-notes.mdx index 351a02034..9ecda4e17 100644 --- a/pages/release-notes.mdx +++ b/pages/release-notes.mdx @@ -1684,7 +1684,7 @@ guide. [#3999](https://github.com/memgraph/memgraph/pull/3999) - Most third-party build dependencies are now managed through Conan 2 packages, making builds more reproducible and the contributor setup easier. See the - updated [build-from-source guide](/getting-started/build-memgraph-from-source) + updated [build-from-source guide](/getting-started/install-memgraph/build-from-source) for changes to the build workflow. [#4002](https://github.com/memgraph/memgraph/pull/4002) - Additional third-party libraries (gflags, NuRaft, Pulsar client, RocksDB, diff --git a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-desktop.png b/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-desktop.png deleted file mode 100644 index cfdd8b343..000000000 Binary files a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-desktop.png and /dev/null differ diff --git a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-install.png b/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-install.png deleted file mode 100644 index 13782817e..000000000 Binary files a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-install.png and /dev/null differ diff --git a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-mac.png b/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-mac.png deleted file mode 100644 index 8c87f9494..000000000 Binary files a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-mac.png and /dev/null differ diff --git a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-settings.png b/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-settings.png deleted file mode 100644 index 206350e56..000000000 Binary files a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-settings.png and /dev/null differ diff --git a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-terms.png b/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-terms.png deleted file mode 100644 index 8b83f4159..000000000 Binary files a/public/pages/getting-started/first-steps-with-docker/first-steps-with-docker-terms.png and /dev/null differ diff --git a/public/pages/getting-started/first-steps/pagerank-results.png b/public/pages/getting-started/first-steps/pagerank-results.png deleted file mode 100644 index 81170b7a9..000000000 Binary files a/public/pages/getting-started/first-steps/pagerank-results.png and /dev/null differ diff --git a/public/pages/getting-started/first-steps/query-modules.png b/public/pages/getting-started/first-steps/query-modules.png deleted file mode 100644 index 0a01e02a8..000000000 Binary files a/public/pages/getting-started/first-steps/query-modules.png and /dev/null differ