Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is there a way to make the host port for a docker container listen only on localhost?

Featured Replies

I don't want the port fully exposed on my LAN, it just seems like terrible security if anyone else is using the LAN. I am actually a bit surprised there isn't better security for this.

 

I would like to just make an SSH tunnel so I can access it via localhost.

 

Then I could do like 

 

# ssh -L 1234:127.0.0.1:1234 [email protected]

 

Then connect with a web browser to 127.0.0.1:1234 from my workstation.

 

There doesn't appear to be a way to do this unless I can do it with a specific network type.

 

I saw guides for SSH tunneling to Unraid but they still assume the docker port will be fully exposed to the LAN.

Solved by Teeman

  • Author

I have tried doing something like this:

 

iptables -A INPUT -p tcp -s localhost --dport 1234 -j ACCEPT

iptables -A INPUT -p tcp --dport 1234 -j DROP

 

However, I can still access it via the LAN... I don't want it accessible from anywhere except localhost.

  • Author
  • Solution

Remove any ports configured and use this in the extra parameters:

 

-p 127.0.0.1:1234:1234

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.