Getting started with Memgraph
Get Memgraph up and running on your data by following these installation steps.
Download and install Memgraph
If you're new to Memgraph or you're in a developing stage, we recommend using the Memgraph Platform. Besides the database, it also includes all the tools you might need to analyze your data, such as command-line interface mgconsole, web interface Memgraph Lab and a complete set of algorithms within a MAGE library.
Install Memgraph Platform
Ensure Docker (opens in a new tab) is running in the background. Depending on your operating system, execute the appropriate command in the console.
These installation scripts use a pre-prepared docker-compose.yml
file. You can
download it from
https://github.com/memgraph/memgraph-platform (opens in a new tab).
Feel free to modify it according to your
needs, and then run it using Docker
Compose.
Linux and macOS
Open a terminal window on your machine.
Execute the following command:
curl https://install.memgraph.com | sh
This command downloads the installation script from Memgraph's website and runs it, installing the latest version of Memgraph on your Linux or macOS system.
Windows
Open a PowerShell terminal on your machine.
Execute the following command:
iwr https://windows.memgraph.com | iex
This command uses PowerShell's Invoke-WebRequest
(iwr
) cmdlet to fetch the
installation script from Memgraph's website and executes it, installing the
latest version of Memgraph on your Windows system.
To gracefully stop and remove all running Memgraph containers managed by Docker
Compose, place yourself in the terminal in the directory containing your docker-compose.yml
file and run the following command:
docker-compose down
To restart the same instance, ensure you are in the directory containing your
docker-compose.yml
file and run:
docker-compose up
Other Installation Options
Besides the Memgraph Platform, you have other setup options. Use the
memgraph-mage
Docker image to combine the database with the graph library, or
opt for the memgraph
image if you prefer a database-only configuration.
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:
docker exec -it memgraph mgconsole
When the mgconsole starts, you can query the database:
C:\Users\Vlasta>docker exec -it memgraph mgconsole
mgconsole 1.3
Connected to 'memgraph://127.0.0.1:7687'
Type :help for shell usage
Quit the shell by typing Ctrl-D(eof) or :quit
memgraph>
Alternatively, you can connect to Memgraph using the Memgraph Lab web
application available within the
memgraph-platform
Docker image by visiting localhost:3000
.
Install a client library
To start using Memgraph in your application, use one of the following client libraries and follow their getting started guide.
Import data
You can migrate your data from an existing graph or SQL database using CSV or JSON files, and import data using queries within a CYPHERL file.
Next steps
You can query Memgraph using Cypher query language, use algorithms available in Memgraph's MAGE library on your graph, and explore visualizations and query your data using Memgraph Lab.
Memgraph's office hours
Schedule a 30 min session with one of our engineers to discuss how Memgraph fits with your architecture. Our engineers are highly experienced in helping companies of all sizes to integrate and get the most out of Memgraph in their projects. Talk to us about data modeling, optimizing queries, defining infrastructure requirements or migrating from your existing graph database. No nonsense or sales pitch, just tech.