Skip to main content

Overview

Forward a local port to a service container port. This allows you to access services running in your Qovery environment from your local machine.

Command

The command requires at least one --port flag specifying the port mapping in local_port:remote_port format.

Usage

Options

Examples

Forward a Single Port

Forward Multiple Ports

Access PostgreSQL Database

Access Application API Locally

Use Cases

Forward database ports to run queries, migrations, or admin tools locally without exposing databases publicly.
Access application debug ports or admin interfaces that aren’t exposed publicly.
Connect your local development environment to remote services (databases, APIs, microservices).
Test APIs or services that aren’t publicly accessible.

Tips

Port forwarding creates a secure tunnel through Kubernetes. The connection is encrypted and authenticated.
Keep the port-forward command running in a terminal window. The tunnel closes when you stop the command (Ctrl+C).
Port forwarding is for development and debugging. For production access, use proper ingress, load balancers, or VPN solutions.
The connection will drop if the pod restarts. You’ll need to restart the port-forward command.

Troubleshooting

Port Already in Use

If the local port is already in use:

Connection Drops

If the connection drops frequently: