# Ratel UI Setup with Docker Swarm

**URL:** <https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865>\
**Category:** Ratel\
**Tags:** kind:question\
**Created:** [July 7, 2021, 9:20pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865 "2021-07-07T21:20:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 9:20pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/1 "2021-07-07T21:20:31Z")

</div>

Is there documentation on how to setup the UI with Docker Swarm / HA

```auto
Creating network dgraph_dgraph
Creating service dgraph_zero
Creating service dgraph_alpha1
Creating service dgraph_alpha2
Creating service dgraph_alpha3
bmcclelland@:/data$ sudo docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
igdu6ivpr6rs dgraph_alpha1 replicated 0/1 dgraph/dgraph:latest *:8080->8080/tcp, *:9080->9080/tcp
jly1hy5wni9q dgraph_alpha2 replicated 0/1 dgraph/dgraph:latest *:8081->8081/tcp, *:9081->9081/tcp
2tdcjhsoagdf dgraph_alpha3 replicated 0/1 dgraph/dgraph:latest *:8082->8082/tcp, *:9082->9082/tcp
nkw6kiu2p2jb dgraph_zero replicated 0/1 dgraph/dgraph:latest *:5080->5080/tcp, *:6080->6080/tcp

It says the service created a network, but no Service Name was listed?? 

```

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 9:34pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/2 "2021-07-07T21:34:20Z")

</div>

I have this now in my browser

> Dgraph browser is available for running separately using the dgraph-ratel binary

http request from [http://localhost:8080](http://localhost:8080)

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 9:41pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/3 "2021-07-07T21:41:16Z")

</div>

> This instance of Dgraph will send anonymous reports of panics back to Dgraph Labs via Sentry. No confidential information is sent. These reports help improve Dgraph. To opt-out, restart your instance with the --telemetry “sentry=false;” flag. For more info, see [How To Guides - Howto](https://dgraph.io/docs/howto/#data-handling).  
> I0707 21:26:27.692344 57 init.go:110]
> 
> Dgraph version : v21.03.0  
> Dgraph codename : rocket  
> Dgraph SHA-256 : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f  
> Commit SHA-1 : a77bbe8ae  
> Commit timestamp : 2021-04-07 21:36:38 +0530  
> Branch : HEAD  
> Go version : go1.16.2  
> jemalloc enabled : true
> 
> For Dgraph official documentation, visit [Get started with Dgraph](https://dgraph.io/docs)  
> For discussions about Dgraph , visit  
> For fully-managed Dgraph Cloud ,
> 
> Licensed variously under the Apache Public License 2.0 and Dgraph Community License.  
> Copyright 2015-2021 Dgraph Labs, Inc.

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 9:42pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/4 "2021-07-07T21:42:13Z")

</div>

It looks like I have it setup and running, just don’t know how to access the darn UI

any help is appreciated, as this is a brand new deployment for me

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 7, 2021, 9:51pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/5 "2021-07-07T21:51:32Z")

</div>

Specifically for Ratel you shall use this image in the link [Docker Hub](https://hub.docker.com/r/dgraph/ratel)

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 10:09pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/6 "2021-07-07T22:09:40Z")

</div>

Hey Michel!!! Thanks for the reply, do I need to remove or stop services that were created from the other setups — will this break that Docker Pull ?

looks like I still have

```auto
7a9545f524c2 dgraph/dgraph:v21.03.0 

```

and also

```auto
ID NAME MODE REPLICAS IMAGE PORTS
igdu6ivpr6rs dgraph_alpha1 replicated 0/1 dgraph/dgraph:latest *:8080->8080/tcp, *:9080->9080/tcp
jly1hy5wni9q dgraph_alpha2 replicated 0/1 dgraph/dgraph:latest *:8081->8081/tcp, *:9081->9081/tcp
2tdcjhsoagdf dgraph_alpha3 replicated 0/1 dgraph/dgraph:latest *:8082->8082/tcp, *:9082->9082/tcp
nkw6kiu2p2jb dgraph_zero replicated 0/1 dgraph/dgraph:latest *:5080->5080/tcp, *:6080->6080/tcp

```

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 10:27pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/7 "2021-07-07T22:27:07Z")

