Managing Dash Apps from the Command Line

This documentation is for Dash Enterprise,
Plotly’s commercial platform for managing and improving
Dash applications in your organization.
View the docs or
request a trial.

After setting up SSH authentication (see our ssh doc), you will
be able to use the commands below to help manage your apps from the command line.

All commands are performed using ssh dokku@your-dash-enterprise -p PORT command flags appname where
PORT is the ssh port for Dash Enterprise (usually 3022). Dash Enterprise will compare the private key supplied to the ssh command
and the public key uploaded to Dash Enterprise in order to authenticate the user initiating the request.

Note that using the same public key for multiple users on Dash Enterprise isn’t supported and will likely prevent it
from authenticating to the correct user.


List of exposed Dash Enterprise commands:

These commands can only be run by the app-owner or an admin account.

Lock app

 

If you wish to disable deploying for a period of time, this can be
done via deploy locks. Normally, deploy locks exist only for the duration
of a deploy to prevent deploys from colliding, but a deploy lock can
be created at any time by running the apps:lock command.

Example:

ssh dokku@your-dash-enterprise -p PORT apps:lock my-dash-app

 

Unlock app

 

In some cases, it may be necessary to remove an existing deploy lock.
This can be performed via the apps:unlock command.

Warning: Removing the deploy lock will not stop in-progress deploys.
At this time, in-progress deploys will need to be manually terminated by
someone with access to the Dash Enterprise server console.

Example:
ssh dokku@your-dash-enterprise -p PORT apps:unlock my-dash-app

 

Get app logs

 

You can get logs of an app using the logs command:

Example:
ssh dokku@your-dash-enterprise -p PORT logs my-dash-app

logs also support following flags:

-n, --num NUM          # the number of lines to display
-p, --ps PS            # only display logs from the given process
-t, --tail             # continually stream logs
-q, --quiet            # display raw logs without colors, time and names

You can use these flags as follows:

ssh dokku@your-dash-enterprise -p PORT logs my-dash-app -t -p web

 

Get logs from failed deploy

 

In some cases, it may be useful to retrieve the logs from a previously failed deploy.
You can retrieve these logs with the logs:failed command.

Example:

ssh dokku@your-dash-enterprise -p PORT logs:failed my-dash-app

 

Rebuild an app's environment

 

You can trigger an application to rebuild its environment using ps:rebuild.

Example:

ssh dokku@your-dash-enterprise -p PORT ps:rebuild my-dash-app

 

Get a report of your app's status

 

This command displays a process report for one or more apps.

Example:

ssh dokku@your-dash-enterprise -p PORT ps:report my-dash-app

You can also retrieve a specific piece of service info via flags:

--processes         # Display only the number of running processes
--deployed          # Display only the deploy status i.e. true or false
--running           # Display the running status i.e. true or false
--restore           # Display the running status i.e. true or false
--restart-policy    # Display the restart policy for the app

ssh dokku@your-dash-enterprise -p PORT ps:report my-dash-app --processes

 

Restart an app

 

Applications can be restarted, which is functionally identical to releasing and deploying an application.

Example:

ssh dokku@your-dash-enterprise -p PORT ps:restart my-dash-app

 

Stop an app

 

Deployed applications can be stopped using the ps:stop command.
This turns off all running containers for an application, and will result in a 502 Bad Gateway response.

Example:

ssh dokku@your-dash-enterprise -p PORT ps:stop my-dash-app

 

Start an app

 

All stopped containers can be started using the ps:start command.

Example:

ssh dokku@your-dash-enterprise -p PORT ps:start my-dash-app

 

Scale app processes

 

Dash Enterprise can also manage scaling applications (increase the number of containers for processes defined
in the Procfile) via the ps:scale command. Dash Enterprise only scales the web process by default so if you
define others you will need to scale them.

Example:

ssh dokku@your-dash-enterprise -p PORT ps:scale my-dash-app web=1

This command can be used to scale multiple process types at the same time.

ssh dokku@your-dash-enterprise -p PORT ps:scale my-dash-app web=1 worker=1

The ps:scale command with no process type argument will output
the current scaling settings for an application:

ssh dokku@your-dash-enterprise -p PORT ps:scale my-dash-app
-----> Scaling for my-dash-app
-----> proctype           qty
-----> --------           ---
-----> web                1
-----> worker             1

 

List persistent storage directories

 

List bind mounts for an app’s container(s) (host:container).
See our doc on mapping local directories for more info on
how to set these up.

Example:
ssh dokku@your-dash-enterprise -p PORT storage:list my-dash-app

 

These commands, for services such as Redis DBs, can only be run by the service-owner.

Export the contents of a Redis database

 

Export a dump of the Redis service database. By default, datastore output is exported to stdout:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:export redis-db

You can redirect this output to a file:

ssh dokku@your-dash-enterprise -p PORT redis:export redis-db > db.dump

Upload an existing redis dump to Redis database

 

Import a datastore dump:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:import redis-db < db.dump

 

Get connection info for a Redis service

 

Print the connection information. Get connection information as follows:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:info redis-db

You can also retrieve a specific piece of service info via flags:

ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --config-dir
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --data-dir
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --dsn
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --exposed-ports
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --id
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --internal-ip
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --links
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --service-root
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --status
ssh dokku@your-dash-enterprise -p PORT redis:info redis-db --version

 

Get Redis logs

 

Print the most recent log(s) for this service.

Example:

ssh dokku@your-dash-enterprise -p PORT redis:logs redis-db

By default, logs will not be tailed, but you can do this with the –tail flag:

ssh dokku@your-dash-enterprise -p PORT redis:logs redis-db --tail

 

Restart a Redis service

 

Restart the service:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:restart redis-db

 

Stop a Redis service

 

Stop the service:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:stop redis-db

 

Start a stopped Redis service

 

Start the service:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:start redis-db

 

Service Linking Commands:

These commands can only be run by the user who owns both the service as well as the application.

Link Redis to an app

 

Link the Redis service to the app. This will also restart your app:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:link redis-db my-dash-app

 

Unlink Redis from an app

 

Unlink the Redis service from the app. This will also restart your app and unset related environment variables:

Example:

ssh dokku@your-dash-enterprise -p PORT redis:unlink redis-db my-dash-app