How to Balance TCP Traffic

Last verified 22 Jun 2026

DigitalOcean fully manages Regional Load Balancers and Global Load Balancers, ensuring they are highly available load balancing services. Load balancers distribute traffic to groups of backend resources in specific regions or across different regions, which prevents the health of a service from depending on the health of a single server, cluster, or region.

Regional load balancers support TCP balancing for applications that do not speak HTTP. To set up TCP balancing, you need:

To configure the load balancer to balance TCP, you need to add a TCP forwarding rule and a TCP health check.

Add the TCP Forwarding Rule

From the Control Panel, click Networking in the main menu, then click Load Balancers. Click your load balancer’s name to open its Overview page.

On the Overview page, click the Settings tab.

Forwarding Rules section on the Settings tab showing an HTTP on Port 80 rule on both the load balancer and Droplets sides, with an Edit button.

Click Edit in the Forwarding Rules section. Modify the existing rule by clicking the (More) menu on the rule row, then change the protocol from HTTP to TCP and update the port on the Load Balancer and Droplets sides from 80 to the listening port of your application. For example, when using a Galera cluster, use the MariaDB port 3306. When you’re done, click Save.

Add the TCP Health Check

On the same Settings tab, click Edit in the Health Checks section. An HTTP health check is defined by default.

Change Protocol type to TCP. In the Port field, change the value from 80 to the listening port of your application. Adjust Check interval, Response timeout, Unhealthy threshold, and Healthy threshold as needed.

Health Checks editor showing protocol type, port, path, check interval, response timeout, unhealthy threshold, and healthy threshold fields, with Save and Cancel buttons.

Click Save to implement the change.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.