How do I set the server to for deployment using Docker

Hi Streamlit

This is truly awesome.

I would like to deploy an application using docker. In order to access the streamlit server outside the container it should be running on (as far as I now). How do I do that?

I’ve tried playing around with the config.toml file without luck.

If I was running a flask web app with gunicorn the entrypoint would be something like

gunicorn app:SERVER --bind --workers 4

How do I run the similar command for streamlit?

At the moment the output inside the container is

  Welcome to Streamlit!

  If you are one of our development partners or are interested in
  getting personal technical support, please enter your email address
  below. Otherwise, you may leave the field blank.


  Telemetry: As an open source project, we collect usage statistics.
  We cannot see and do not store information contained in Streamlit apps.

  If you'd like to opt out, add the following to ~/.streamlit/config.toml,
  creating that file if necessary:

    gatherUsageStats = false

  You can now view your Streamlit app in your browser.

  Network URL:
  External URL:


1 Like

Problem solved. I copied a config.toml file to ~/.streamlit/config.toml during the docker build


serverAddress = “”


Hi Marc

Can you elaborate on what you did? I am running a jupyter notebook from a docker container where I have installed streamlit. Do I have to modify the Dockerfile with someting specific to streamilt?


Hi @sanjoy

Well, in your docker file you need to

  1. Run your app using streamlit streamlit run or similar.
  2. Make sure your ~/.streamlit/config.toml has the right configurations.
  3. Make sure your ~/.streamlit/credentials.toml has email=""

You can take look at the repo

and start by taking a look at the docker files

and config files

If you like the repo please star it at that gives me energy to improve it.


hi @Marc, thanks a lot for sharing the Dockerfiles. I’m wondering if you have had any luck getting hot realoading to work? I’ve tried mounting the folder where an example file is located but unfortunately I have not yet gotten hot reloading to work the same as when i’m using streamlit run If I reload the streamlit app manually it does pick up changes that occurred in the mounted file, but it would be great to get the same hot reloading functionality.

1 Like

Hi @tblazina

I actually use the Docker containers for deployment only. So I don’t need hotreloading.

Hi @Marc, Ah alright, I’ll see if I can figure a way around this, or just develop with the normal app and use Docker only for production as you are doing. Cheers!

Has anyone got an example using docker-compose with streamlit and other services (e.g. a flask api)? I am unsure how to pass the IP addresses into the two containers

Hi @robmarkcole, you might want to check out

1 Like