How to Disable Windows Server Firewall - Turn off firewall

Thanh Hien Content has been moderated
Published date:25/3/2025 Update:22/7/2026 Views:102 Reviews: 5.0/54reviews
VPTS on

When using a VPS, disabling the firewall is an important step when you encounter issues where you cannot access the VPS remotely, lose connection, or the desktop is not displayed. In this case...

Guide firewallfirewall

Disabling the Firewall is typically used as a temporary diagnostic step to determine if issues originate from the firewall. Users should not disable the Firewall for extended periods, especially on VPS or servers with public IPs, as this increases the risk of port scanning, brute-force password guessing, and unauthorized access.

In this article, VPTS will guide you how to disable and re-enable the Firewall on Windows Server, Windows 10, Windows 11, Ubuntu, Debian, CentOS, Rocky Linux, and AlmaLinux. The article also provides commands to check status, open required ports, and troubleshoot when the firewall is disabled but you still cannot connect to the VPS.

What is a Firewall?

A firewall is a network security system that acts as a barrier between an internal network (computers, enterprise systems) and the outside environment (such as the Internet). It monitors, controls incoming/outgoing traffic, and blocks malicious connections based on established rules.

How to Disable Firewall on Windows Server

Step 1: Open Control Panel on Windows Server

Click the Start button, then search:Control Panel

firewall
Open Control Panel from the Start menu

Step 2: Navigate to Windows Firewall in Control Panel

After opening Control Panel, proceed to:

  • Select System and Security to access system security settings.
  • Here, click Windows Firewall to open the firewall management interface.
disable Firewall
Select Windows Firewall under System and Security

Step 3: Access Firewall toggle settings

After entering the Windows Firewall interface, look to the left side of the window, then click “Turn Windows Firewall on or off” to configure turning the Firewall on/off as desired.

 Firewall
Click “Turn Windows Firewall on or off” on the left sidebar to edit firewall settings.

Step 4: Turn off Windows Firewall

  • Check the Turn off Windows Defender Firewall box in both Private network settings and Public network settings as shown below.
disable firewall
  • Once disabling the firewall is complete, you will see the Windows Defender Firewall interface displayed as follows:
disable firewall

How to disable Firewall on Linux

On Linux, the firewall is typically managed by firewalld, UFW, or iptables. Depending on the operating system you are using, follow the instructions below.

1. Disable Firewall with firewalld

Firewalld is commonly used on CentOS, Rocky Linux, and AlmaLinux.

Open Terminal and run:

sudo systemctl stop firewalld sudo systemctl disable firewalld

In which:

  • stop: Stop the firewall immediately.
  • disable: Prevent firewalld from automatically restarting after VPS reboot.

Check status:

sudo systemctl status firewalld

If inactive (dead) is displayed, firewalld has been disabled successfully.

2. Disable Firewall using UFW

UFW is commonly used on Ubuntu and Debian.

First, check the current status:

sudo ufw status

If the result displays:Status: active ->means the firewall is active.

Disable UFW with the command:

sudo ufw disable

When the notification appears:Firewall stopped and disabled on system startup

UFW has been completely disabled and will not automatically restart upon VPS reboot.

3. Disable Firewall using iptables

Some older Linux distributions may use iptables to manage firewalls.

Check current rules:

sudo iptables -L -n -v

Delete active rules:

sudo iptables -F

If the system has the iptables service, you can stop and disable auto-start using:

sudo systemctl stop iptables sudo systemctl disable iptables

How to re-enable firewall service on Windows Server

Step 1: Open Services tool

Click the Start button, then search:Component Services

Open Component Services to enable the firewall service
Open Component Services from the Start menu.

Step 2:Open Services, find Windows Firewall, right-click, and select Properties.

Open Windows Firewall Properties
Open the Properties of the Windows Firewall service.

Step 3: Change Startup type to Automatic, click Apply, then select Start

Set Windows Firewall to Automatic and Start
Set the service to Automatic and click Start.

Firewall service has been re-enabled. Check necessary ports and test connectivity to ensure the system is operating normally.

When Should You Disable the Firewall?

You should only temporarily disable the Firewall in certain testing or troubleshooting cases, such as:

  • Cannot access website, software, or service ports on the VPS.
  • Need to determine whether Firewall is the cause of the connection error.
  • Installing or testing an application requiring an open network port.
  • Need to quickly test network configurations, NAT, or internal services.
  • The system is already managed by another Firewall layer, but careful verification is still required before disabling it.

Do not disable Firewall long-term on servers running websites, databases, Remote Desktop, SSH, or storing sensitive data. Once testing is complete, re-enable the firewall and create rules for the exact ports or applications needed.

Frequently asked questions

Turned off the firewall but still cannot access?

The cause may not lie with the Firewall. You should also check whether the service is running, whether the application is listening on the correct port, and whether NAT or Router is configured properly.

Why Cannot I Connect to the VPS After Enabling the Firewall?

The cause is often that the Firewall blocked Remote Desktop, SSH, website, or application-specific ports. When the firewall is enabled, connections without an allow rule will be rejected.

CONCLUSION

Disabling the firewall on Windows Server or Linux can help quickly check for blocked ports, Remote Desktop or SSH errors, or software connection issues. However, the firewall should only be disabled temporarily; once the cause is identified, you should turn it back on and create rules for the exact ports in use to keep your VPS operating stably and securely.

If you have turned off the Firewall but still cannot connect, also check service status, listening ports, NAT configuration, Router, or external firewall layers.

VPTS is a provider of VPS, Hosting, and digital infrastructure solutions in Vietnam, accompanying customers throughout deployment, operation, and system troubleshooting.

VPTS– Resilient infrastructure, worry-free operations.

VPTS – Comprehensive Digital Infrastructure Solutions Provider

VPTS is a digital infrastructure solution provider in Vietnam, serving deployment, operation, and data storage needs for individuals, developers, and enterprises. The service ecosystem includesVietnam VPS, International VPS, VPS Anti DDoS, Hosting cPanel, dedicated server, Rack rental, Proxy IPv4/IPv6, S3 MinIOandCloud Storage.

Besides providing infrastructure resources, VPTS also focuses on assisting customers with deployment, configuration, and practical troubleshooting. Content on the VPTS Blog is drawn from common scenarios in operating VPS, servers, and online systems, helping readers understand root causes and apply clear solutions.

VPTS – Stable infrastructure, flexible solutions, and continuous partnership throughout operations.

VPTS Team Contact Information