Skip to main content

Overview

Execute commands in running application or container instances, or open an interactive shell session.

Commands

Interactive Shell

Open interactive shell in application:
qovery shell --application "app-id"
Open shell in specific pod:
qovery shell --application "app-id" --pod "pod-name"

Execute Command

Run a single command:
qovery shell --application "app-id" --command "ls -la"
Run multiple commands:
qovery shell --application "app-id" --command "cd /app && npm run migrate"

Port Forward

Forward local port to application:
qovery port-forward \
  --application "app-id" \
  --port 8080:8080
Forward to different local port:
qovery port-forward \
  --application "app-id" \
  --port 3000:8080

Options

FlagDescription
--applicationApplication ID or name
--containerContainer ID or name
--commandCommand to execute
--podSpecific pod name
--portPort forwarding (local:remote)
--helpShow help

Examples

Debug Application

# Open interactive shell
qovery shell --application "my-api"

# Inside the shell:
$ ls -la
$ cat config.json
$ env | grep DATABASE
$ exit

Run Database Migrations

# Execute migration command
qovery shell \
  --application "my-api" \
  --command "npm run migrate"

Check Application Files

# List application files
qovery shell \
  --application "my-api" \
  --command "ls -lah /app"

# Check environment variables
qovery shell \
  --application "my-api" \
  --command "env"

Access Database

# Forward PostgreSQL port
qovery port-forward \
  --database "postgres-main" \
  --port 5432:5432

# In another terminal, connect with psql
psql -h localhost -p 5432 -U user -d database

Debug Container

# Shell into container
qovery shell --container "nginx-proxy"

# Run diagnostics
qovery shell \
  --container "nginx-proxy" \
  --command "nginx -t"

Tips

Use interactive shell for exploratory debugging and one-off commands.
Port forwarding is useful for accessing databases or services locally without exposing them publicly.
Be careful when executing commands in production environments. Changes are not persistent across pod restarts.