The advent calendar is open

A door every day, a raffle every week

New

EmeraldHost 2.0 is here: the new panel!

Learn more
Guides
AMD EPYC VPSDashboardSet Up Firewall

How to Set Up the Firewall of Your Root Server

Create firewall rules for your root server, avoid the typical mistakes and get back in after locking yourself out

12 min read

With the Firewall in your root server's dashboard you decide which traffic may reach and leave your server. The rules apply in front of your server, so they work regardless of the operating system it runs. This guide explains the terms, walks you through every field of a rule and helps you when you have locked yourself out.

The most important terms

Term Meaning
Incoming (IN) Traffic that comes to your server from outside, e.g. a visitor of your website or your SSH connection.
Outgoing (OUT) Traffic your server sends out itself, e.g. when it downloads updates or opens a website.
ACCEPT The traffic is allowed.
DROP The traffic is discarded without an answer. To the sender it looks as if nobody is there.
REJECT The traffic is refused and the sender gets a rejection back.
TCP Connection protocol for most services, e.g. websites (80, 443), SSH (22) and Remote Desktop (3389).
UDP Connectionless protocol, e.g. for DNS (53), many game servers and voice services.
Source Port The port on the sender's side. The sender usually picks it at random when connecting. Leave this field empty in almost all cases.
Destination Port The port the traffic is sent to. For incoming traffic this is the port of your service, e.g. 22 for SSH.

A port is a number between 1 and 65535 through which a specific service on a server can be reached.

How the firewall works

  • Without rules of your own, your server is reachable in both directions. A hidden built-in rule allows all traffic to and from your server's IP addresses.
  • To restrict traffic, you create DROP rules. You only need an ACCEPT rule as an exception to a block, e.g. "block port 22, but allow it for my IP address".
  • Three system rules are built in. They block outgoing mail over the TCP ports 25, 465 and 587 (spam protection). You see them in the list with a lock icon. You cannot edit, delete, disable or move them. If you need to send mail, e.g. for your own mail server, they can be unlocked through a support ticket.
  • Up to 50 rules of your own per server. The system rules do not count towards this.
  • Changes apply immediately, no server restart is needed. Disabled rules have no effect.

Open the firewall

  1. Open the dashboard
    Open your root server's dashboard.

  2. Open the firewall
    In the left sidebar, click Firewall. You see the Firewall Options card and below it the list of rules with the columns Priority, Direction, Action, Protocol, Port, Comment and Status.

    "Firewall Options" card with "Firewall Status" Yes and DROP as "Default Policy (IN)" and "Default Policy (OUT)" (1), below it the "Create Rule" button (2)

The Port column only shows the destination port. You only see the source address, destination address and source port when you edit a rule. The Search rules... field finds rules by their comment.

Create a rule

  1. Open the dialog
    Click Create Rule. The Create Firewall Rule dialog opens.

    "Create Firewall Rule" dialog with an empty Source Port (1) and Destination Port 443 (2)

  2. Choose the direction
    Under Direction, choose Incoming (IN) for traffic to your server or Outgoing (OUT) for traffic your server sends. Incoming (IN) is preselected.

  3. Choose the action
    Under Action, choose ACCEPT, DROP or REJECT. ACCEPT is preselected. To block traffic, you need DROP or REJECT.

  4. Choose the protocol
    Under Protocol, choose TCP, UDP, ICMP, ICMPv6, GRE or ESP. TCP is preselected. There is no option for all protocols: to block TCP and UDP, you create two rules.

  5. Enter a source address (optional)
    In the Source section, Source Address (optional) defines which addresses the traffic must come from for the rule to apply. Type an IP address or a network such as 169.254.169.254 or 169.254.169.0/24 and press Enter. Below the field you can add Any IPv4, Any IPv6 or your server's IP address with one click. Empty means: from any address.

    Highlighted "Source Address (optional)" field under "Source" in the "Create Firewall Rule" dialog with the entered address 169.254.169.254, below it the suggestions "Any IPv4", "Any IPv6" and the IP address of the server

  6. Leave the source port empty
    Leave Source Port empty in almost all cases. The section "The two most common mistakes" below explains why.

  7. Enter a destination address (optional)
    In the Destination section, Destination Address (optional) defines which addresses the traffic must go to. For incoming rules you usually leave it empty.

  8. Enter the destination port
    Under Destination Port, enter the port of your service, e.g. 443. Separate several ports with commas and no spaces (80,443), write a range with a colon (8000:9000). The hint below the field shows spaces and a dash, but only the comma and colon notation is saved. Empty means: all ports.

  9. Enter a comment
    In the Options section, describe under Comment what the rule is for, e.g. "SSH from home only". The search only looks at the comment.

  10. Save the rule
    Leave Enable rule checked so the rule applies right away, and click Create. The new rule appears at the end of the list.

