Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

On Plesk for Linux server, deny rules set up in Plesk Firewall do not block connections to Docker container

 
applications extensionscentosdebiandockerfirewall

Symptoms

  • Plesk Firewall is enabled on the server.

  • Docker container is created and mapped to some port (for example, a Redis contained with port mapping 6379 -> 6379).

  • Deny rules (for incoming, outgoing, forwarding) created in Plesk Firewall do not block connections to port 6379 from outside.

Cause

According to Docker documentation, Docker installs two custom iptables chains named DOCKER-USER and DOCKER, and it ensures that incoming packets are always checked by these two chains first. However, Plesk Firewall cannot make any changes in these chains.

There is an internal request with ID PPPM-9222 to improve Plesk Firewall in one of the future Plesk updates.

Resolution

As a workaround, add the following rule into iptables manually, remove Plesk firewall extension and, until the fix be available, manage firewall rules manually:

Note: Examples below are provided for IPv4. To manipulate with IPv6 firewall rules ip6tables, ip6tables-save, ip6tables-restore should be used.

  1. Connect to the server using SSH.

  2. Add the rule to the DOCKER-USER chain, which is checked first in FORWARD:

    To deny access from the public network without exceptions

    # iptables -I DOCKER-USER -d 172.17.0.2 -p tcp --dport <DOCKER_CONTAINER_PORT> -j DROP

    Where <DOCKER_CONTAINER_PORT> should be replaced with the appropriate container port number. For example:

    # iptables -I DOCKER-USER -d 172.17.0.2 -p tcp --dport 6379 -j DROP

    To deny access from the public network except specific IP addresses:

    # iptables -I DOCKER-USER -d 172.17.0.2 -p tcp --dport <DOCKER_CONTAINER_PORT> -j DROP
    # iptables -I DOCKER-USER -d 172.17.0.2 -p tcp --dport <DOCKER_CONTAINER_PORT> -s <ALLOWED_IPS> -j ACCEPT

    Where <DOCKER_CONTAINER_PORT> should be replaced with the appropriate container port number and <ALLOWED_IPS> should be replaced with the appropriate IP addresses. For example:

    # iptables -I DOCKER-USER -d 172.17.0.2 -p tcp --dport 6379 -j DROP
    # iptables -I DOCKER-USER -d 172.17.0.2 -p tcp --dport 6379 -s 203.0.113.2,192.0.2.2 -j ACCEPT

  3. Remove Firewall extension by referring to this article

    Warning: Disable Firewall rules management in Plesk Firewall will remove all existing firewall rules.

  4. Save the iptables rules to the file system as follows:

    CentOS/RHEL-based distributions

    1. Connect to the server via SSH

    2. Run the following to save firewall rules and load them on server startup:

      # service iptables save
      Saving firewall rules to /etc/sysconfig/iptables: [ OK ]

      # service ip6tables save
      Saving firewall rules to /etc/sysconfig/ip6table[ OK ]

    Debian/Ubuntu-based distributions

    1. Connect to the server via SSH

    2. Install the iptables-persistent package to load firewall rules on server startup:

      # apt-get install iptables-persistent

    3. Save rules to the filesystem

      # netfilter-persistent save

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

The Plesk HoliDeals Calendar is here (Part 2)

Read More »

Containers vs Virtual Machines – What Is The Difference?

Read More »

Recommended OSs for Plesk

Read More »
Knowledge Base

New Public IP address in Plesk is not updated on DNS zones on slave DNS server(s)

Read More »

 Unable to open Updates & Upgrades on Plesk for Linux: ERR_CONNECTION_TIMED_OUT

Read More »

Unable to connect to a Plesk server via FTP when FTP ports are filtered by a firewall: Connection timed out

Read More »

Updating WordPress plugins fails in WP Toolkit: Cannot find module

Read More »

Hosting Wiki

  • Docker
  • Server Redundancy
  • Linux Containers
  • AMP
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • JavaScript
  • Redis
  • Plesk
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • SSH
  • UDP/IP
  • Firewall
  • Network Bandwidth
  • TCP/IP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family