How do I jump into my containers for debugging in Porter?

Last updated: December 17, 2025

Context

When running applications in Porter, developers may need to access their deployed containers directly for debugging issues in staging or production environments. This requires the ability to SSH into specific containers to investigate and troubleshoot problems.

Answer

Porter provides a simple CLI command to access your containers for debugging purposes. You can use the porter app run command in two ways:

  1. Create a copy of the container (default behavior):
    porter app run <app-name> -- bash

  2. Access an existing container directly:
    Use the -e flag to connect to an existing container instead of creating a copy:
    porter app run -e <app-name> -- bash

  3. Access containers in preview environments:
    Use the -x flag followed by the preview branch name to connect to containers in specific preview environments:
    porter app run -x <preview-branch-name> <app-name> -- bash

For detailed information about additional command options and parameters, refer to the Porter CLI documentation.