# Setting up basic service with docker compose

**URL:** <https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836>\
**Category:** Uncategorized\
**Created:** [July 8, 2024, 9:08pm UTC](https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836 "2024-07-08T21:08:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![colin](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@colin](https://openziti.discourse.group/u/colin)\
**Post date:** [July 8, 2024, 9:08pm UTC](https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836/1 "2024-07-08T21:08:12Z")

</div>

Hi there,

Im trying to create a service using the the "Local - Docker Compose" tutorial that has ziti private blue/ red etc. I have the network set up on an ubuntu virtual machine on my laptop using docker and I can display the webpage as per the tutorial using localhost. When I set up the service in the ZAC and try connecting from my ubuntu vm which I have set up an identity for I get the message:

"Failed to connect to http.ziti port 80 after 133923 ms: Couldn't connect to server"

I have not changed any of the defaults in my .env file:

# OpenZiti Variables

ZITI\_IMAGE=openziti/quickstart  
ZITI\_VERSION=latest

# the user and password to use

# Leave password blank to have a unique value generated or set the password explicitly

ZITI\_USER=admin  
ZITI\_PWD=myziti

ZITI\_INTERFACE=0.0.0.0

# controller name, address/port information

ZITI\_CTRL\_NAME=ziti-controller  
ZITI\_CTRL\_EDGE\_ADVERTISED\_ADDRESS=ziti-edge-controller  
ZITI\_CTRL\_ADVERTISED\_ADDRESS=ziti-controller  
#ZITI\_CTRL\_EDGE\_IP\_OVERRIDE=10.10.10.10  
#ZITI\_CTRL\_EDGE\_ADVERTISED\_PORT=8441  
#ZITI\_CTRL\_ADVERTISED\_PORT=8440

# The duration of the enrollment period (in minutes), default if not set. shown - 7days

ZITI\_EDGE\_IDENTITY\_ENROLLMENT\_DURATION=10080  
ZITI\_ROUTER\_ENROLLMENT\_DURATION=10080

# router address/port information

#ZITI\_ROUTER\_NAME=ziti-edge-router  
#ZITI\_ROUTER\_ADVERTISED\_ADDRESS=ziti-edge-router  
#ZITI\_ROUTER\_PORT=8442  
#ZITI\_ROUTER\_IP\_OVERRIDE=10.10.10.10  
#ZITI\_ROUTER\_LISTENER\_BIND\_PORT=8444  
#ZITI\_ROUTER\_ROLES=public  
~

Do I have to change any of the above to get this to work locally on an ubuntu VM or is there something else Im missing setting this up ?

Thanks,

Col

---

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [July 8, 2024, 9:18pm UTC](https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836/2 "2024-07-08T21:18:12Z")

</div>

I'm not sure what went wrong there, but here's another compose example you could try: [ziti/quickstart/docker/all-in-one/compose.yml at allinone-controller-image · openziti/ziti · GitHub](https://github.com/openziti/ziti/blob/allinone-controller-image/quickstart/docker/all-in-one/compose.yml)

That's in a branch and the only difference from [ziti/quickstart/docker/all-in-one/compose.yml at main · openziti/ziti · GitHub](https://github.com/openziti/ziti/blob/main/quickstart/docker/all-in-one/compose.yml) is that is uses the controller container image which has the web console built-in.

It's accompanied by this README: [ziti/quickstart/docker/all-in-one/README.md at main · openziti/ziti · GitHub](https://github.com/openziti/ziti/blob/main/quickstart/docker/all-in-one/README.md)

![allinone-controller](https://global.discourse-cdn.com/free1/uploads/netfoundry/original/2X/2/22ca066b199ad52a92751c3e208586df6972468a.gif)

[Link to Asciicast](https://asciinema.org/a/vVYsaRjqU3SWYfcp2zP7MzJT7)

---

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [July 9, 2024, 3:26pm UTC](https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836/3 "2024-07-09T15:26:00Z")

</div>

> [@colin](#):
>
> "Failed to connect to http.ziti port 80 after 133923 ms: Couldn't connect to server"

Did you follow the ziti cli commands or did you translate them through to ZAC equivalent commands? The doc has you create a host v1 that points to port 80:

```auto
ziti edge create config http.host.v1 host.v1 '{"protocol":"tcp", "address":"'"${http_server}"'", "port":80}'

```

but in the docker compose realm that's incorrect. it should be `8000` assuming you started the hello world using:

```auto
docker run -d --rm --name web-test -p 80:8000 openziti/hello-world

```

OR - I would stop that web-test and use:

```auto
docker run -d --rm --name web-test -p 80:80 openziti/hello-world

```

Then your host.v1 config will be accurate, or you can update that host.v1 to use port 8000, either way should work. I'll go put a PR in that adds words to this effect so that it doesn't confuse people again... Sorry about that, try it out and see if that solves the issue for you?

---

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [July 9, 2024, 3:37pm UTC](https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836/4 "2024-07-09T15:37:36Z")

</div>

Yeah, that's the issue I think... I just ran through the docker compose bring up and then followed the instructions at [Your First Service | OpenZiti](https://openziti.io/docs/learn/quickstarts/services/ztha). I had set my `http_server` to `web.test.blue` and my `http_server_id` to `ziti-private-blue`.

I then had to update my host.v1 config with port 8000:

```auto
ziti edge update config http.host.v1 -d '{"protocol":"tcp", "address":"'"${http_server}"'", "port":8000}'

```

I enrolled using the Ziti Desktop Edge for Windows and then curl'ed to http.ziti:

 ![image](https://global.discourse-cdn.com/free1/uploads/netfoundry/original/2X/f/fc39463f58bf83c0a9e0f652cea4a62ac9d64583.png)

---

<div class="post-metadata">

**Author:** ![colin](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@colin](https://openziti.discourse.group/u/colin)\
**Post date:** [July 10, 2024, 8:55pm UTC](https://openziti.discourse.group/t/setting-up-basic-service-with-docker-compose/2836/5 "2024-07-10T20:55:57Z")

</div>

Thank you both for the help - I adjusted the port and that has solved my issue
