Cloudflare doesn't open ports — your server does
Cloudflare is a proxy service that sits between your visitors and your server. It doesn't control which ports your server listens on. To use port 3000, you need to configure your actual server to accept traffic on that port, then point Cloudflare's DNS records toward it. Cloudflare can route traffic to port 3000, but the port itself must already be open and listening on your server.
Port 3000 is commonly used by development servers like Node.js, Ruby on Rails, and Python frameworks. If you're running one of these locally, it works without Cloudflare. If you want Cloudflare to route traffic to port 3000 on a live server, you'll need to tell Cloudflare which port to use and make sure your server firewall allows it.
Key Takeaways
- Cloudflare routes traffic to your server but does not open ports — your server's firewall and application must listen on port 3000.
- You configure port routing in Cloudflare by creating an origin rule or using the origin server settings in your DNS records.
- Your server's operating system firewall (iptables, Windows Firewall, or cloud provider security groups) must allow inbound traffic on port 3000.
- Cloudflare's free plan does not support non-standard ports on HTTP — you must use HTTPS and a Business plan or higher for port 3000 to work reliably.
Check your Cloudflare plan limits for non-standard ports
Cloudflare's free and Pro plans support only ports 80 (HTTP) and 443 (HTTPS) for web traffic. Port 3000 is a non-standard port, so you need a Business plan or higher to route traffic to it through Cloudflare. If you're on a lower plan, Cloudflare will accept the DNS record but may not actually forward traffic to port 3000.
If you're testing locally or running a development server, you don't need Cloudflare at all — just access your server directly at your-server-ip:3000 or localhost:3000. Cloudflare becomes necessary only when you want to route public traffic through its network to a non-standard port, which requires a paid plan.
Configure your origin server to listen on port 3000
Before Cloudflare can route traffic anywhere, your application must be listening on port 3000. If you're running Node.js, the default is often port 3000 already. If you're using a different framework, check its documentation for how to specify the port. For example, a Node.js Express server typically starts with app.listen(3000), and a Python Flask app uses app.run(port=3000).
Start your application and verify it's running by connecting directly to your server. Open a terminal and run curl http://your-server-ip:3000 or visit http://your-server-ip:3000 in a browser. If you see your application's response, port 3000 is listening. If you get a connection refused error, the application isn't running or isn't bound to that port.
Open port 3000 in your server's firewall
Your server's operating system firewall must allow inbound traffic on port 3000. On a Linux server using iptables, run:
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
On a Windows server, open Windows Defender Firewall, go to Inbound Rules, and create a new rule allowing TCP port 3000. If your server is hosted on AWS, Google Cloud, Azure, or another cloud provider, you also need to configure the security group or firewall rules in that provider's console. For example, AWS security groups require you to add an inbound rule for port 3000 with the protocol set to TCP and the source set to your Cloudflare IP ranges or 0.0.0.0/0 if you want to allow all traffic.
Set up the DNS record and origin rule in Cloudflare
Log into your Cloudflare dashboard and go to the DNS section. Create an A record pointing your domain to your server's IP address. For example, if your domain is example.com and your server IP is 192.0.2.1, create an A record with the name example.com and the content 192.0.2.1. Make sure the record is proxied (orange cloud icon) so traffic routes through Cloudflare.
Next, go to Rules > Origin Rules (or Dynamic Routes, depending on your plan) and create a rule that specifies port 3000 as the destination. The rule should match your domain and rewrite the origin port to 3000. If your plan doesn't have Origin Rules, you may need to use a Page Rule or upgrade to Business. Some plans allow you to set the origin port directly in the DNS record settings under "Origin Server" or similar.
Test the connection through Cloudflare
After your DNS record is set and your firewall is open, wait a few minutes for DNS to propagate. Then visit your domain in a browser — for example, https://example.com. Cloudflare should route the request to your server on port 3000, and you should see your application's response.
If you see a Cloudflare error page or a timeout, check a few things. First, verify your application is still running on the server. Second, confirm the firewall rule is in place by running sudo iptables -L on Linux or checking Windows Firewall rules. Third, check your cloud provider's security group to make sure port 3000 is allowed. Fourth, review Cloudflare's error logs in the Analytics section to see what error Cloudflare is reporting.
Troubleshoot common port 3000 issues
If traffic isn't reaching port 3000, the most common cause is that your plan doesn't support non-standard ports. Verify you're on a Business plan or higher. If you are, check that your origin rule is correctly configured and that the port is set to 3000, not 80 or 443.
Another common issue is that your application is listening on localhost or 127.0.0.1 instead of 0.0.0.0. When bound to localhost, the application only accepts connections from the server itself, not from Cloudflare or external traffic. Update your application configuration to bind to 0.0.0.0:3000 so it listens on all network interfaces. For Node.js, change app.listen(3000) to app.listen(3000, '0.0.0.0').
Frequently Asked Questions
Can I use port 3000 on Cloudflare's free plan?
No. Cloudflare's free and Pro plans only support ports 80 and 443. You need a Business plan or higher to route traffic to port 3000. If you're testing locally, you don't need Cloudflare — access your server directly at the IP and port.
Do I need to open port 3000 if I'm using Cloudflare?
Yes. Cloudflare routes traffic to your server, but your server's firewall must allow it. If port 3000 is blocked by your OS firewall or cloud provider security group, Cloudflare's traffic will be refused at the server level.
Why does my application work on localhost:3000 but not through Cloudflare?
Your application is probably bound to localhost instead of 0.0.0.0. When bound to localhost, it only accepts local connections. Change your application to listen on 0.0.0.0:3000 so it accepts traffic from Cloudflare and external sources.
What if my cloud provider blocks port 3000?
Check your cloud provider's security group or firewall rules. AWS, Google Cloud, Azure, and others require you to explicitly allow inbound traffic on each port. Add an inbound rule for TCP port 3000 with the source set to Cloudflare's IP ranges or 0.0.0.0/0.
Can I hide port 3000 from the URL?
Yes, if you use Cloudflare's origin rule to rewrite the port. Visitors see https://example.com in their browser, but Cloudflare routes the request to your-server-ip:3000 behind the scenes. The port number stays hidden from the URL.