Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Cloud Firewall
  6. /
  7. Firewall Common Rules
GUIDECloud Firewall

"Common Firewall Rules"

7 min read

This guide provides pre-built firewall rule sets for common server configurations. Copy these rules directly into your Data Mammoth cloud firewall rule groups to secure your servers quickly. Each rule set follows the principle of least privilege — allowing only the traffic your services need while blocking everything else.

For instructions on creating and applying firewall rules, see How to Set Up Cloud Firewall Rules.

Web Server (HTTP/HTTPS)

The most common configuration for servers hosting websites or web applications.

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP800.0.0.0/0AllowHTTP traffic
InboundTCP4430.0.0.0/0AllowHTTPS traffic
All other inbound traffic is blocked by default deny.

Notes:

  • Replace "Your IP/CIDR" with your actual IP address or range (e.g., 203.0.113.50/32).
  • If you use IPv6, add matching rules for your IPv6 addresses.
  • Consider allowing ICMP if you use monitoring tools that rely on ping.

Database Server

For servers running MySQL, MariaDB, PostgreSQL, or other databases that should only be accessible from specific application servers.

MySQL / MariaDB

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP3306App server IP/CIDRAllowMySQL from app server

PostgreSQL

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP5432App server IP/CIDRAllowPostgreSQL from app server

MongoDB

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP27017App server IP/CIDRAllowMongoDB from app server

Redis

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP6379App server IP/CIDRAllowRedis from app server
Critical: Never expose database ports to the public internet (0.0.0.0/0). Always restrict access to specific server IPs.

Web Application with Database

For servers that run both a web application and a database on the same machine.

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP800.0.0.0/0AllowHTTP traffic
InboundTCP4430.0.0.0/0AllowHTTPS traffic
No database port rule is needed because the database should listen on localhost (127.0.0.1) only when the application is on the same server.

Mail Server

For servers running email services (Postfix, Dovecot, etc.).

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP250.0.0.0/0AllowSMTP (receiving mail)
InboundTCP4650.0.0.0/0AllowSMTPS (secure SMTP submission)
InboundTCP5870.0.0.0/0AllowSMTP submission (with STARTTLS)
InboundTCP9930.0.0.0/0AllowIMAPS (secure IMAP)
InboundTCP9950.0.0.0/0AllowPOP3S (secure POP3)
InboundTCP800.0.0.0/0AllowHTTP (for webmail, if used)
InboundTCP4430.0.0.0/0AllowHTTPS (for webmail, if used)
Notes:
  • Port 143 (IMAP) and port 110 (POP3) are unencrypted versions. Use the encrypted ports (993 and 995) instead.
  • Only include ports 80 and 443 if you run a webmail interface on the same server.

Game Server — Minecraft

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP255650.0.0.0/0AllowMinecraft Java Edition
InboundUDP191320.0.0.0/0AllowMinecraft Bedrock Edition
Add the Bedrock rule only if running a Bedrock server. Add the Java rule only if running a Java server.

Game Server — Generic

For other game servers, identify the specific ports your game needs. Common examples:

GameProtocolPort
Counter-Strike 2TCP/UDP27015
ValheimUDP2456-2458
TerrariaTCP7777
ARK: Survival EvolvedUDP7777-7778, 27015
Project ZomboidUDP16261-16262
Create rules for SSH (restricted) plus the game-specific ports (open to all or restricted to your player community).

VPN Server

WireGuard

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundUDP518200.0.0.0/0AllowWireGuard VPN

OpenVPN

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundUDP11940.0.0.0/0AllowOpenVPN

Docker Host

For servers running Docker with web-facing containers:

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP800.0.0.0/0AllowHTTP (container services)
InboundTCP4430.0.0.0/0AllowHTTPS (container services)
Only add rules for ports your containers expose publicly. Internal container-to-container communication does not need firewall rules.

Monitoring / Admin Panel

For servers running monitoring tools (Grafana, Prometheus) or admin panels that should not be public:

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
InboundTCP3000Your IP/CIDRAllowGrafana (restricted)
InboundTCP9090Your IP/CIDRAllowPrometheus (restricted)
Never expose monitoring and admin dashboards to the public internet. Always restrict access to trusted IPs.

SSH Only (Management Server)

For servers that should only be accessible via SSH:

DirectionProtocolPortSourceActionPurpose
InboundTCP22Your IP/CIDRAllowSSH access (restricted)
This is the most restrictive and secure configuration. Use it for servers that do not serve public traffic.

What to Do Next

  • How to Set Up Cloud Firewall Rules — Apply these rules to your servers.
  • Cloud Firewall Best Practices — Advanced security strategies.
  • Cloud Firewall vs iptables — Layer additional protection with software firewalls.
  • Troubleshooting Cloud Firewall Issues — Fix connection problems caused by firewall rules.

Was this article helpful?

← Back to Cloud FirewallBrowse all categories →

Still have questions?

Contact Support →Submit a Ticket