For addresses, also note: a list may only contain IPv4 or only IPv6 addresses, and source and destination must belong to the same address family. ICMP only works with IPv4 addresses, ICMPv6 only with IPv6 addresses.

The two most common mistakes

Mistake 1: Source port filled in

Many people enter the same port under Source Port and Destination Port, e.g. 25565 twice. Then the rule practically never applies. Whoever connects to your server sends the request from a random port on their side (e.g. 51234) to the port of your service (25565). A rule with source port 25565 therefore does not match that connection.

The right way: enter your service's port only under Destination Port and leave Source Port empty.

Mistake 2: DROP mistaken for allowing, or outgoing ports blocked

DROP blocks, it does not allow anything. Creating DROP rules to "open ports 80 and 443" achieves the opposite. You do not need to open anything: incoming traffic is already allowed without rules of your own.

DROP rules with the direction Outgoing (OUT) for these ports have the biggest impact:

Destination port Effect of an outgoing block
53 (UDP and TCP) Your server can no longer resolve names. It no longer finds e.g. emerald.game, updates and downloads fail.
80 (TCP) Your server can no longer load websites over HTTP, many update repositories become unreachable.
443 (TCP) Your server can no longer load websites over HTTPS, updates, license checks and many programs stop working.

Order of the rules

This section matters as soon as you combine a block with an exception, e.g. "block port 22, but allow it for my IP address".

  • The first matching rule decides. When a rule matches the traffic, the traffic is allowed or discarded and no further rules are checked.
  • The three mail system rules are always checked first. An ACCEPT rule of your own for port 25 therefore cannot override them.
  • After that, your rules are checked from the bottom up. The rule at the very bottom of the list is checked first, your topmost rule last.
  • If none of your rules matches, the built-in rule applies, which allows traffic to and from your server's IP addresses.
  • The Priority column only sets the position in the list: a smaller number means further up. A new rule always gets the highest number and ends up at the bottom. Use the arrows on the left of a row to swap a rule with its neighbor. The system rules always stay at the top.

This gives you the rule of thumb: the exception (ACCEPT) must be below the block (DROP) in the list. The easiest way is to create the block first and the exception afterwards, then the order is right automatically. If an exception does not work, check whether it is above the block and move it down with the arrow.

Examples

In all examples, Source Port and Destination Address (optional) stay empty. "Block" and "exception" mean the same as in the section "Order of the rules": create the block first, the exception afterwards.

Web server only on 80 and 443, management via SSH or RDP

All incoming TCP connections are blocked except the website and remote access. Use 22 for SSH on Linux or 3389 for Remote Desktop (RDP) on Windows.

Field Block Exception web Exception remote access
Direction Incoming (IN) Incoming (IN) Incoming (IN)
Action DROP ACCEPT ACCEPT
Protocol TCP TCP TCP
Source Address (optional) empty empty empty
Destination Port empty 80,443 22 or 3389
Comment Block everything else Web server SSH or RDP

SSH or RDP only from your own IP address

Replace 169.254.169.254 with the public IP address of your internet connection.

Field Block Exception
Direction Incoming (IN) Incoming (IN)
Action DROP ACCEPT
Protocol TCP TCP
Source Address (optional) empty 169.254.169.254
Destination Port 22 or 3389 22 or 3389
Comment Block SSH for everyone SSH from home

Block a single port

A service should not be reachable from outside, e.g. a database on port 3306. One rule is enough, the order does not matter.

Field Block
Direction Incoming (IN)
Action DROP
Protocol TCP
Source Address (optional) empty
Destination Port 3306
Comment Database not public

