# Deploy gradio app on my own server machine fails

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%3E%5C
**Category:** 🔒 Gradio\
**Created:** [June 1, 2023, 6:52pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808 "2023-06-01T18:52:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevezkw](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stevezkw](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstevezkw)%5C
**Post date:** [June 1, 2023, 6:52pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F1 "2023-06-01T18:52:04Z")

</div>

I tried to build & deploy my gradio app using docker, it successfully deployed but can not access to the app externally.

–gradio app code–  
app.py

```auto
import gradio as gr

app = gr.Blocks()
... ... 
app.queue(concurrency_count=1)
app.launch(enable_queue=True, share=True,
           server_name="0.0.0.0", server_port=7860)

```

Dockerfile

```auto
... ...
RUN mkdir /app
WORKDIR /app
... ...
EXPOSE 7860

CMD ["python", "app.py"]

```

Deploy cmd

```auto
docker run -d -p 7860:7860 --name my_app image_name

```

Then I try to visit priviate\_server\_ip:7860, but I can not see the app interface  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/8/e/8e482b677e170ac3c52593ab14496638b899e991.png)

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [June 1, 2023, 9:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F2 "2023-06-01T21:34:33Z")

</div>

hi @stevezkw are you deploying it on Spaces? if so, here is a Gradio Dockerfile working example

> **[Dockerfile · sayakpaul/demo-docker-gradio at main](https://huggingface.co/spaces/sayakpaul/demo-docker-gradio/blob/main/Dockerfile)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Demo Docker Gradio - a Hugging Face Space by sayakpaul](https://huggingface.co/spaces/sayakpaul/demo-docker-gradio)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![stevezkw](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stevezkw](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstevezkw)%5C
**Post date:** [June 1, 2023, 10:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F3 "2023-06-01T22:05:28Z")

</div>

Hi @radames Thank you for your response, I am not deploying it on Spaces, instead, deploying on a remote machine.  
But I am curious where I should correct in my Dockerfile, because I don’t know which step is wrong , so I still confused how can I make it work

Thank you

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [June 1, 2023, 10:07pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F4 "2023-06-01T22:07:45Z")

</div>

hi @stevezkw I see, sorry I just noticed the issue, please disable share i.e. `share=False` when running on local/remote machine. `share` enable a reverse proxy via Gradio servers [Sharing Your App](https://gradio.app/sharing-your-app/#sharing-demos)

---

<div class="post-metadata">

**Author:** ![stevezkw](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stevezkw](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstevezkw)%5C
**Post date:** [June 1, 2023, 10:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F5 "2023-06-01T22:09:49Z")

</div>

Oh Thank you for your great suggestion @radames

I’ll just try it out, and will keep you updated when I have new result

Thank you so much

---

<div class="post-metadata">

**Author:** ![stevezkw](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stevezkw](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstevezkw)%5C
**Post date:** [June 1, 2023, 10:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F6 "2023-06-01T22:16:53Z")

</div>

Hi @radames , update:

after setting share=False, and build + push + pull + deploy again

Still see the same result: 🥲  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/8/e/8e482b677e170ac3c52593ab14496638b899e991.png)

But thank you for your advice 😇

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [June 1, 2023, 10:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F7 "2023-06-01T22:45:04Z")

</div>

sorry @stevezkw , I’m not sure if I can help since it’s a different provider, however I’d suggest you to test your Dockerfile on our Spaces docker sdk and then try on your provider

> **[Docker Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![stevezkw](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stevezkw](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstevezkw)%5C
**Post date:** [June 1, 2023, 11:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-gradio-app-on-my-own-server-machine-fails%2F41808%2F8 "2023-06-01T23:45:38Z")

</div>

Hi @radames I found the reason, my fault 😂  
I am sorry, I made a typal mistake on version number:

after correcting, I success:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/6/d/6d3f8c186948034c16b0240df7825260f0b24148.png)

Thank you for your friendly and patient helps 👍
