Skip to main content
Version: 2.3.1

Install Memgraph Platform on Linux with Docker

This article briefly outlines the basic steps necessary to install and run Memgraph on Linux with Docker.

Memgraph Platform contains:

  • MemgraphDB - the database that holds your data
  • Memgraph Lab - visual user interface for running queries and visualizing graph data
  • mgconsole - command-line interface for running queries
  • MAGE - graph algorithms and modules library
caution

Newer versions of Memgraph are currently not backward compatible with older versions. That is why you won't be able to load storage snapshots between different versions.

Prerequisites

  • Docker Desktop - Memgraph Platform can be installed only with Docker.
    Instructions on how to install Docker can be found on the official Docker website.
info

Memgraph's Docker image was built with Docker version 1.12 and should be compatible with all newer versions.

Install and start Memgraph Platform

Open a terminal and use the following command:

docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -v mg_lib:/var/lib/memgraph memgraph/memgraph-platform

If successful, you should see a message similar to the following:

mgconsole X.X
Connected to 'memgraph://127.0.0.1:7687'
Type :help for shell usage
Quit the shell by typing Ctrl-D(eof) or :quit
memgraph>

Command-line tool mgconsole is open in the terminal, and the visual user interface Memgraph Lab is available at http://localhost:3000.

User either mgconsole, Memgraph Lab or various drivers to connect to MemgraphDB.

Stop Memgraph Platform

To stop a Memgraph database instance, run the following command:

docker stop CONTAINER_NAME

You can find the name of the container (CONTAINER_NAME) by running the following command in a new terminal:

docker ps

Configuration file and logs

If you need to access the Memgraph configuration file or logs, you will need to specify the following volumes when starting Memgraph:

docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -e MEMGRAPH="--log-level=TRACE" \
-v mg_lib:/var/lib/memgraph \
-v mg_log:/var/log/memgraph \
-v mg_etc:/etc/memgraph \
memgraph/memgraph-platform

The configuration file is located in the mg_etc volume. The exact location of the file depends on your specific setup, but usually it is /var/lib/docker/volumes/mg_etc/_data/memgraph.conf.

The logs will be saved to the mg_log volume, and the directories can usually be found in /var/lib/docker/volumes/.

When using Docker, you can also specify the configuration options in the docker run command:

docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -e MEMGRAPH="--log-level=TRACE" memgraph/memgraph-platform
caution

When working with Memgraph Platform, you should pass configuration flags inside of environment variables.

For example, you can start the MemgraphDB image with docker run memgraph/memgraph --bolt-port=7687 --log-level=TRACE, but you should start Memgraph Platform with docker run -p 7687:7687 -p 7444:7444 -p 3000:3000 -e MEMGRAPH="--bolt-port=7687 --log-level=TRACE" memgraph/memgraph-platform.

To learn about all the configuration options, check out the Reference guide.

Where to next?

If you need more information on working with Docker, check out our guide on how to work with Docker.
To learn how to query the database, take a look at the querying guide or Memgraph Playground for interactive tutorials.
Visit the Drivers overview page if you need to connect to the database programmatically.

Getting help

If you run into problems during the installation process, check out our installation troubleshooting guide to see if we have already covered the topic. For more information on the installation process and for additional questions, visit the Help Center page.