I have been trying to make the Tensoboard password-protected, but it isn't easy as it is not a Flask app. An issue has been opened last year, but no news since.
Has anybody found a way to make Tensorboard password-protected?
As a workaround, you can set --host parameter to 127.0.0.1 and then protect the local port with a basic authentication using nginx or something.. –
Kicksorter
As Tensorboard unfortunately does not have password-protection built-in, I used an nginx server within a docker container that acts as a reverse proxy.
Tensorboard is then protected with HTTP basic auth.
nginx.conf
events { worker_connections 1024; }
http {
server {
listen 5000;
server_name localhost;
location / {
proxy_pass http://host.docker.internal:5000;
auth_basic "Restricted Remote";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
}
To generate the .htpasswd file use the following command:
htpasswd -c .htpasswd admin
docker-compose.yml
version: '3'
services:
nginx:
image: nginx:latest
container_name: nginx_reverse_proxy
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./.htpasswd:/etc/nginx/.htpasswd
ports:
- 5000:5000
To run use docker-compose up -d
I wrote a blog post where I explain how to create your own sharable Tensorboards with authentication on GCP in a cost-effective way. This post includes the Terraform setup so that the solution can be replicated with ease.
https://blog.ml6.eu/a-vertex-ai-tensorboard-alternative-for-smaller-budgets-part-2-923953c1e422
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review –
Thurmond
© 2022 - 2025 — McMap. All rights reserved.