Menu
User

DropVPS Team

Writer: John hens

how to open port 8080 on macos 2025

how to open port 8080 on macos 2025

Publication Date

10/14/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Port 8080 is often used for web servers and local development tools. On macOS 2025, you may need to open this port to allow applications to receive external connections.

Step 1: Check Firewall Status

Before opening any port, make sure your system firewall is enabled and working properly.

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate

Step 2: Allow Application Through Firewall

If you’re running a web app or server on port 8080, the easiest and safest way to open it is by allowing your specific application through the macOS firewall.

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/local/bin/node
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/local/bin/node

Step 3: Open Port 8080 Using pf (Packet Filter)

If you want to manually open port 8080 for all incoming traffic instead of just one app, you can use macOS’s built-in pf firewall to add a simple custom rule.

sudo tee /etc/pf.anchors/allow8080 > /dev/null <<'EOF'
pass in proto tcp from any to any port 8080
EOF

Then enable and reload pf to apply the new rule:

sudo pfctl -e 2>/dev/null || true
sudo pfctl -f /etc/pf.conf

Step 4: Test Port 8080

After applying the rules, verify that port 8080 is open and accepting connections.

sudo lsof -i :8080

Or test locally with:

curl -I http://localhost:8080

Step 5: Secure the Configuration

Only open ports that are necessary for your application. To limit access to local traffic only, modify the rule like this

pass in proto tcp from 127.0.0.1 to any port 8080

 

Linux VPS
U
Loading...

Related Posts