@@ -20,11 +20,16 @@ This guide helps you to understand how to:
2020
2121## Run Dgraph and connect the Ratel web UI
2222
23- The easiest way to get Dgraph up and running is using
24- [ Dgraph on Hypermode] ( https://hypermode.com/go ) .
23+ The easiest way to get Dgraph up and running in the cloud is using
24+ [ Dgraph on Hypermode] ( https://hypermode.com/go ) . If you prefer a local
25+ development experience with Dgraph we recommend using the official Dgraph Docker
26+ image. Both options are described below.
2527
26- In this section we'll sign in to Hypermode and create a new graph, then we'll
27- connect our new graph to [ Ratel] ( ./glossary#ratel ) , the web-based UI for Dgraph.
28+ In this section we'll create a new graph, then we'll connect our new graph to
29+ [ Ratel] ( ./glossary#ratel ) , the web-based UI for Dgraph.
30+
31+ <Tabs >
32+ <Tab title = " On Hypermode" >
2833
2934<Steps >
3035
@@ -90,6 +95,54 @@ Now we're ready to add data to our graph.
9095</Step >
9196
9297</Steps >
98+ </Tab >
99+
100+ <Tab title = " Locally" ><Steps >
101+ <Step title = " Run Dgraph with Docker" >
102+ The [ ` dgraph/standalone ` ] ( https://hub.docker.com/r/dgraph/standalone ) Docker image has everything needed to run Dgraph locally.
103+
104+ Ensure you have [ Docker installed] ( https://www.docker.com/ ) , then run the following command to start a local Dgraph instance:
105+
106+ ``` bash
107+ docker run --rm -it -p 8080:8080 -p 9080:9080 dgraph/standalone:latest
108+ ```
109+
110+ This will create a local Dgraph instance and expose the ports necessary to connect to Dgraph via HTTP and gRPC. Specifically:
111+
112+ * ` docker run ` - initiates a new Docker container
113+ * ` --rm ` - automatically removes the container when it exits, helping with cleanup
114+ * ` -it ` - uses interactive mode to show output of the container
115+ * ` -p 8080:8080 ` - maps port 8080 from the host machine to port 8080 in the Docker container to allow Dgraph HTTP connections
116+ * ` -p 9080:9080 ` - maps port 9080 from the host machine to port 9080 in the Docker container to allow Dgraph gRPC connections
117+ * ` dgraph/standalone:latest ` - specifies the Docker image to use, this is the official Dgraph image with latest tag
118+ </Step >
119+ <Step title = " Connect Ratel" >
120+ Ratel is a web-based UI dashboard for interacting with Dgraph using Dgraph's query language,[ DQL] ( ./glossary#DQL )
121+
122+ Navigate to the hosted version of Ratel at ` https://ratel.hypermode.com ` and enter ` http://localhost:8080 ` for the "Dgraph Conn String".
123+ This will allow Ratel to connect to our local Dgraph instance and execute DQL queries.
124+
125+ ![ Setting up Ratel] ( /images/dgraph/quickstart/ratel-docker-connection.png )
126+
127+ <Note >
128+ You can also run Ratel locally by running the ` dgraph/ratel ` container with the following command:
129+ ```bash
130+ docker run --rm -it -p 8000:8000 dgraph/ratel:latest
131+ ```
132+ </Note >
133+
134+ Now select ** Connect** to verify the connection and then select ** Continue** to access the Ratel console.
135+
136+ { /* TODO: updated image showing local connection to Ratel */ }
137+ ![ Setting up Ratel local connection] ( /images/dgraph/quickstart/ratel-docker-overview.png )
138+
139+ Now we're ready to add data to our graph.
140+
141+ </Step >
142+ </Steps >
143+
144+ </Tab >
145+ </Tabs >
93146
94147## Add data to the graph with a mutation
95148
0 commit comments