</div>

I have the image downloaded, but not sure what that does for me…

I’m a bit new with docker/images or at least deploying them correctly

> 475f496e67f8: Pull complete  
> Digest: sha256:f34ac9708541c56dc922b40c537d7b113fead503bd788815da8da0a10a35038f  
> Status: Downloaded newer image for dgraph/ratel:latest  
> [docker.io/dgraph/ratel:latest](http://docker.io/dgraph/ratel:latest)

Still displaying the same error

> Dgraph browser is available for running separately using the dgraph-ratel binary

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 7, 2021, 10:35pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/8 "2021-07-07T22:35:25Z")

</div>

Available images showing

```auto

REPOSITORY TAG IMAGE ID CREATED SIZE
dgraph/dgraph <none> 1043ca38d68e 2 weeks ago 155MB
dgraph/ratel latest 98e9777f3b57 7 weeks ago 26.7MB
dgraph/dgraph v21.03.0 740c1f56163c 3 months ago 154MB
hello-world latest d1165f221234 4 months ago 13.3kB

```

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 7, 2021, 11:36pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/9 "2021-07-07T23:36:54Z")

</div>

Hey @Blackbear710 , what helps is to know how did you run it. Show me the commands. Or the YAML, or better, the commands in the YAML.

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 3:10pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/10 "2021-07-08T15:10:25Z")

</div>

```auto
wget https://github.com/dgraph-io/dgraph/raw/master/contrib/config/docker/docker-compose-multi.yml

# This file can be used to setup a Dgraph cluster with 3 Dgraph Alphas and 1 Dgraph Zero node on a
# Docker Swarm with replication.
# It expects three virtual machines with hostnames aws01, aws02, and aws03 to be part of the swarm.
# There is a constraint to make sure that each Dgraph Alpha runs on a particular host.

# Data would be persisted to a Docker volume called data-volume on the virtual machines which are
# part of the swarm.
# Run `docker stack deploy -c docker-compose-multi.yml` on the Swarm leader to start the cluster.

version: "3.2"
networks:
  dgraph:
services:
  zero:
    image: dgraph/dgraph:latest
    volumes:
      - data-volume:/dgraph
    ports:
      - 5080:5080
      - 6080:6080
    networks:
      - dgraph
    deploy:
      placement:
        constraints:
          - node.hostname == aws01
    command: dgraph zero --my=zero:5080 --replicas 3
  alpha1:
    image: dgraph/dgraph:latest
    hostname: "alpha1"
    volumes:
      - data-volume:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    networks:
      - dgraph
    deploy:
      placement:
        constraints:
          - node.hostname == aws01
    command: dgraph alpha --my=alpha1:7080 --zero=zero:5080
  alpha2:
    image: dgraph/dgraph:latest
    hostname: "alpha2"
    volumes:
      - data-volume:/dgraph
    ports:
      - 8081:8081
      - 9081:9081
    networks:
      - dgraph
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.hostname == aws02
    command: dgraph alpha --my=alpha2:7081 --zero=zero:5080 -o 1
  alpha3:
    image: dgraph/dgraph:latest
    hostname: "alpha3"
    volumes:
      - data-volume:/dgraph
    ports:
      - 8082:8082
      - 9082:9082
    networks:
      - dgraph
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.hostname == aws03
    command: dgraph alpha --my=alpha3:7082 --zero=zero:5080 -o 2
volumes:
  data-volume:

```

I just changed the aws hostnames to my own; as we do not do Cloud Deployments. This will be on Prem

Also @MichelDiz — Can we do this Without Docker?? That would be preferred

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 3:11pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/11 "2021-07-08T15:11:59Z")

</div>

The Standalone Image came from

[https://dgraph.io/tour/intro/2/#expand](https://dgraph.io/tour/intro/2/#expand)

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 8, 2021, 3:19pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/12 "2021-07-08T15:19:23Z")

</div>

