How to Access the Console for an App Platform Component

App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.


The console of an App Platform component is an in-browser command-line terminal whose shell context is a running container instance for a given resource. You can connect to the console of your app’s components (services and workers) to run commands in the component’s container.

By running commands in the console, you can see the active processes that are running inside the container, browse its local file system, monitor resource usage, observe system logs, and more. Connecting to the console is useful for troubleshooting issues, performing maintenance tasks, and running other one-off commands.

This is similar to other container workflows involving logging into the virtualized environment. For example, with containers that have a bash shell, you can achieve the same effect locally by running docker exec -it CONTAINER_ID /bin/bash.

Warning
Container environments are ephemeral, so any changes you make to your app or files in the container using the console do not persist. Additionally, there is no sychronization between containers, so changes you make in one container do not propagate to other containers.

You can access the console for a component using the DigitalOcean Control Panel or doctl, the official DigitalOcean CLI.

Access a Component’s Console Using the CLI

How to Access the Console Using the DigitalOcean CLI
  1. Install doctl, the DigitalOcean command-line tool.

  2. Create a personal access token and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

              doctl auth init
              
  4. Finally, run doctl apps console. Basic usage looks like this, but you can read the usage docs for more details:

                doctl apps console <app id> <component name> [flags]
              

    The following example initiates a console session for the app with the ID f81d4fae-7dec-11d0-a765-00a0c91e6bf6 and the component web:

                  doctl apps console f81d4fae-7dec-11d0-a765-00a0c91e6bf6 web
                

Access a Component’s Console Using the Control Panel

To access a component’s console from the control panel, click your app, then click the Console tab. In the Console tab, select the component that you want access to open its console.

A screenshot of a console open for an app component named sample-nodejs.