Open an application or game port after everything was blocked

You already have a block for all incoming TCP connections (as in the first example) and also want to make e.g. a Minecraft server on port 25565 reachable. Create the exception as a new rule, it automatically ends up below the block. If your game uses UDP, choose UDP and keep in mind that a TCP block does not block any UDP traffic.

Field Exception
Direction Incoming (IN)
Action ACCEPT
Protocol TCP
Source Address (optional) empty
Destination Port 25565
Comment Minecraft server

Edit, disable and delete rules

Each row has a menu with three dots on the right:

Action Description
Edit Opens the Edit Firewall Rule dialog with all fields. Save with Update.
Disable / Enable Switches the rule off or on again without deleting it. Ideal for testing.
Delete Removes the rule permanently after you confirm in the Delete Firewall Rule dialog.

Firewall rule list with the actions menu of the own HTTPS rule open and the "Edit" entry highlighted

The Status column shows whether a rule is currently active: Enabled or Disabled. Rely on this column if you are unsure after switching a rule.

I have locked myself out

You can always reach the dashboard, even when your server itself is no longer reachable. That is where you undo the change.

  1. Open the firewall
    Open your root server's dashboard and click Firewall in the left sidebar.

  2. Look for outgoing blocks first
    Look for rows with Direction OUT and Action DROP (except the system rules with the lock). They are the most common cause when your server can no longer download updates or open websites.

  3. Disable the newest rules
    New rules are at the bottom of the list. In the menu of the bottom rules, choose Disable one after another and check after each rule whether the connection works again.

  4. Fix or delete the rule
    Once you have found the cause, fix the rule with Edit or remove it with Delete.

If that does not help, the block is probably inside the operating system itself, e.g. in UFW, in the Windows Firewall or in the SSH configuration. Then use the Console in your server's header: this VNC console shows your server's screen directly and works independently of SSH, network and firewall. You need the team permission VNC Console for it. To learn how it works, see Use the VNC console.

Troubleshooting checklist

  • Does Firewall Status show "Yes"? With "No", your rules have no effect.
  • Is the rule Enabled in the Status column?
  • Is the Direction right? Visitors of your server are Incoming (IN), downloads of your server are Outgoing (OUT).
  • Is Source Port empty? Open Edit to check, the list does not show the source port.
  • Are ports written without spaces and ranges with a colon (80,443, 8000:9000)?
  • Is the Protocol right? Many games and DNS use UDP.
  • Is an exception below its block (see "Order of the rules")?
  • Is there an outgoing DROP rule for 53, 80 or 443?
  • Does the firewall inside the operating system (UFW, Windows Firewall) block the service as well?
  • Is the service actually running on the server and listening on the expected port?

FAQ

Do I need ACCEPT rules for my services?

No. Without rules of your own, your server is reachable in both directions. You only need ACCEPT as an exception to a block.

Can I change the default policy?

No. The Firewall Options card only displays the values. You control the firewall exclusively through your own rules.

Can I send mail over port 25, 465 or 587?

Not without unlocking. The three system rules block these ports to prevent spam. They can be unlocked through a support ticket. For your own mail server you also need a matching reverse DNS entry, see Manage IP addresses and reverse DNS.

Does the firewall in the dashboard replace UFW or the Windows Firewall?

No, both work independently of each other. For a service to be reachable, neither of them may block it. Learn more under Install UFW and Open Windows Firewall ports.

How many rules can I create?

Up to 50 rules of your own per server. Once you reach the limit, combine rules, e.g. several ports in one rule with 80,443.

Next steps

If something does not work, open a support ticket in the dashboard. Include the server ID and the affected rules.

Written byEmeraldHost Team
Last updated on Dec 1, 2026 Edit on GitHub

Did this article help you?

Your feedback helps us improve our guides.

Help shape the guides

€10.00 in credit for every new guide, €5.00 for every improvement.

Contact Support

Create a support ticket and our team will get back to you as soon as possible – personal and professional.

Go to Support
1257 members online

Discord Community

Connect with other players, get quick help from the community, and stay up to date with the latest news.

Join Discord
AMD EPYC VPS

Ready to get started?

Rent your AMD EPYC VPS now

Join our Discord community 1257 members online right now