HTTP Auth With Docker

Linode Staff

I have started a docker instance on Linode which can be accessed with its public IP:Port. However, I need HTTP Auth implemented so that anyone who visits the IP:Port is prompted for a username and password. How can I achieve this?

1 Reply

The process for enabling HTTP Auth is a bit different when the application is running through a container. Take a look at this post on StackOverflow about Securing a Docker Container with HTTP Basic Auth. It looks like this can be done by setting up an NGINX container instance and using it as a reverse proxy to your application.

This guide for Securing Docker with HTTP Basic Authentication provides instructions on how this can be done. If you are interested in setting up something that may be a bit more secure then you may want to look into Protecting the Docker Daemon Socket.

--Kevin

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct