# How to Open and Close Ports on a VDS Server

https://www.idebilisim.com/en/knowledgebase/article/how-to-open-and-close-ports-on-a-vds-server

This guide explains the key concepts, practical steps and important considerations for how to open and close ports on a vds server.

## What Is a Port?

Ports separate different services running on the same IP address. Common examples include TCP 80 for HTTP, TCP 443 for HTTPS, TCP 22 for SSH and TCP 3389 for RDP.

## What Does Opening a Port Mean?

Opening a port generally means allowing matching traffic through a firewall. A firewall rule alone does not create a service; an application must also be listening.

## Linux Firewalls

Linux systems may use firewalld, nftables, iptables or UFW. Identify the active firewall manager and avoid making conflicting changes through multiple tools.

## Windows Firewall

Windows Server provides Windows Defender Firewall with Advanced Security for inbound and outbound rules. Configure protocol, port, source addresses and profiles carefully.

## TCP and UDP

Confirm which protocol the application uses. Allowing TCP does not automatically allow UDP.

## Restrict Source IPs

Where possible, limit administrative ports to your own trusted IP addresses rather than the entire internet.

## Before Closing a Port

Identify the service using a port before blocking it. Accidentally blocking SSH or RDP can lock you out of the server.

## Testing Ports

Use tools such as ss, netstat or Windows networking utilities to check listening services. Local listening and external reachability are different conditions.

## Conclusion

Allow only the traffic you actually need. Plan firewall changes carefully on your İde Bilişim VDS so you do not lose administrative access.

## Frequently Asked Questions

Before making major changes, record the current configuration and maintain a usable backup. Critical networking, storage and security changes on production servers should be planned and tested carefully.
