Skip to content

Quickly deploy NebulaGraph using Docker

You can quickly get started with NebulaGraph by deploying NebulaGraph with Docker Desktop or Docker Compose.

NebulaGraph is available as a Docker Extension that you can easily install and run on your Docker Desktop. You can quickly deploy NebulaGraph using Docker Desktop with just one click.

  1. Install Docker Desktop.

    Caution

    We do not recommend you deploy NebulaGraph on Docker Desktop for Windows due to its subpar performance. For details, see #12401. If you must use Docker Desktop for Windows, install WSL 2 first.

  2. In the left sidebar of Docker Desktop, click Extensions or Add Extensions.

  3. On the Extensions Marketplace, search for NebulaGraph and click Install.

    docker

    Click Update to update NebulaGraph to the latest version when a new version is available.

    docker-update

  4. Click Open to navigate to the NebulaGraph extension page.

  5. At the top of the page, click Studio in Browser to use NebulaGraph.

  6. Use basic nGQL commands. For more information, see Use nGQL (CRUD).

For more information about how to use NebulaGraph with Docker Desktop, see the following video:

Using Docker Compose can quickly deploy NebulaGraph services based on the prepared configuration file. It is only recommended to use this method when testing the functions of NebulaGraph.

Prerequisites

  • If you are deploying NebulaGraph as a non-root user, grant the user with Docker-related privileges. For detailed instructions, see Manage Docker as a non-root user.
  • You have started the Docker service on your host.
  • If you have already deployed another version of NebulaGraph with Docker Compose on your host, to avoid compatibility issues, you need to delete the nebula-docker-compose/data directory.

Deploy NebulaGraph

  1. Clone the 3.8.0 branch of the nebula-docker-compose repository to your host with Git.

    Danger

    The master branch contains the untested code for the latest NebulaGraph development release. DO NOT use this release in a production environment.

    $ git clone -b release-3.8 https://github.com/vesoft-inc/nebula-docker-compose.git
    

    Note

    The x.y version of Docker Compose aligns to the x.y version of NebulaGraph. For the NebulaGraph z version, Docker Compose does not publish the corresponding z version, but pulls the z version of the NebulaGraph image.

  2. Go to the nebula-docker-compose directory.

    $ cd nebula-docker-compose/
    
  3. Run the following command to start all the NebulaGraph services.

    Note

    [nebula-docker-compose]$ docker-compose up -d
    Creating nebula-docker-compose_metad0_1 ... done
    Creating nebula-docker-compose_metad2_1 ... done
    Creating nebula-docker-compose_metad1_1 ... done
    Creating nebula-docker-compose_graphd2_1   ... done
    Creating nebula-docker-compose_graphd_1    ... done
    Creating nebula-docker-compose_graphd1_1   ... done
    Creating nebula-docker-compose_storaged0_1 ... done
    Creating nebula-docker-compose_storaged2_1 ... done
    Creating nebula-docker-compose_storaged1_1 ... done
    

    Compatibility

    Starting from NebulaGraph version 3.1.0, nebula-docker-compose automatically starts a NebulaGraph Console docker container and adds the storage host to the cluster (i.e. ADD HOSTS command).

    Note

    For more information of the preceding services, see NebulaGraph architecture.

Connect to NebulaGraph

There are two ways to connect to NebulaGraph:

  • Connected with Nebula Console outside the container. Because the external mapping port for the Graph service is also fixed as 9669 in the container's configuration file, you can connect directly through the default port. For details, see Connect to NebulaGraph.
  • Log into the container installed NebulaGraph Console, then connect to the Graph service. This section describes this approach.
  1. Run the following command to view the name of NebulaGraph Console docker container.

    $ docker-compose ps
              Name                         Command             State                 Ports
    --------------------------------------------------------------------------------------------
    nebula-docker-compose_console_1     sh -c sleep 3 &&          Up
                                      nebula-co ...
    ......
    
  2. Run the following command to enter the NebulaGraph Console docker container.

    docker exec -it nebula-docker-compose_console_1 /bin/sh
    / #
    
  3. Connect to NebulaGraph with NebulaGraph Console.

    / # ./usr/local/bin/nebula-console -u <user_name> -p <password> --address=graphd --port=9669
    

    Note

    By default, the authentication is off, you can only log in with an existing username (the default is root) and any password. To turn it on, see Enable authentication.

  4. Run the following commands to view the cluster state.

    nebula> SHOW HOSTS;
    +-------------+------+----------+--------------+----------------------+------------------------+---------+
    | Host        | Port | Status   | Leader count | Leader distribution  | Partition distribution | Version |
    +-------------+------+----------+--------------+----------------------+------------------------+---------+
    | "storaged0" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.8.0" |
    | "storaged1" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.8.0" |
    | "storaged2" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.8.0" |
    +-------------+------+----------+--------------+----------------------+------------------------+---------+
    
    5. Use basic nGQL commands. For more information, see Use nGQL (CRUD).

Run exit twice to switch back to your terminal (shell).


Last update: May 30, 2025