> [@Blackbear710](#):
>
> Can we do this Without Docker??

Yes, if you are on Linux. But your issue is related to Docker Swarm, right?

I’m not seeing Ratel in the YAML.

> [@Blackbear710](#):
>
> The Standalone Image came from

There’s no Docker Swarm in the tour. oO

Well, just add

```auto
  ratel:
    image: dgraph/ratel:latest
    ports:
      - 8000:8000
    networks:
      - dgraph
    deploy:
      placement:
        constraints:
          - node.hostname == aws01
    command: dgraph-ratel

```

Or just use [http://play.dgraph.io/](http://play.dgraph.io/)

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 3:26pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/13 "2021-07-08T15:26:37Z")

</div>

I got the Ratel Image running — just can’t get the UI up correctly. Probably something Docker/Network related

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 3:27pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/14 "2021-07-08T15:27:45Z")

</div>

\*\*[play.dgraph.io/](http://play.dgraph.io/)

this wouldn’t work unfortunately, as I need to build it on our Servers — its not to play around with

its hopefully for production

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 8, 2021, 3:33pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/15 "2021-07-08T15:33:28Z")

</div>

> [@Blackbear710](#):
>
> just can’t get the UI up correctly. Probably something Docker/Network related

Do you mean you can’t connect to the cluster? check the IP. Docker Swarm works differently. Maybe you need to hit the host IP, or the virtual machine. The address alpha1:8080 won’t work outside of Docker context. As it is an internal services. And Ratel UI is running in your Browser, besides its service is in the container.

---

<div class="post-metadata">

**Author:** ![joaquin](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/joaquin/32/2619_2.png) [@joaquin](https://discuss.dgraph.io/u/joaquin)\
**Post date:** [July 8, 2021, 9:12pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/16 "2021-07-08T21:12:47Z")

</div>

Just adding on to this in case this is not obvious. You will have to expose an endpoint of Dgraph Alpha HTTP(S) service. On a production scenario, this should never be accessible, so you would then need to go through an SSH jump host or a VPN to access a private internal-facing LB that hits the Dgraph Alpha service.

The Ratel is only a client, so it can run on a laptop, or if desired, from the private network as well. If  
you can run curl [https://alpha.example.com:8080/health](https://alpha.example.com:8080/health) (replace FQDN to IP or hostname you are using) works fine, then the same address will work with Ratel’s connection configuration.

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 10:22pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/17 "2021-07-08T22:22:46Z")

</div>

Gotta wait 5 Hours for my next reply, wompp womppp

@MichelDiz correct, I am sure it is some type of Docker / Network Issue

I’m kind of getting thrown into the fire but that’s alright, I don’t really know much about connecting to containers outside of the container, if that makes sense

I got " Why are they using Docker Swarm for this!!! See if you can get it working with Docker, if not, find a way to not use Docker Swarm"

It seems like I have it deployed, just networking /docker dependencies that I am not familiar with

I assume it has nothing to do with yalls YAML/Apps (I’m gonna add the Ratel YAML and remove the deploy constraints since its not aws)

Classic case of, its not you its me (but this time its actually just me) 🤣

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 8, 2021, 10:29pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/18 "2021-07-08T22:29:04Z")

</div>

Also, there is a config that you should pay attention - this one [https://dgraph.io/docs/deploy/dgraph-administration/#whitelisting-admin-operations](https://dgraph.io/docs/deploy/dgraph-administration/#whitelisting-admin-operations)  
When you working with different networks you have to explicitly warn Dgraph about them.

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 10:36pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/19 "2021-07-08T22:36:05Z")

</div>

thanks for popping in Joaquin, I agree with this statement fully. I will just need to do some more research on configuring endpoints for docker/https so I am able to connect to Ratel UI

---

<div class="post-metadata">

**Author:** ![Blackbear710](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/blackbear710/32/8547_2.png) [@Blackbear710](https://discuss.dgraph.io/u/Blackbear710)\
**Post date:** [July 8, 2021, 10:36pm UTC](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865/20 "2021-07-08T22:36:48Z")

</div>

thanks, I just saw this recently as well, will be looking into that doc

[Next page](https://discuss.dgraph.io/t/ratel-ui-setup-with-docker-swarm/14865.md?page=2)
