Install Memgraph with Docker
This article briefly outlines the basic steps necessary to install and run Memgraph with Docker.
#
PrerequisitesBefore you proceed with the installation guide make sure that you have:
- Installed Docker. Instructions on how to do this can be found on the official Docker website.
- Downloaded the latest Memgraph Docker Image which can be found here.
info
Memgraph's Docker image was built with Docker version 1.12
and should be
compatible with all newer versions.
#
Installation guideIf you installed Docker and downloaded the latest Memgraph Docker image, import the image using the following command:
To start Memgraph, use the following command:
If successful, you should see a message similar to the following :
At this point, Memgraph is ready for you to submit queries.
info
The username and password for connecting to the database are empty by default.
#
Stopping the database instanceTo stop a Memgraph database instance, run the following command:
You can find the name of the container (CONTAINER_NAME
) by running:
#
ConfigurationThe Memgraph configuration is available in Docker's named volume mg_etc
. On
Linux systems, it should be in
/var/lib/docker/volumes/mg_etc/_data/memgraph.conf
.
#
Named volumesIf it happens that the named volumes are reused between different Memgraph versions, Docker will overwrite a folder within the container with existing data from the host machine. If a new file is introduced, or two versions of Memgraph are not compatible, some features might not work or Memgraph might not be able to work correctly. We strongly advise you to use different named volumes for different Memgraph versions, or to remove the existing volume from the host with the following command:
#
Note for Docker usersAlthough unlikely, some OS X/macOS users might experience minor difficulties
after the Docker installation. Instead of running on
localhost
, a Docker container for Memgraph may be running on a custom IP
address. Fortunately, that IP address can be found as follows:
1) Determine the container ID of the Memgraph container
By issuing the command docker ps
the user should get an output similar to the
following:
At this point, it is important to remember the container ID of the Memgraph
image. In our case, that is 9397623cd87e
.
2) Use the container ID to retrieve an IP of the container
The command above should yield the IP that should be used when
connecting to Memgraph and instead of HOST
when firing up the mg_client
with Docker, as described in the querying section.
#
Where to next?If you need more information on working with Docker, check out this guide.
To learn how to query the database, take a look at the Querying guide or Memgraph Playground for interactive tutorials.
Visit the Building applications page if you need to
connect to the database programmatically.
#
Getting helpVisit the Getting help page in case you run into any kind of problem or you have additional questions.